sqlite3.nim 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  1. #
  2. #
  3. # Nim's Runtime Library
  4. # (c) Copyright 2012 Andreas Rumpf
  5. #
  6. # See the file "copying.txt", included in this
  7. # distribution, for details about the copyright.
  8. #
  9. {.deadCodeElim: on.} # dce option deprecated
  10. when defined(nimHasStyleChecks):
  11. {.push styleChecks: off.}
  12. when defined(windows):
  13. when defined(nimOldDlls):
  14. const Lib = "sqlite3.dll"
  15. elif defined(cpu64):
  16. const Lib = "sqlite3_64.dll"
  17. else:
  18. const Lib = "sqlite3_32.dll"
  19. elif defined(macosx):
  20. const
  21. Lib = "libsqlite3(|.0).dylib"
  22. else:
  23. const
  24. Lib = "libsqlite3.so(|.0)"
  25. when defined(staticSqlite):
  26. {.pragma: mylib.}
  27. {.compile: "sqlite3.c".}
  28. else:
  29. {.pragma: mylib, dynlib: Lib.}
  30. const
  31. SQLITE_INTEGER* = 1
  32. SQLITE_FLOAT* = 2
  33. SQLITE_BLOB* = 4
  34. SQLITE_NULL* = 5
  35. SQLITE_TEXT* = 3
  36. SQLITE_UTF8* = 1
  37. SQLITE_UTF16LE* = 2
  38. SQLITE_UTF16BE* = 3 # Use native byte order
  39. SQLITE_UTF16* = 4 # sqlite3_create_function only
  40. SQLITE_ANY* = 5 #sqlite_exec return values
  41. SQLITE_OK* = 0
  42. SQLITE_ERROR* = 1 # SQL error or missing database
  43. SQLITE_INTERNAL* = 2 # An internal logic error in SQLite
  44. SQLITE_PERM* = 3 # Access permission denied
  45. SQLITE_ABORT* = 4 # Callback routine requested an abort
  46. SQLITE_BUSY* = 5 # The database file is locked
  47. SQLITE_LOCKED* = 6 # A table in the database is locked
  48. SQLITE_NOMEM* = 7 # A malloc() failed
  49. SQLITE_READONLY* = 8 # Attempt to write a readonly database
  50. SQLITE_INTERRUPT* = 9 # Operation terminated by sqlite3_interrupt()
  51. SQLITE_IOERR* = 10 # Some kind of disk I/O error occurred
  52. SQLITE_CORRUPT* = 11 # The database disk image is malformed
  53. SQLITE_NOTFOUND* = 12 # (Internal Only) Table or record not found
  54. SQLITE_FULL* = 13 # Insertion failed because database is full
  55. SQLITE_CANTOPEN* = 14 # Unable to open the database file
  56. SQLITE_PROTOCOL* = 15 # Database lock protocol error
  57. SQLITE_EMPTY* = 16 # Database is empty
  58. SQLITE_SCHEMA* = 17 # The database schema changed
  59. SQLITE_TOOBIG* = 18 # Too much data for one row of a table
  60. SQLITE_CONSTRAINT* = 19 # Abort due to constraint violation
  61. SQLITE_MISMATCH* = 20 # Data type mismatch
  62. SQLITE_MISUSE* = 21 # Library used incorrectly
  63. SQLITE_NOLFS* = 22 # Uses OS features not supported on host
  64. SQLITE_AUTH* = 23 # Authorization denied
  65. SQLITE_FORMAT* = 24 # Auxiliary database format error
  66. SQLITE_RANGE* = 25 # 2nd parameter to sqlite3_bind out of range
  67. SQLITE_NOTADB* = 26 # File opened that is not a database file
  68. SQLITE_ROW* = 100 # sqlite3_step() has another row ready
  69. SQLITE_DONE* = 101 # sqlite3_step() has finished executing
  70. SQLITE_COPY* = 0
  71. SQLITE_CREATE_INDEX* = 1
  72. SQLITE_CREATE_TABLE* = 2
  73. SQLITE_CREATE_TEMP_INDEX* = 3
  74. SQLITE_CREATE_TEMP_TABLE* = 4
  75. SQLITE_CREATE_TEMP_TRIGGER* = 5
  76. SQLITE_CREATE_TEMP_VIEW* = 6
  77. SQLITE_CREATE_TRIGGER* = 7
  78. SQLITE_CREATE_VIEW* = 8
  79. SQLITE_DELETE* = 9
  80. SQLITE_DROP_INDEX* = 10
  81. SQLITE_DROP_TABLE* = 11
  82. SQLITE_DROP_TEMP_INDEX* = 12
  83. SQLITE_DROP_TEMP_TABLE* = 13
  84. SQLITE_DROP_TEMP_TRIGGER* = 14
  85. SQLITE_DROP_TEMP_VIEW* = 15
  86. SQLITE_DROP_TRIGGER* = 16
  87. SQLITE_DROP_VIEW* = 17
  88. SQLITE_INSERT* = 18
  89. SQLITE_PRAGMA* = 19
  90. SQLITE_READ* = 20
  91. SQLITE_SELECT* = 21
  92. SQLITE_TRANSACTION* = 22
  93. SQLITE_UPDATE* = 23
  94. SQLITE_ATTACH* = 24
  95. SQLITE_DETACH* = 25
  96. SQLITE_ALTER_TABLE* = 26
  97. SQLITE_REINDEX* = 27
  98. SQLITE_DENY* = 1
  99. SQLITE_IGNORE* = 2 # Original from sqlite3.h:
  100. #define SQLITE_STATIC ((void(*)(void *))0)
  101. #define SQLITE_TRANSIENT ((void(*)(void *))-1)
  102. SQLITE_DETERMINISTIC* = 0x800
  103. type
  104. Sqlite3 {.pure, final.} = object
  105. PSqlite3* = ptr Sqlite3
  106. PPSqlite3* = ptr PSqlite3
  107. Context{.pure, final.} = object
  108. Pcontext* = ptr Context
  109. TStmt{.pure, final.} = object
  110. PStmt* = ptr TStmt
  111. Value{.pure, final.} = object
  112. PValue* = ptr Value
  113. PValueArg* = array[0..127, PValue]
  114. Callback* = proc (para1: pointer, para2: int32, para3,
  115. para4: cstringArray): int32{.cdecl.}
  116. Tbind_destructor_func* = proc (para1: pointer){.cdecl, locks: 0, tags: [], gcsafe.}
  117. Create_function_step_func* = proc (para1: Pcontext, para2: int32,
  118. para3: PValueArg){.cdecl.}
  119. Create_function_func_func* = proc (para1: Pcontext, para2: int32,
  120. para3: PValueArg){.cdecl.}
  121. Create_function_final_func* = proc (para1: Pcontext){.cdecl.}
  122. Result_func* = proc (para1: pointer){.cdecl.}
  123. Create_collation_func* = proc (para1: pointer, para2: int32, para3: pointer,
  124. para4: int32, para5: pointer): int32{.cdecl.}
  125. Collation_needed_func* = proc (para1: pointer, para2: PSqlite3, eTextRep: int32,
  126. para4: cstring){.cdecl.}
  127. const
  128. SQLITE_STATIC* = nil
  129. SQLITE_TRANSIENT* = cast[Tbind_destructor_func](-1)
  130. proc close*(para1: PSqlite3): int32{.cdecl, mylib, importc: "sqlite3_close".}
  131. proc exec*(para1: PSqlite3, sql: cstring, para3: Callback, para4: pointer,
  132. errmsg: var cstring): int32{.cdecl, mylib,
  133. importc: "sqlite3_exec".}
  134. proc last_insert_rowid*(para1: PSqlite3): int64{.cdecl, mylib,
  135. importc: "sqlite3_last_insert_rowid".}
  136. proc changes*(para1: PSqlite3): int32{.cdecl, mylib, importc: "sqlite3_changes".}
  137. proc total_changes*(para1: PSqlite3): int32{.cdecl, mylib,
  138. importc: "sqlite3_total_changes".}
  139. proc interrupt*(para1: PSqlite3){.cdecl, mylib, importc: "sqlite3_interrupt".}
  140. proc complete*(sql: cstring): int32{.cdecl, mylib,
  141. importc: "sqlite3_complete".}
  142. proc complete16*(sql: pointer): int32{.cdecl, mylib,
  143. importc: "sqlite3_complete16".}
  144. proc busy_handler*(para1: PSqlite3,
  145. para2: proc (para1: pointer, para2: int32): int32{.cdecl.},
  146. para3: pointer): int32{.cdecl, mylib,
  147. importc: "sqlite3_busy_handler".}
  148. proc busy_timeout*(para1: PSqlite3, ms: int32): int32{.cdecl, mylib,
  149. importc: "sqlite3_busy_timeout".}
  150. proc get_table*(para1: PSqlite3, sql: cstring, resultp: var cstringArray,
  151. nrow, ncolumn: var cint, errmsg: ptr cstring): int32{.cdecl,
  152. mylib, importc: "sqlite3_get_table".}
  153. proc free_table*(result: cstringArray){.cdecl, mylib,
  154. importc: "sqlite3_free_table".}
  155. # Todo: see how translate sqlite3_mprintf, sqlite3_vmprintf, sqlite3_snprintf
  156. # function sqlite3_mprintf(_para1:Pchar; args:array of const):Pchar;cdecl; external Sqlite3Lib name 'sqlite3_mprintf';
  157. proc mprintf*(para1: cstring): cstring{.cdecl, varargs, mylib,
  158. importc: "sqlite3_mprintf".}
  159. #function sqlite3_vmprintf(_para1:Pchar; _para2:va_list):Pchar;cdecl; external Sqlite3Lib name 'sqlite3_vmprintf';
  160. proc free*(z: cstring){.cdecl, mylib, importc: "sqlite3_free".}
  161. #function sqlite3_snprintf(_para1:longint; _para2:Pchar; _para3:Pchar; args:array of const):Pchar;cdecl; external Sqlite3Lib name 'sqlite3_snprintf';
  162. proc snprintf*(para1: int32, para2: cstring, para3: cstring): cstring{.cdecl,
  163. mylib, varargs, importc: "sqlite3_snprintf".}
  164. proc set_authorizer*(para1: PSqlite3, xAuth: proc (para1: pointer, para2: int32,
  165. para3: cstring, para4: cstring, para5: cstring, para6: cstring): int32{.
  166. cdecl.}, pUserData: pointer): int32{.cdecl, mylib,
  167. importc: "sqlite3_set_authorizer".}
  168. proc trace*(para1: PSqlite3, xTrace: proc (para1: pointer, para2: cstring){.cdecl.},
  169. para3: pointer): pointer{.cdecl, mylib,
  170. importc: "sqlite3_trace".}
  171. proc progress_handler*(para1: PSqlite3, para2: int32,
  172. para3: proc (para1: pointer): int32{.cdecl.},
  173. para4: pointer){.cdecl, mylib,
  174. importc: "sqlite3_progress_handler".}
  175. proc commit_hook*(para1: PSqlite3, para2: proc (para1: pointer): int32{.cdecl.},
  176. para3: pointer): pointer{.cdecl, mylib,
  177. importc: "sqlite3_commit_hook".}
  178. proc open*(filename: cstring, ppDb: var PSqlite3): int32{.cdecl, mylib,
  179. importc: "sqlite3_open".}
  180. proc open16*(filename: pointer, ppDb: var PSqlite3): int32{.cdecl, mylib,
  181. importc: "sqlite3_open16".}
  182. proc errcode*(db: PSqlite3): int32{.cdecl, mylib, importc: "sqlite3_errcode".}
  183. proc errmsg*(para1: PSqlite3): cstring{.cdecl, mylib, importc: "sqlite3_errmsg".}
  184. proc errmsg16*(para1: PSqlite3): pointer{.cdecl, mylib,
  185. importc: "sqlite3_errmsg16".}
  186. proc prepare*(db: PSqlite3, zSql: cstring, nBytes: int32, ppStmt: var PStmt,
  187. pzTail: ptr cstring): int32{.cdecl, mylib,
  188. importc: "sqlite3_prepare".}
  189. proc prepare_v2*(db: PSqlite3, zSql: cstring, nByte: cint, ppStmt: var PStmt,
  190. pzTail: ptr cstring): cint {.
  191. importc: "sqlite3_prepare_v2", cdecl, mylib.}
  192. proc prepare16*(db: PSqlite3, zSql: pointer, nBytes: int32, ppStmt: var PStmt,
  193. pzTail: var pointer): int32{.cdecl, mylib,
  194. importc: "sqlite3_prepare16".}
  195. proc bind_blob*(para1: PStmt, para2: int32, para3: pointer, n: int32,
  196. para5: Tbind_destructor_func): int32{.cdecl, mylib,
  197. importc: "sqlite3_bind_blob".}
  198. proc bind_double*(para1: PStmt, para2: int32, para3: float64): int32{.cdecl,
  199. mylib, importc: "sqlite3_bind_double".}
  200. proc bind_int*(para1: PStmt, para2: int32, para3: int32): int32{.cdecl,
  201. mylib, importc: "sqlite3_bind_int".}
  202. proc bind_int64*(para1: PStmt, para2: int32, para3: int64): int32{.cdecl,
  203. mylib, importc: "sqlite3_bind_int64".}
  204. proc bind_null*(para1: PStmt, para2: int32): int32{.cdecl, mylib,
  205. importc: "sqlite3_bind_null".}
  206. proc bind_text*(para1: PStmt, para2: int32, para3: cstring, n: int32,
  207. para5: Tbind_destructor_func): int32{.cdecl, mylib,
  208. importc: "sqlite3_bind_text".}
  209. proc bind_text16*(para1: PStmt, para2: int32, para3: pointer, para4: int32,
  210. para5: Tbind_destructor_func): int32{.cdecl, mylib,
  211. importc: "sqlite3_bind_text16".}
  212. #function sqlite3_bind_value(_para1:Psqlite3_stmt; _para2:longint; _para3:Psqlite3_value):longint;cdecl; external Sqlite3Lib name 'sqlite3_bind_value';
  213. #These overloaded functions were introduced to allow the use of SQLITE_STATIC and SQLITE_TRANSIENT
  214. #It's the c world man ;-)
  215. proc bind_blob*(para1: PStmt, para2: int32, para3: pointer, n: int32,
  216. para5: int32): int32{.cdecl, mylib,
  217. importc: "sqlite3_bind_blob".}
  218. proc bind_text*(para1: PStmt, para2: int32, para3: cstring, n: int32,
  219. para5: int32): int32{.cdecl, mylib,
  220. importc: "sqlite3_bind_text".}
  221. proc bind_text16*(para1: PStmt, para2: int32, para3: pointer, para4: int32,
  222. para5: int32): int32{.cdecl, mylib,
  223. importc: "sqlite3_bind_text16".}
  224. proc bind_parameter_count*(para1: PStmt): int32{.cdecl, mylib,
  225. importc: "sqlite3_bind_parameter_count".}
  226. proc bind_parameter_name*(para1: PStmt, para2: int32): cstring{.cdecl,
  227. mylib, importc: "sqlite3_bind_parameter_name".}
  228. proc bind_parameter_index*(para1: PStmt, zName: cstring): int32{.cdecl,
  229. mylib, importc: "sqlite3_bind_parameter_index".}
  230. proc clear_bindings*(para1: PStmt): int32 {.cdecl,
  231. mylib, importc: "sqlite3_clear_bindings".}
  232. proc column_count*(PStmt: PStmt): int32{.cdecl, mylib,
  233. importc: "sqlite3_column_count".}
  234. proc column_name*(para1: PStmt, para2: int32): cstring{.cdecl, mylib,
  235. importc: "sqlite3_column_name".}
  236. proc column_table_name*(para1: PStmt; para2: int32): cstring{.cdecl, mylib,
  237. importc: "sqlite3_column_table_name".}
  238. proc column_name16*(para1: PStmt, para2: int32): pointer{.cdecl, mylib,
  239. importc: "sqlite3_column_name16".}
  240. proc column_decltype*(para1: PStmt, i: int32): cstring{.cdecl, mylib,
  241. importc: "sqlite3_column_decltype".}
  242. proc column_decltype16*(para1: PStmt, para2: int32): pointer{.cdecl,
  243. mylib, importc: "sqlite3_column_decltype16".}
  244. proc step*(para1: PStmt): int32{.cdecl, mylib, importc: "sqlite3_step".}
  245. proc data_count*(PStmt: PStmt): int32{.cdecl, mylib,
  246. importc: "sqlite3_data_count".}
  247. proc column_blob*(para1: PStmt, iCol: int32): pointer{.cdecl, mylib,
  248. importc: "sqlite3_column_blob".}
  249. proc column_bytes*(para1: PStmt, iCol: int32): int32{.cdecl, mylib,
  250. importc: "sqlite3_column_bytes".}
  251. proc column_bytes16*(para1: PStmt, iCol: int32): int32{.cdecl, mylib,
  252. importc: "sqlite3_column_bytes16".}
  253. proc column_double*(para1: PStmt, iCol: int32): float64{.cdecl, mylib,
  254. importc: "sqlite3_column_double".}
  255. proc column_int*(para1: PStmt, iCol: int32): int32{.cdecl, mylib,
  256. importc: "sqlite3_column_int".}
  257. proc column_int64*(para1: PStmt, iCol: int32): int64{.cdecl, mylib,
  258. importc: "sqlite3_column_int64".}
  259. proc column_text*(para1: PStmt, iCol: int32): cstring{.cdecl, mylib,
  260. importc: "sqlite3_column_text".}
  261. proc column_text16*(para1: PStmt, iCol: int32): pointer{.cdecl, mylib,
  262. importc: "sqlite3_column_text16".}
  263. proc column_type*(para1: PStmt, iCol: int32): int32{.cdecl, mylib,
  264. importc: "sqlite3_column_type".}
  265. proc finalize*(PStmt: PStmt): int32{.cdecl, mylib,
  266. importc: "sqlite3_finalize".}
  267. proc reset*(PStmt: PStmt): int32{.cdecl, mylib, importc: "sqlite3_reset".}
  268. proc create_function*(para1: PSqlite3, zFunctionName: cstring, nArg: int32,
  269. eTextRep: int32, para5: pointer,
  270. xFunc: Create_function_func_func,
  271. xStep: Create_function_step_func,
  272. xFinal: Create_function_final_func): int32{.cdecl,
  273. mylib, importc: "sqlite3_create_function".}
  274. proc create_function16*(para1: PSqlite3, zFunctionName: pointer, nArg: int32,
  275. eTextRep: int32, para5: pointer,
  276. xFunc: Create_function_func_func,
  277. xStep: Create_function_step_func,
  278. xFinal: Create_function_final_func): int32{.cdecl,
  279. mylib, importc: "sqlite3_create_function16".}
  280. proc aggregate_count*(para1: Pcontext): int32{.cdecl, mylib,
  281. importc: "sqlite3_aggregate_count".}
  282. proc value_blob*(para1: PValue): pointer{.cdecl, mylib,
  283. importc: "sqlite3_value_blob".}
  284. proc value_bytes*(para1: PValue): int32{.cdecl, mylib,
  285. importc: "sqlite3_value_bytes".}
  286. proc value_bytes16*(para1: PValue): int32{.cdecl, mylib,
  287. importc: "sqlite3_value_bytes16".}
  288. proc value_double*(para1: PValue): float64{.cdecl, mylib,
  289. importc: "sqlite3_value_double".}
  290. proc value_int*(para1: PValue): int32{.cdecl, mylib,
  291. importc: "sqlite3_value_int".}
  292. proc value_int64*(para1: PValue): int64{.cdecl, mylib,
  293. importc: "sqlite3_value_int64".}
  294. proc value_text*(para1: PValue): cstring{.cdecl, mylib,
  295. importc: "sqlite3_value_text".}
  296. proc value_text16*(para1: PValue): pointer{.cdecl, mylib,
  297. importc: "sqlite3_value_text16".}
  298. proc value_text16le*(para1: PValue): pointer{.cdecl, mylib,
  299. importc: "sqlite3_value_text16le".}
  300. proc value_text16be*(para1: PValue): pointer{.cdecl, mylib,
  301. importc: "sqlite3_value_text16be".}
  302. proc value_type*(para1: PValue): int32{.cdecl, mylib,
  303. importc: "sqlite3_value_type".}
  304. proc aggregate_context*(para1: Pcontext, nBytes: int32): pointer{.cdecl,
  305. mylib, importc: "sqlite3_aggregate_context".}
  306. proc user_data*(para1: Pcontext): pointer{.cdecl, mylib,
  307. importc: "sqlite3_user_data".}
  308. proc get_auxdata*(para1: Pcontext, para2: int32): pointer{.cdecl, mylib,
  309. importc: "sqlite3_get_auxdata".}
  310. proc set_auxdata*(para1: Pcontext, para2: int32, para3: pointer,
  311. para4: proc (para1: pointer){.cdecl.}){.cdecl, mylib,
  312. importc: "sqlite3_set_auxdata".}
  313. proc result_blob*(para1: Pcontext, para2: pointer, para3: int32,
  314. para4: Result_func){.cdecl, mylib,
  315. importc: "sqlite3_result_blob".}
  316. proc result_double*(para1: Pcontext, para2: float64){.cdecl, mylib,
  317. importc: "sqlite3_result_double".}
  318. proc result_error*(para1: Pcontext, para2: cstring, para3: int32){.cdecl,
  319. mylib, importc: "sqlite3_result_error".}
  320. proc result_error16*(para1: Pcontext, para2: pointer, para3: int32){.cdecl,
  321. mylib, importc: "sqlite3_result_error16".}
  322. proc result_int*(para1: Pcontext, para2: int32){.cdecl, mylib,
  323. importc: "sqlite3_result_int".}
  324. proc result_int64*(para1: Pcontext, para2: int64){.cdecl, mylib,
  325. importc: "sqlite3_result_int64".}
  326. proc result_null*(para1: Pcontext){.cdecl, mylib,
  327. importc: "sqlite3_result_null".}
  328. proc result_text*(para1: Pcontext, para2: cstring, para3: int32,
  329. para4: Result_func){.cdecl, mylib,
  330. importc: "sqlite3_result_text".}
  331. proc result_text16*(para1: Pcontext, para2: pointer, para3: int32,
  332. para4: Result_func){.cdecl, mylib,
  333. importc: "sqlite3_result_text16".}
  334. proc result_text16le*(para1: Pcontext, para2: pointer, para3: int32,
  335. para4: Result_func){.cdecl, mylib,
  336. importc: "sqlite3_result_text16le".}
  337. proc result_text16be*(para1: Pcontext, para2: pointer, para3: int32,
  338. para4: Result_func){.cdecl, mylib,
  339. importc: "sqlite3_result_text16be".}
  340. proc result_value*(para1: Pcontext, para2: PValue){.cdecl, mylib,
  341. importc: "sqlite3_result_value".}
  342. proc create_collation*(para1: PSqlite3, zName: cstring, eTextRep: int32,
  343. para4: pointer, xCompare: Create_collation_func): int32{.
  344. cdecl, mylib, importc: "sqlite3_create_collation".}
  345. proc create_collation16*(para1: PSqlite3, zName: cstring, eTextRep: int32,
  346. para4: pointer, xCompare: Create_collation_func): int32{.
  347. cdecl, mylib, importc: "sqlite3_create_collation16".}
  348. proc collation_needed*(para1: PSqlite3, para2: pointer, para3: Collation_needed_func): int32{.
  349. cdecl, mylib, importc: "sqlite3_collation_needed".}
  350. proc collation_needed16*(para1: PSqlite3, para2: pointer, para3: Collation_needed_func): int32{.
  351. cdecl, mylib, importc: "sqlite3_collation_needed16".}
  352. proc libversion*(): cstring{.cdecl, mylib, importc: "sqlite3_libversion".}
  353. #Alias for allowing better code portability (win32 is not working with external variables)
  354. proc version*(): cstring{.cdecl, mylib, importc: "sqlite3_libversion".}
  355. # Not published functions
  356. proc libversion_number*(): int32{.cdecl, mylib,
  357. importc: "sqlite3_libversion_number".}
  358. #function sqlite3_key(db:Psqlite3; pKey:pointer; nKey:longint):longint;cdecl; external Sqlite3Lib name 'sqlite3_key';
  359. #function sqlite3_rekey(db:Psqlite3; pKey:pointer; nKey:longint):longint;cdecl; external Sqlite3Lib name 'sqlite3_rekey';
  360. #function sqlite3_sleep(_para1:longint):longint;cdecl; external Sqlite3Lib name 'sqlite3_sleep';
  361. #function sqlite3_expired(_para1:Psqlite3_stmt):longint;cdecl; external Sqlite3Lib name 'sqlite3_expired';
  362. #function sqlite3_global_recover:longint;cdecl; external Sqlite3Lib name 'sqlite3_global_recover';
  363. # implementation
  364. when defined(nimHasStyleChecks):
  365. {.pop.}