i want to have some sqlite database running in memory. I use the sqlite3 c files from almalgamation in my c++ project. Versions tested are: 3.10.2 and 3.11.01.
I can load a file based database into a memory database, i can do a backup of file based database but what fails is backing up a memory database to a file.
I checked both samples, exposed here: http://ift.tt/1FB4i7q
I mean, i used these examples. The result is always SQLITE_OK on all sqlite function calls, execept 101 for
sqlite3_backup_step
in the 2nd example. To make sure there is no mistake, i checked the memory database having tables and data. This is the case. Also, using the same backup function, works for filedatabase very well.
So far i could investigate, this line
nSrcPage = (int)sqlite3BtreeLastPage(p->pSrc);
in function
sqlite3_backup_step (sqlite3.c)
always returns 0. So the database has no "pages".
The file based database returns 35 at this point.
So it seems there is no kind of copy because no "pages" given for my memory database; but this mem database definitely has tables and data.
How to get this working? Thank you
Aucun commentaire:
Enregistrer un commentaire