"Drew, Stephen" <[EMAIL PROTECTED]> wrote:
>  
> Presumably, the in-memory database is in contiguous memory....

Sorry, that is not the case.

> as I guess
> the format is the same as the disk-based database format.  Would it be a
> lot of work to be able to construct an in-memory database with a chunk
> of memory (allocated by the user), and a size?  The database could then
> be created in shared memory, and a SQLITE_FULL error returned if the
> database attempted to grow outside this size limit.  The shared memory
> segment could be flushed to disk independently and when the application
> decides.
>  
> Is this a reasonable request and would this be useful to anyone else?
> Or is there something already present that I could use?
>  

If you set

   PRAGMA synchronous=OFF

then SQLite will still think it is writing to disk, but the operating
system will not actually flush those writes to disk until it is ready.
Most of the data will be held in the operating systems disk cache.
This makes things go a lot faster (which is presumably what you are
trying to accomplish) but means that the database will likely be
corrupted if you take an unexpected power loss or operating system
crash.  (Application crashes will *not* corrupt the database when
synchronous=OFF - only a power failure or operating system crash can
do that.)

--
D. Richard Hipp   <[EMAIL PROTECTED]>

Reply via email to