SQLite backup API

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
infratec
Always Here
Always Here
Posts: 7588
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

SQLite backup API

Post 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
User avatar
blueb
Addict
Addict
Posts: 1111
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: SQLite backup API

Post 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/
- It was too lonely at the top.

System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
ebs
Enthusiast
Enthusiast
Posts: 557
Joined: Fri Apr 25, 2003 11:08 pm

Re: SQLite backup API

Post 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
infratec
Always Here
Always Here
Posts: 7588
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: SQLite backup API

Post by infratec »

My fault.

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

Sorry.
Post Reply