Re: [sqlite] archiving memory databases

2009-01-29 Thread Rob Sciuk

> From: "DeTerra, David J" 
> Hi all,
> 
> I was wondering if there is a feature in sqlite that would allow a set
> of in-memory databases to periodically be written to disk for purposes
> of database recovery on application or machine failure?
> 
> And then subsequently read those persisted database files back into a
> memory database on restart?
> 
> Thanks,
> David

Actually, given the embedded nature of SQLite, I could see a use for this. 
Provide a function which would provide a Blob like interface (ptr/len) to 
a memory database in a quiescent/consistent state, which could 
subsequently be saved to disk, or indeed, as a blob within a database, and 
then at some time in future be re-constituted as a live memory database 
... hmmm ...


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] archiving memory databases

2009-01-29 Thread Simon
I havent seen any such functions, but you can write your own code to
copy data from one db (in-memory) to another (on disk).
Copy pasting example from another thread:
 attach second.db as second
 insert into main.table (select * from second.table)
 detach second
--
You could also implement something to only copy what has changed since
last time, or you could attach different files every time to create
full snapshots
--
Another way, on linux, is to create a disk-based database and store it
in ram disk such as /dev/shm, and then just copy this file back on
disk (say using cron?).

HTH,
  Simon

On Tue, Jan 27, 2009 at 5:28 PM, DeTerra, David J
 wrote:
> Hi all,
>
> I was wondering if there is a feature in sqlite that would allow a set
> of in-memory databases to periodically be written to disk for purposes
> of database recovery on application or machine failure?
>
> And then subsequently read those persisted database files back into a
> memory database on restart?
>
> Thanks,
> David
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
When Earth was the only inhabited planet in the Galaxy, it was a
primitive place, militarily speaking.  The only weapon they had ever
invented worth mentioning was a crude and inefficient nuclear-reaction
bomb for which they had not even developed the logical defense. -
Asimov
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] archiving memory databases

2009-01-29 Thread DeTerra, David J
Hi all,

I was wondering if there is a feature in sqlite that would allow a set
of in-memory databases to periodically be written to disk for purposes
of database recovery on application or machine failure?

And then subsequently read those persisted database files back into a
memory database on restart?

Thanks,
David
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users