Re: [pysqlite] Save memory database to file/load memory database from file

Gerhard Häring <[email protected]>
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <[email protected]>
python-N8/[email protected] wrote:
> Malcolm Greene wrote:
>> Is there a generic, best practice way to save an arbitrary memory
>> database to file and then later restore that file image to memory?
> 
> Gerhard wrote:
> I've always wondered what the use case for that is. Can you tell us why 
> you want to do this?
> 
> Gerhard,
> 
> I would like to use SQLite databases as a container for an application
> specific file format. The databases will be small enough to fit in
> memory where our application can get the best performance.

Ok, premature optimization, just like I thought :->

You'll get the same performance, and less code if you just use a 
disk-based database. If it turns out to be necessary, you can use 
various SQLite PRAGMA commands to tune your database access. Most likely 
this won't be necessary, though.

-- Gerhard
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.