Skip to content

Commit

Permalink
adding sqlite3 backup functions (nim-lang#13346)
Browse files Browse the repository at this point in the history
* adding sqlite3 backup functions

* changing sleep to sqlite3_sleep to prevent clashes
  • Loading branch information
pyloor authored Feb 7, 2020
1 parent c877961 commit bf3f1c3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/wrappers/sqlite3.nim
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ type
Sqlite3 {.pure, final.} = object
PSqlite3* = ptr Sqlite3
PPSqlite3* = ptr PSqlite3
Sqlite3_Backup {.pure, final.} = object
PSqlite3_Backup* = ptr Sqlite3_Backup
PPSqlite3_Backup* = ptr PSqlite3_Backup
Context{.pure, final.} = object
Pcontext* = ptr Context
TStmt{.pure, final.} = object
Expand Down Expand Up @@ -366,6 +369,20 @@ proc version*(): cstring{.cdecl, mylib, importc: "sqlite3_libversion".}
# Not published functions
proc libversion_number*(): int32{.cdecl, mylib,
importc: "sqlite3_libversion_number".}

proc backup_init*(pDest: PSqlite3, zDestName: cstring, pSource: PSqlite3, zSourceName: cstring): PSqlite3_Backup {.
cdecl, mylib, importc: "sqlite3_backup_init".}

proc backup_step*(pBackup: PSqlite3_Backup, nPage: int32): int32 {.cdecl, mylib, importc: "sqlite3_backup_step".}

proc backup_finish*(pBackup: PSqlite3_Backup): int32 {.cdecl, mylib, importc: "sqlite3_backup_finish".}

proc backup_pagecount*(pBackup: PSqlite3_Backup): int32 {.cdecl, mylib, importc: "sqlite3_backup_pagecount".}

proc backup_remaining*(pBackup: PSqlite3_Backup): int32 {.cdecl, mylib, importc: "sqlite3_backup_remaining".}

proc sqlite3_sleep*(t: int64): int64 {.cdecl, mylib, importc: "sqlite3_sleep".}

#function sqlite3_key(db:Psqlite3; pKey:pointer; nKey:longint):longint;cdecl; external Sqlite3Lib name 'sqlite3_key';
#function sqlite3_rekey(db:Psqlite3; pKey:pointer; nKey:longint):longint;cdecl; external Sqlite3Lib name 'sqlite3_rekey';
#function sqlite3_sleep(_para1:longint):longint;cdecl; external Sqlite3Lib name 'sqlite3_sleep';
Expand Down

0 comments on commit bf3f1c3

Please sign in to comment.