annotate semiconginev2/thirdparty/db_connector/sqlite3.nim @ 1263:e0f0a0be7880

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