Iulian Popescu wrote:

I'm really sorry - I forgot to mention that both databases are in memory.


Iulian,

In that case you will have to copy the contents.

The easiest way to do that is probably to modify the code the sqlite shell uses to do a database dump. Instead of writing the generated SQL out to a file like the dump command does, execute the generated SQL statements to create the same tables and records in the second attached database.

The shell command is implemented in a few functions in shell.c.

I believe there is some similar code in the vacuum functions that copy the entire database to a new file without converting everything into SQL text. This might be faster. You can look at the code in vacuum.c

HTH
Dennis Cote

Reply via email to