[odb-users] in memory sqlite db

Boris Kolpackov boris at codesynthesis.com
Wed Nov 27 06:38:49 EST 2013


Hi Lidia,

Lidia Kalinovsky <lidia at lemur-soft.com> writes:

> I would like to create in memory sqlite db and be able to grab the memory
> to stream.

As Hugo suggested, the best way is to use the SQLite backup API. To
use this API you will need to get the raw SQLite handle for the
database. Here is how you can do it:

odb::sqlite::database db (...);

odb::sqlite::connection_ptr c (db.connection ());

sqlite3* h (c->handle ()); // Valid until connection goes out of scope.

Boris



More information about the odb-users mailing list