Re: [Vala] Equivalent for sqlitebck (sqlite backup)

2016-07-20 Thread mar...@saepia.net
Can't you just create a file with the DB in the SHM filesystem and then
copy it to the regular filesystem?

Marcin

2016-07-19 20:45 GMT+02:00 Adam Tauno Williams :

> I am attempting to resurrect an abandoned application, rewriting it in
> Vala.  So far vala is really nice.
>
> But I'm stuck on an equivalent for the Python module sqlitebck.
>
> sqlitebck wraps the SQLite backup/restore procedures.
>
> The applications 'opens' and SQLite database - restoring it to a
> memory:// database - and 'saves' that in memory database back to an
> SQLite on-disk database using sqlitebck.copy(source, target).
>
> How would one do an equivalent thing in Vala?
>
> --
> Adam Tauno Williams  GPG D95ED383
> OpenGroupware Developer 
>
>
> ___
> vala-list mailing list
> vala-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/vala-list
>
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Equivalent for sqlitebck (sqlite backup)

2016-07-19 Thread Al Thomas

 
  From: Adam Tauno Williams 
 Sent: Tuesday, 19 July 2016, 19:45
 Subject: [Vala] Equivalent for sqlitebck (sqlite backup)
   
But I'm stuck on an equivalent for the Python module sqlitebck.

sqlitebck wraps the SQLite backup/restore procedures.

The applications 'opens' and SQLite database - restoring it to a
memory:// database - and 'saves' that in memory database back to an
SQLite on-disk database using sqlitebck.copy(source, target).

How would one do an equivalent thing in Vala?


You need to start by looking at the C 
API:https://www.sqlite.org/c3ref/backup_finish.html
This API is bound in Vala as an 
object:https://git.gnome.org/browse/vala/tree/vapi/sqlite3.vapi#n448
So you create a new Backup( ... ), do what the API advises and that's it. You 
don't need to free the object, the binding will call the correct free function 
for you.
Al


   
 
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list