Hello Eric, I am aware of the functionality which you mentioned. But the reason why I ended up coding the feature was because of a very specific requirement. My requirement was such that some of my client applications were running on disk-less systems where I was not using any kind of network storage. But my applications used SQLite. So I coded the below mentioned feature such that the database was being stored on the server and when the disk-less clients wanted to use them, they fetched the database from the server over the network and directly create a database out of the fetched data (basically serializing and de-serializing the database).
I am guessing that SQLite does not support such functionality. The closest thing would have been to fetch the database over the network, store it in a file (which in this case is not possible) and then open the database. I maybe wrong, but if such a feature already exists then I would be more than happy to adopt it in my code. Thank you and regards, Subhadeep Ghosh. On Thu, Jul 8, 2010 at 6:40 PM, Eric Smith <eas....@gmail.com> wrote: > Subhadeep Ghosh wrote: > > > I finally managed to create a wrapper around the SQLite core to support > > the creation of in-memory databases. The wrapper comprises of three > > functions - one to serialize the database, one to de-serialize a database > > and the third one to do the cleanup job. > > > > The function which serializes a database, copies the entire contents of > > the database to a block of memory. The function which de-serializes > takes > > a block of memory as input and creates a database object out of it. > > > > I am including the source code for the interested souls and I've not put > > comments as I hate doing it. > > > > I hope you guys find the code useful or at-least interesting. > > I hope you didn't spend too much time on that. SQLite supports > in-memory databases natively: if you open the file called ":memory:" you > get an in-memory database that dies when the connection is closed: > > http://sqlite.org/c3ref/open.html > > -- > Eric A. Smith > > More people would come here if it weren't so crowded. > -- Yogi Berra > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users