fce-sqlite-connector 0.1.1

The package provides an interface to SQLite.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
;; Types
(@interface type (func 
  (param $size: i32) 
  (result i32)))   ;; 0
(@interface type (func 
  (param $pointer: i32 $size: i32) ))   ;; 1
(@interface type (func  
  (result i32)))   ;; 2
(@interface type (func  
  (result i32)))   ;; 3
(@interface type (func 
  (param $result_size: i32) ))   ;; 4
(@interface type (func 
  (param $result_ptr: i32) ))   ;; 5
(@interface type (record DBExecDescriptor {
 ret_code: s32
 err_msg: string
}))   ;; 6
(@interface type (record DBPrepareDescriptor {
 ret_code: s32
 stmt_handle: u32
 tail: u32
}))   ;; 7
(@interface type (record DBOpenDescriptor {
 ret_code: s32
 db_handle: u32
}))   ;; 8
(@interface type (func 
  (param $stmt_handle: u32 $icol: u32) 
  (result string)))   ;; 9
(@interface type (func 
  (param $stmt_handle: u32 $icol: u32) 
  (result string)))   ;; 10
(@interface type (func 
  (param $stmt_handle: u32 $icol: u32) 
  (result s32)))   ;; 11
(@interface type (func 
  (param $stmt_handle: u32 $icol: u32) 
  (result s32)))   ;; 12
(@interface type (func 
  (param $db_handle: u32) 
  (result s32)))   ;; 13
(@interface type (func 
  (param $db_handle: u32) 
  (result s32)))   ;; 14
(@interface type (func 
  (param $stmt_handle: u32 $pos: s32 $value: f64) 
  (result s32)))   ;; 15
(@interface type (func 
  (param $stmt_handle: u32 $pos: s32 $value: f64) 
  (result s32)))   ;; 16
(@interface type (func 
  (param $filename: string $flags: s32 $vfs: string) 
  (result 8)))   ;; 17
(@interface type (func 
  (param $filename: string $flags: s32 $vfs: string) 
  (result 8)))   ;; 18
(@interface type (func 
  (param $db_handle: u32) 
  (result s32)))   ;; 19
(@interface type (func 
  (param $db_handle: u32) 
  (result s32)))   ;; 20
(@interface type (func 
  (param $stmt_handle: u32) 
  (result s32)))   ;; 21
(@interface type (func 
  (param $stmt_handle: u32) 
  (result s32)))   ;; 22
(@interface type (func 
  (param $stmt_handle: u32 $icol: u32) 
  (result s64)))   ;; 23
(@interface type (func 
  (param $stmt_handle: u32 $icol: u32) 
  (result s64)))   ;; 24
(@interface type (func 
  (param $db: u32) 
  (result s32)))   ;; 25
(@interface type (func 
  (param $db: u32) 
  (result s32)))   ;; 26
(@interface type (func 
  (param $stmt_handle: u32 $icol: s32) 
  (result f64)))   ;; 27
(@interface type (func 
  (param $stmt_handle: u32 $icol: s32) 
  (result f64)))   ;; 28
(@interface type (func 
  (param $db_handle: u32 $ms: u32) 
  (result s32)))   ;; 29
(@interface type (func 
  (param $db_handle: u32 $ms: u32) 
  (result s32)))   ;; 30
(@interface type (func 
  (param $db_handle: u32) 
  (result string)))   ;; 31
(@interface type (func 
  (param $db_handle: u32) 
  (result string)))   ;; 32
(@interface type (func 
  (param $stmt_handle: u32 $pos: s32 $value: s64) 
  (result s32)))   ;; 33
(@interface type (func 
  (param $stmt_handle: u32 $pos: s32 $value: s64) 
  (result s32)))   ;; 34
(@interface type (func 
  (param $stmt_handle: u32) 
  (result s32)))   ;; 35
(@interface type (func 
  (param $stmt_handle: u32) 
  (result s32)))   ;; 36
(@interface type (func 
  (param $db_handle: u32 $sql: string) 
  (result 7)))   ;; 37
(@interface type (func 
  (param $db_handle: u32 $sql: string) 
  (result 7)))   ;; 38
(@interface type (func 
  (param $stmt_handle: u32 $pos: s32) 
  (result s32)))   ;; 39
(@interface type (func 
  (param $stmt_handle: u32 $pos: s32) 
  (result s32)))   ;; 40
(@interface type (func 
  (param $stmt_handle: u32) 
  (result s32)))   ;; 41
(@interface type (func 
  (param $stmt_handle: u32) 
  (result s32)))   ;; 42
(@interface type (func 
  (param $stmt_handle: u32 $pos: s32 $blob: byte_array $xDel: s32) 
  (result s32)))   ;; 43
