On Tue, Sep 01, 2009 at 08:30:56AM -0500, Jeff Godfrey scratched on the wall:
> Hi All,
> 
> I have a C# application that uses the System.Data.SQLite assembly for 
> SQLite access.  The ultimate goal is to access the SQLite data as an 
> in-memory DB.  Prior to access though, the database file itself has to 
> be retrieved from a "container storage mechanism", as it's not stored 
> independently on disk.  Currently, that's being done by streaming the DB 
> file from the container into a C# byte-array.
> 
>  From there, I can write the byte-array to the disk and then take the 
> necessary steps to open it as an in-memory database, though I'd like to 
> avoid the "write to disk" step if possible.  Ideally, I'd like access 
> the already-in-memory byte array as the in-memory SQLite db.  Is that at 
> all possible?  I assume no, but thought I'd ask.

  You could write a VFS module that accesses the byte-array directly.
  You'll need to deal with dynamic allocations to make the file larger,
  but otherwise things should be fairly straight forward, especially if
  you don't need advanced locking or syncing.

  See:

  http://sqlite.org/c3ref/vfs.html
  http://sqlite.org/c3ref/file.html
  http://sqlite.org/c3ref/io_methods.html
  http://sqlite.org/c3ref/vfs_find.html

   -j

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

"Our opponent is an alien starship packed with atomic bombs.  We have
 a protractor."   "I'll go home and see if I can scrounge up a ruler
 and a piece of string."  --from Anathem by Neal Stephenson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to