On 9 Feb 2011, at 10:14am, Bastian Clarenbach wrote: > My environment does not have direct file access, instead I can only request > files and get a memblock returned that contains the entire file. I am trying > to figure out how to do one, preferably both, of the following scenarios. > > 1. I want to create a database 'offline' and then load and use that db as a > static resource (no inserts or other changes) > 2. I want to create a database in memory, store that into a memory block and > then be able to restore it like in 1
The biggest question with this is whether you expect your entire database file to be small enough that you would want to hold it in memory all that the same time. SQLite handles databases in memory just fine: address the filename as ':memory:'. See http://www.sqlite.org/inmemorydb.html You can delve into the depths of SQLite and mess with the file system routines. But a more appropriate way to do this might be to use the backup API: http://www.sqlite.org/backup.html It might be possible to use this to copy your database between the memblock and memory or a local file. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users