Am 10.07.2006 um 10:52 schrieb Ernesto Olmos:

I have an SQLite database which I work in memory (:MEMORY) and I have to get
the binary text (string) of it.
Is there a way to do it without writing it to disk and reading the file?

Command ATTACH works good to get and write from disk or to work directly in
memory but I cannot get the database itself (buffer) from memory.
I would also need some way to get the database from the binary string of it.

This is because I trasmit the database via HTTP (I encrypt the string
before). Now I'm using XML, but as it is becoming complex I´d like to put
SQLite.
Of course its a small string (10Kb).

I don't even know whether there's a binary in-memory image for the :memory: database, but you could always dump the entire database (as you'd do with the '.dump' command in the shell), send that over and import it on the other end. The code to dump the database is avaiable in shell.c as well as the code to import a database, so you can easily integrate this into your own executable...

For a small database, going through the dump-import process shouldn't be too much of a performance hit (plus it makes you independent of the sqlite version/implementation used on the other end).

</jum>

Reply via email to