Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9235471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:02:41+00:00 2026-06-18T07:02:41+00:00

I am trying to create an sql (sqlite) database where users upload an stl

  • 0

I am trying to create an sql (sqlite) database where users upload an stl file and the data (all the points, triangles, ect.) is stored in a database so that it is permanently available. Is it possible to do this with a database with only two columns (three with the key): name (title for the url), and data (the array data)?

The data array is in the format: [[[x1,y1,z1],....],[[v1,v2,v3],...]]. All points are given first and then the triangles are defined through ordering of the points given. Can this array be stored in the database, and if so, what data type would it be (integer, string, ect.)?

Upon reading into this issue more, It seems that pickling would be a good way to go: http://docs.python.org/2/library/pickle.html

I am having trouble figuring out how to implement this. Should I just add pickle(data)?

Edit: upon further review, it seems like pickling introduces some security holes that do not exist if using JSON. Is it possible to simply call jsondatastring=JSON.stringify(data) and then save that to the database? If so, what would be the appropriate column type?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T07:02:43+00:00Added an answer on June 18, 2026 at 7:02 am

    If your intention is only to store the array in DB and work with it in your webapp code, SQLAlchemy’s PickleType is a good choice. Pickling and unpickling will be done transparently for you:

    from sqlalchemy.types import PickleType
    
    class Foo(Base):
        __tablename__ = 'foo'
        id = Column(Integer, primary_key=True)
        name = Column(String)
        array = Column(PickleType)
    
    foo = Foo(name=u'bar', array=[1, 2, 3])
    session.add(foo)
    session.commit()
    
    foo = session.query(Foo).filter_by(name=u'bar').one()
    print foo.array
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to connect my application to a SQLite database with LINQ-to-SQL, and
I am trying to create an SQLite database. The create method: private static class
I'm trying to create an SQLite3 database file through Objective-C at run time. I
I am trying to create a SQLite database within my android app, but my
I am trying to store data in created SQLite database. Here is the code
I am trying to query an Microsoft SQL 2005 database, process the data and
I'm trying to use org.sqlite.JDBC to create and update a sqlite database in ant.
I am trying to create a Sqlite database using Monotouch 3.0.3.4. Everything works fine
I have a database with 1000 records. I am trying to create an SQL
I'm trying to use an SQLite database to store some data for my app.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.