On Tue, Nov 13, 2012 at 06:08:17PM +0100, Gaspard Bucher scratched on the wall:
> Hi there !  
> 
> I am trying to figure out how to dump an in-memory database to some data 
> pointer and back (from a void*data chunk to in-memory). The simplest solution 
> I can figure out right now is:
> 
> A. save to void*data
> 1. backup to file
> 2. read file ==> void*data
> 3. remove file
> 
> B. load from void*data
> 1. write to file
> 2. open from file
> 3. backup to memory
> 4. remove file
> 
> Is there anything simpler that avoids the temp files ?  

  Not simpler, but cleaner... write a VFS plugin that reads/writes to a
  memory block.  Use the backup API to go straight in and out of that,
  rather then a file.

    -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Intelligence is like underwear: it is important that you have it,
 but showing it to the wrong people has the tendency to make them
 feel uncomfortable." -- Angela Johnson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to