You could create a new os_ram.c file, with new versions of these functions, but 
instead of read/writing to disk you are read/writing from a linked list of 
filenames, of which each could contain a ptr to the file data.  You would then 
be responsible for copying it back to disk at some point.  And loading it from 
disk when it starts, into your psuedo ram file system.

I guess this would also allow multithreaded access to an in memory database (if 
the locking is also implemented).  Where as opening the "%memory%" one, is only 
single threaded (in the cache), I think?

But you loose sharing the db across processes.   Which I don't think matters to 
you, if you want to load it all into ram anyway.

sqlite3OsOpenReadWrite
sqlite3OsOpenExclusive
sqlite3OsOpenReadOnly
sqlite3OsClose
sqlite3OsRead
sqlite3OsWrite
...
 

-----Original Message-----
From: Dirk Theisen [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 07, 2005 7:09 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] SQLite in memory database from SQLite (3.x) file database?

Hello, John!

> It would be nice to have option that just loads the db file into 
> memory or  otherwise caches the contents wholly in memory.  Are there 
> any caching options in sqlite that would mirror this behavior?

You could set the cache size as big as your database file (via pragma). 
This should load all (used) data into memory. This is probably not a good 
solution if your application does not run for a longer time.

Greetings,
   Dirk


--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.8.10/43 - Release Date: 6/07/2005
 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.8.10/43 - Release Date: 6/07/2005
 

Reply via email to