(@interface type (func 
  (param $stmt_handle: u32 $pos: s32 $blob: byte_array $xDel: s32) 
  (result s32)))   ;; 44
(@interface type (func 
  (param $db_handle: u32) 
  (result s32)))   ;; 45
(@interface type (func 
  (param $db_handle: u32) 
  (result s32)))   ;; 46
(@interface type (func 
  (param $stmt_handle: u32 $pos: s32 $text: string $xDel: s32) 
  (result s32)))   ;; 47
(@interface type (func 
  (param $stmt_handle: u32 $pos: s32 $text: string $xDel: s32) 
  (result s32)))   ;; 48
(@interface type (func 
  (param $stmt_handle: u32) 
  (result s32)))   ;; 49
(@interface type (func 
  (param $stmt_handle: u32) 
  (result s32)))   ;; 50
(@interface type (func 
  (param $db_handle: u32 $sql: string $callback_id: s32 $callback_arg: s32) 
  (result 6)))   ;; 51
(@interface type (func 
  (param $db_handle: u32 $sql: string $callback_id: s32 $callback_arg: s32) 
  (result 6)))   ;; 52
(@interface type (func  
  (result s32)))   ;; 53
(@interface type (func  
  (result s32)))   ;; 54
(@interface type (func 
  (param $stmt_handle: u32 $icol: s32) 
  (result byte_array)))   ;; 55
(@interface type (func 
  (param $stmt_handle: u32 $icol: s32) 
  (result byte_array)))   ;; 56
(@interface type (func 
  (param $stmt_handle: u32 $N: u32) 
  (result string)))   ;; 57
(@interface type (func 
  (param $stmt_handle: u32 $N: u32) 
  (result string)))   ;; 58
(@interface type (func 
  (param $stmt_handle: u32 $icol: u32) 
  (result s32)))   ;; 59
(@interface type (func 
  (param $stmt_handle: u32 $icol: u32) 
  (result s32)))   ;; 60



;; Adapters
(@interface func (type 9)
  arg.get 0
  i32.from_u32
  arg.get 1
  i32.from_u32
  call-core 6
  call-core 3
  call-core 2
  string.lift_memory
  call-core 3
  call-core 2
  call-core 1)
(@interface func (type 11)
  arg.get 0
  i32.from_u32
  arg.get 1
  i32.from_u32
  call-core 7
  s32.from_i32)
(@interface func (type 13)
  arg.get 0
  i32.from_u32
  call-core 8
  s32.from_i32)
(@interface func (type 15)
  arg.get 0
  i32.from_u32
  arg.get 1
  i32.from_s32
  arg.get 2
  call-core 9
  s32.from_i32)
(@interface func (type 17)
  arg.get 0
  string.size
  call-core 0
  arg.get 0
  string.lower_memory
  arg.get 1
  i32.from_s32
  arg.get 2
  string.size
  call-core 0
  arg.get 2
  string.lower_memory
  call-core 10
  call-core 3
  record.lift_memory 8)
(@interface func (type 19)
  arg.get 0
  i32.from_u32
  call-core 11
  s32.from_i32)
(@interface func (type 21)
  arg.get 0
  i32.from_u32
  call-core 12
  s32.from_i32)
(@interface func (type 23)
  arg.get 0
  i32.from_u32
  arg.get 1
  i32.from_u32
  call-core 13
  s64.from_i64)
(@interface func (type 25)
  arg.get 0
  i32.from_u32
  call-core 14
  s32.from_i32)
(@interface func (type 27)
  arg.get 0
  i32.from_u32
  arg.get 1
  i32.from_s32
  call-core 15)
(@interface func (type 29)
  arg.get 0
  i32.from_u32
  arg.get 1
  i32.from_u32
  call-core 16
  s32.from_i32)
(@interface func (type 31)
  arg.get 0
  i32.from_u32
  call-core 17
  call-core 3
  call-core 2
  string.lift_memory
  call-core 3
  call-core 2
  call-core 1)
(@interface func (type 33)
  arg.get 0
  i32.from_u32
  arg.get 1
  i32.from_s32
  arg.get 2
  i64.from_s64
  call-core 18
  s32.from_i32)
(@interface func (type 35)
  arg.get 0
  i32.from_u32
  call-core 19
  s32.from_i32)
(@interface func (type 37)
  arg.get 0
  i32.from_u32
  arg.get 1
  string.size
  call-core 0
  arg.get 1
  string.lower_memory
  call-core 20
  call-core 3
  record.lift_memory 7)
(@interface func (type 39)
  arg.get 0
  i32.from_u32
  arg.get 1
  i32.from_s32
  call-core 21
  s32.from_i32)
(@interface func (type 41)
  arg.get 0
  i32.from_u32
  call-core 22
  s32.from_i32)
