Page 1 of 1

SQLite backup API

Posted: Wed Dec 21, 2016 11:24 am
by infratec
Hi,

since it is possible to cretae a SQLite database in memory it would be nice if we can store it to disk.
For this the backup API is needed.
At the moment it is not included in the library.

Look at 'Example 1'
http://www.sqlite.org/backup.html

http://www.sqlite.org/c3ref/backup_fini ... backupinit

At the moment I create a database which takes nearly 3 Minutes and I hear a lot of hdd noise.
In memory it takes 15 seconds, but I can not 'dump' it to hdd :(

Bernd

Re: SQLite backup API

Posted: Wed Dec 21, 2016 2:29 pm
by blueb
Good idea.

Temporary help:
- JHPJHP's excellent toolkit... http://www.purebasic.fr/english/viewtop ... 12&t=61403

or directly: https://sourceforge.net/projects/imdisk-toolkit/

Re: SQLite backup API

Posted: Wed Dec 21, 2016 4:11 pm
by ebs
Here's a post with code from Kiffi and srod that allows you to backup a database to another database, memory or disk-based.
I've used a slight variation of srod's code and it works great.

http://www.forums.purebasic.com/english ... p?p=368143

Re: SQLite backup API

Posted: Wed Dec 21, 2016 5:19 pm
by infratec
My fault.

I looked in the wrong file (imp) instead of .lib

Sorry.