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




 
      From: Adam Tauno Williams <awilliam whitemice org>
 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


   
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]