(@interface func (type 43)
  arg.get 0
  i32.from_u32
  arg.get 1
  i32.from_s32
  arg.get 2
  byte_array.size
  call-core 0
  arg.get 2
  byte_array.lower_memory
  arg.get 3
  i32.from_s32
  call-core 23
  s32.from_i32)
(@interface func (type 45)
  arg.get 0
  i32.from_u32
  call-core 24
  s32.from_i32)
(@interface func (type 47)
  arg.get 0
  i32.from_u32
  arg.get 1
  i32.from_s32
  arg.get 2
  string.size
  call-core 0
  arg.get 2
  string.lower_memory
  arg.get 3
  i32.from_s32
  call-core 25
  s32.from_i32)
(@interface func (type 49)
  arg.get 0
  i32.from_u32
  call-core 26
  s32.from_i32)
(@interface func (type 51)
  arg.get 0
  i32.from_u32
  arg.get 1
  string.size
  call-core 0
  arg.get 1
  string.lower_memory
  arg.get 2
  i32.from_s32
  arg.get 3
  i32.from_s32
  call-core 27
  call-core 3
  record.lift_memory 6)
(@interface func (type 53)
  call-core 28
  s32.from_i32)
(@interface func (type 55)
  arg.get 0
  i32.from_u32
  arg.get 1
  i32.from_s32
  call-core 29
  call-core 3
  call-core 2
  byte_array.lift_memory
  call-core 3
  call-core 2
  call-core 1)
(@interface func (type 57)
  arg.get 0
  i32.from_u32
  arg.get 1
  i32.from_u32
  call-core 30
  call-core 3
  call-core 2
  string.lift_memory
  call-core 3
  call-core 2
  call-core 1)
(@interface func (type 59)
  arg.get 0
  i32.from_u32
  arg.get 1
  i32.from_u32
  call-core 31
  s32.from_i32)

;; Exports
(@interface export "allocate" (func 0))
(@interface export "deallocate" (func 1))
(@interface export "get_result_size" (func 2))
(@interface export "get_result_ptr" (func 3))
(@interface export "set_result_size" (func 4))
(@interface export "set_result_ptr" (func 5))
(@interface export "sqlite3_column_text" (func 10))
(@interface export "sqlite3_column_bytes" (func 12))
(@interface export "sqlite3_close" (func 14))
(@interface export "sqlite3_bind_double" (func 16))
(@interface export "sqlite3_open_v2" (func 18))
(@interface export "sqlite3_changes" (func 20))
(@interface export "sqlite3_step" (func 22))
(@interface export "sqlite3_column_int64" (func 24))
(@interface export "sqlite3_errcode" (func 26))
(@interface export "sqlite3_column_double" (func 28))
(@interface export "sqlite3_busy_timeout" (func 30))
(@interface export "sqlite3_errmsg" (func 32))
(@interface export "sqlite3_bind_int64" (func 34))
(@interface export "sqlite3_finalize" (func 36))
(@interface export "sqlite3_prepare_v2" (func 38))
(@interface export "sqlite3_bind_null" (func 40))
(@interface export "sqlite3_column_count" (func 42))
(@interface export "sqlite3_bind_blob" (func 44))
(@interface export "sqlite3_total_changes" (func 46))
(@interface export "sqlite3_bind_text" (func 48))
(@interface export "sqlite3_reset" (func 50))
(@interface export "sqlite3_exec" (func 52))
(@interface export "sqlite3_libversion_number" (func 54))
(@interface export "sqlite3_column_blob" (func 56))
(@interface export "sqlite3_column_name" (func 58))
(@interface export "sqlite3_column_type" (func 60))

;; Implementations
(@interface implement (func 10) (func 9))
(@interface implement (func 12) (func 11))
(@interface implement (func 14) (func 13))
(@interface implement (func 16) (func 15))
(@interface implement (func 18) (func 17))
(@interface implement (func 20) (func 19))
(@interface implement (func 22) (func 21))
(@interface implement (func 24) (func 23))
(@interface implement (func 26) (func 25))
(@interface implement (func 28) (func 27))
(@interface implement (func 30) (func 29))
(@interface implement (func 32) (func 31))
(@interface implement (func 34) (func 33))
(@interface implement (func 36) (func 35))
(@interface implement (func 38) (func 37))
(@interface implement (func 40) (func 39))
(@interface implement (func 42) (func 41))
(@interface implement (func 44) (func 43))
(@interface implement (func 46) (func 45))
(@interface implement (func 48) (func 47))
(@interface implement (func 50) (func 49))
(@interface implement (func 52) (func 51))
(@interface implement (func 54) (func 53))
(@interface implement (func 56) (func 55))
(@interface implement (func 58) (func 57))
(@interface implement (func 60) (func 59))