SQLite BackupAPI

General questions that have to do with plugins go here

SQLite BackupAPI

Postby GMKai » Sun Oct 26, 2014 1:13 pm

Hello,

I try to use the onlineBackupAPI to load and save my database.
But I fail with these functions:
Code: Select all
Function p_LoadGame()
    DebugPrint("p_LoadGame()")
    Local Dataset$ = FileRequest(c$[4],"hsgdb")
    If Dataset$ <> ""
       db:close_vm(false)
       db:close()
       db = sqlite3.open(Dataset$)
    EndIf()
EndFunction

Function p_SaveGame()
    DebugPrint("p_SaveGame()")
    Local Dataset$ = FileRequest(c$[10],"hsgdb")
    If Dataset$ <> ""
       Local backup  = sqlite3.open(Dataset$)
       Local pBackup = sqlite3.sqlite3_backup_init(backup, "main", db, "main");
       sqlite3:sqlite3_backup_step(pBackup, -1);
       sqlite3:sqlite3_backup_finish(pBackup);
    EndIf()
EndFunction         



First when saving the error is "tablefeld backup_init was not initialised...
any idea how to use the feature correctly?
GMKai
 
Posts: 57
Joined: Mon Feb 15, 2010 11:58 am

Re: SQLite BackupAPI

Postby airsoftsoftwair » Mon Oct 27, 2014 10:44 am

Sounds like something for our SQL expert, Lazi? ;-)
User avatar
airsoftsoftwair
 
Posts: 2233
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany

Re: SQLite BackupAPI

Postby lazi » Mon Oct 27, 2014 9:06 pm

Sounds like something for our SQL expert, Lazi?


Thanks for the title :lol:

@GMKai:
I try to use the onlineBackupAPI to load and save my database.

You wanted to use something from the SQLite C interface. That is not available to the Hollywood SQLite3 plugin.
The LuaSQLite is our domain: http://lua.sqlite.org/index.cgi/doc/tip/doc/lsqlite3.wiki

Let us see what you need, and I am sure there is a solution instead of the onlinebackupAPI.
User avatar
lazi
 
Posts: 268
Joined: Fri Feb 25, 2011 12:08 am


Return to General plugin questions

Who is online

Users browsing this forum: No registered users and 1 guest

cron