sqlite-wasm-connector/sqlite3.wit

495 lines
12 KiB
Plaintext
Raw Normal View History

(@interface it_version "0.24.1")
2021-04-11 23:13:00 +03:00
2020-09-17 21:19:03 +03:00
;; Types
(@interface type (func
(param $size: i32)
2020-09-17 21:19:03 +03:00
(result i32))) ;; 0
2021-04-11 23:13:00 +03:00
(@interface type (func )) ;; 1
(@interface type (func
2020-09-17 21:19:03 +03:00
(result i32))) ;; 2
(@interface type (func
2020-09-17 21:19:03 +03:00
(result i32))) ;; 3
(@interface type (func
2020-09-17 21:19:03 +03:00
(param $result_size: i32) )) ;; 4
(@interface type (func
2020-09-17 21:19:03 +03:00
(param $result_ptr: i32) )) ;; 5
(@interface type (record $DBOpenDescriptor (
2020-11-08 22:10:31 +03:00
field $ret_code: s32
field $db_handle: u32
2020-11-08 22:10:31 +03:00
))) ;; 6
(@interface type (record $DBPrepareDescriptor (
field $ret_code: s32
field $stmt_handle: u32
field $tail: u32
))) ;; 7
(@interface type (record $DBExecDescriptor (
2020-11-08 22:10:31 +03:00
field $ret_code: s32
field $err_msg: string
2020-11-08 22:10:31 +03:00
))) ;; 8
2021-04-11 23:13:00 +03:00
(@interface type (record $SecurityTetraplet (
field $peer_pk: string
field $service_id: string
field $function_name: string
field $json_path: string
))) ;; 9
(@interface type (func
(param $stmt_handle: u32 $pos: s32 $value: s64)
(result s32))) ;; 10
(@interface type (func
(param $stmt_handle: u32 $pos: s32 $value: s64)
(result s32))) ;; 11
(@interface type (func
(param $stmt_handle: u32 $icol: u32)
2021-04-11 23:13:00 +03:00
(result string))) ;; 12
(@interface type (func
(param $stmt_handle: u32 $icol: u32)
(result string))) ;; 13
(@interface type (func
(param $db_handle: u32 $sql: string)
(result record 7))) ;; 14
(@interface type (func
(param $db_handle: u32 $sql: string)
(result record 7))) ;; 15
(@interface type (func
(param $db_handle: u32)
2021-04-11 23:13:00 +03:00
(result s32))) ;; 16
(@interface type (func
(param $db_handle: u32)
2021-04-11 23:13:00 +03:00
(result s32))) ;; 17
(@interface type (func
(param $stmt_handle: u32 $pos: s32 $value: f64)
2021-04-11 23:13:00 +03:00
(result s32))) ;; 18
(@interface type (func
(param $stmt_handle: u32 $pos: s32 $value: f64)
(result s32))) ;; 19
(@interface type (func
(param $filename: string $flags: s32 $vfs: string)
(result record 6))) ;; 20
(@interface type (func
(param $filename: string $flags: s32 $vfs: string)
(result record 6))) ;; 21
(@interface type (func
(param $db_handle: u32)
2021-04-11 23:13:00 +03:00
(result s32))) ;; 22
(@interface type (func
(param $db_handle: u32)
2021-04-11 23:13:00 +03:00
(result s32))) ;; 23
(@interface type (func
(param $stmt_handle: u32)
2021-04-11 23:13:00 +03:00
(result s32))) ;; 24
(@interface type (func
(param $stmt_handle: u32)
(result s32))) ;; 25
(@interface type (func
(param $stmt_handle: u32)
(result s32))) ;; 26
(@interface type (func
(param $stmt_handle: u32)
2021-04-11 23:13:00 +03:00
(result s32))) ;; 27
(@interface type (func
(param $size: s64)
(result s64))) ;; 28
(@interface type (func
(param $size: s64)
(result s64))) ;; 29
(@interface type (func
(param $db: u32)
(result s32))) ;; 30
(@interface type (func
(param $db: u32)
2021-04-11 23:13:00 +03:00
(result s32))) ;; 31
(@interface type (func
(param $db_handle: u32 $sql: string $callback_id: s32 $callback_arg: s32)
(result record 8))) ;; 32
(@interface type (func
(param $db_handle: u32 $sql: string $callback_id: s32 $callback_arg: s32)
(result record 8))) ;; 33
(@interface type (func
(param $stmt_handle: u32 $icol: s32)
(result f64))) ;; 34
(@interface type (func
(param $stmt_handle: u32 $icol: s32)
(result f64))) ;; 35
(@interface type (func
(param $stmt_handle: u32 $icol: u32)
2021-04-11 23:13:00 +03:00
(result s32))) ;; 36
(@interface type (func
(param $stmt_handle: u32 $icol: u32)
2021-04-11 23:13:00 +03:00
(result s32))) ;; 37
(@interface type (func
(param $stmt_handle: u32 $pos: s32)
2021-04-11 23:13:00 +03:00
(result s32))) ;; 38
(@interface type (func
(param $stmt_handle: u32 $pos: s32)
(result s32))) ;; 39
(@interface type (func
(param $stmt_handle: u32 $pos: s32 $blob: array (u8) $xDel: s32)
(result s32))) ;; 40
(@interface type (func
(param $stmt_handle: u32 $pos: s32 $blob: array (u8) $xDel: s32)
2020-09-17 21:19:03 +03:00
(result s32))) ;; 41
(@interface type (func
(param $db_handle: u32)
2020-09-17 21:19:03 +03:00
(result s32))) ;; 42
(@interface type (func
(param $db_handle: u32)
2020-09-17 21:19:03 +03:00
(result s32))) ;; 43
(@interface type (func
(param $stmt_handle: u32)
2020-09-17 21:19:03 +03:00
(result s32))) ;; 44
(@interface type (func
(param $stmt_handle: u32)
2020-09-17 21:19:03 +03:00
(result s32))) ;; 45
(@interface type (func
(param $stmt_handle: u32 $pos: s32 $text: string $xDel: s32)
2020-09-17 21:19:03 +03:00
(result s32))) ;; 46
(@interface type (func
(param $stmt_handle: u32 $pos: s32 $text: string $xDel: s32)
2020-09-17 21:19:03 +03:00
(result s32))) ;; 47
(@interface type (func
(param $stmt_handle: u32)
2020-09-17 21:19:03 +03:00
(result s32))) ;; 48
(@interface type (func
(param $stmt_handle: u32)
2020-09-17 21:19:03 +03:00
(result s32))) ;; 49
(@interface type (func
(param $size: s64)
(result s64))) ;; 50
(@interface type (func
(param $size: s64)
(result s64))) ;; 51
(@interface type (func
2021-04-11 23:13:00 +03:00
(result s32))) ;; 52
(@interface type (func
(result s32))) ;; 53
(@interface type (func
(param $stmt_handle: u32 $icol: u32)
(result s64))) ;; 54
(@interface type (func
(param $stmt_handle: u32 $icol: u32)
(result s64))) ;; 55
(@interface type (func
(param $db_handle: u32 $ms: u32)
2021-04-11 23:13:00 +03:00
(result s32))) ;; 56
(@interface type (func
(param $db_handle: u32 $ms: u32)
(result s32))) ;; 57
(@interface type (func
(param $stmt_handle: u32 $icol: s32)
2021-04-11 23:13:00 +03:00
(result array (u8)))) ;; 58
(@interface type (func
(param $stmt_handle: u32 $icol: s32)
(result array (u8)))) ;; 59
(@interface type (func
(param $stmt_handle: u32 $N: u32)
2021-04-11 23:13:00 +03:00
(result string))) ;; 60
(@interface type (func
(param $stmt_handle: u32 $N: u32)
(result string))) ;; 61
(@interface type (func
(param $stmt_handle: u32 $icol: u32)
2021-04-11 23:13:00 +03:00
(result s32))) ;; 62
(@interface type (func
(param $stmt_handle: u32 $icol: u32)
(result s32))) ;; 63
(@interface type (func
(param $db_handle: u32)
(result string))) ;; 64
(@interface type (func
(param $db_handle: u32)
(result string))) ;; 65
2020-09-17 21:19:03 +03:00
;; Adapters
(@interface func (type 10)
2020-09-17 21:19:03 +03:00
arg.get 0
i32.from_u32
arg.get 1
i32.from_s32
arg.get 2
i64.from_s64
2020-09-17 21:19:03 +03:00
call-core 6
s32.from_i32)
(@interface func (type 12)
arg.get 0
i32.from_u32
arg.get 1
i32.from_u32
call-core 7
2020-09-17 21:19:03 +03:00
call-core 3
call-core 2
string.lift_memory
call-core 1)
(@interface func (type 14)
2020-09-17 21:19:03 +03:00
arg.get 0
i32.from_u32
arg.get 1
string.size
i32.push 1
call-core 0
arg.get 1
string.lower_memory
call-core 8
call-core 3
record.lift_memory 7
call-core 1)
(@interface func (type 16)
2020-09-17 21:19:03 +03:00
arg.get 0
i32.from_u32
call-core 9
2020-09-17 21:19:03 +03:00
s32.from_i32)
(@interface func (type 18)
2020-09-17 21:19:03 +03:00
arg.get 0
i32.from_u32
arg.get 1
i32.from_s32
arg.get 2
call-core 10
2020-09-17 21:19:03 +03:00
s32.from_i32)
(@interface func (type 20)
2020-09-17 21:19:03 +03:00
arg.get 0
string.size
2021-04-27 18:29:36 +03:00
i32.push 1
2020-09-17 21:19:03 +03:00
call-core 0
arg.get 0
string.lower_memory
arg.get 1
i32.from_s32
arg.get 2
string.size
2021-04-27 18:29:36 +03:00
i32.push 1
2020-09-17 21:19:03 +03:00
call-core 0
arg.get 2
string.lower_memory
call-core 11
2020-09-17 21:19:03 +03:00
call-core 3
record.lift_memory 6
2021-04-11 23:13:00 +03:00
call-core 1)
(@interface func (type 22)
2020-09-17 21:19:03 +03:00
arg.get 0
i32.from_u32
call-core 12
s32.from_i32)
(@interface func (type 24)
2020-09-17 21:19:03 +03:00
arg.get 0
i32.from_u32
call-core 13
s32.from_i32)
(@interface func (type 26)
2020-09-17 21:19:03 +03:00
arg.get 0
i32.from_u32
call-core 14
s32.from_i32)
(@interface func (type 28)
2020-09-17 21:19:03 +03:00
arg.get 0
i64.from_s64
call-core 15
s64.from_i64)
(@interface func (type 30)
2020-09-17 21:19:03 +03:00
arg.get 0
i32.from_u32
call-core 16
s32.from_i32)
(@interface func (type 32)
2020-09-17 21:19:03 +03:00
arg.get 0
i32.from_u32
arg.get 1
string.size
i32.push 1
call-core 0
arg.get 1
string.lower_memory
arg.get 2
i32.from_s32
arg.get 3
i32.from_s32
2020-09-17 21:19:03 +03:00
call-core 17
call-core 3
record.lift_memory 8
2020-09-17 21:19:03 +03:00
call-core 1)
(@interface func (type 34)
2020-09-17 21:19:03 +03:00
arg.get 0
i32.from_u32
arg.get 1
i32.from_s32
call-core 18)
(@interface func (type 36)
2020-09-17 21:19:03 +03:00
arg.get 0
i32.from_u32
arg.get 1
i32.from_u32
2020-09-17 21:19:03 +03:00
call-core 19
s32.from_i32)
(@interface func (type 38)
2020-09-17 21:19:03 +03:00
arg.get 0
i32.from_u32
arg.get 1
i32.from_s32
2020-09-17 21:19:03 +03:00
call-core 20
s32.from_i32)
(@interface func (type 40)
2020-09-17 21:19:03 +03:00
arg.get 0
i32.from_u32
2021-04-11 23:13:00 +03:00
arg.get 1
i32.from_s32
arg.get 2
array.lower_memory u8
arg.get 3
i32.from_s32
2020-09-17 21:19:03 +03:00
call-core 21
s32.from_i32)
(@interface func (type 42)
2020-09-17 21:19:03 +03:00
arg.get 0
i32.from_u32
call-core 22
s32.from_i32)
(@interface func (type 44)
2020-09-17 21:19:03 +03:00
arg.get 0
i32.from_u32
call-core 23
s32.from_i32)
(@interface func (type 46)
2020-09-17 21:19:03 +03:00
arg.get 0
i32.from_u32
arg.get 1
i32.from_s32
arg.get 2
string.size
2021-04-27 18:29:36 +03:00
i32.push 1
2020-09-17 21:19:03 +03:00
call-core 0
arg.get 2
string.lower_memory
arg.get 3
i32.from_s32
call-core 24
2020-09-17 21:19:03 +03:00
s32.from_i32)
(@interface func (type 48)
2020-09-17 21:19:03 +03:00
arg.get 0
i32.from_u32
call-core 25
s32.from_i32)
(@interface func (type 50)
arg.get 0
i64.from_s64
2020-09-17 21:19:03 +03:00
call-core 26
s64.from_i64)
(@interface func (type 52)
call-core 27
2020-09-17 21:19:03 +03:00
s32.from_i32)
(@interface func (type 54)
2020-09-17 21:19:03 +03:00
arg.get 0
i32.from_u32
arg.get 1
i32.from_u32
2020-09-17 21:19:03 +03:00
call-core 28
s64.from_i64)
(@interface func (type 56)
arg.get 0
i32.from_u32
arg.get 1
i32.from_u32
call-core 29
2020-09-17 21:19:03 +03:00
s32.from_i32)
(@interface func (type 58)
2020-09-17 21:19:03 +03:00
arg.get 0
i32.from_u32
arg.get 1
i32.from_s32
call-core 30
2020-09-17 21:19:03 +03:00
call-core 3
call-core 2
2021-04-27 18:29:36 +03:00
byte_array.lift_memory
2021-04-11 23:13:00 +03:00
call-core 1)
(@interface func (type 60)
2020-09-17 21:19:03 +03:00
arg.get 0
i32.from_u32
arg.get 1
i32.from_u32
call-core 31
2020-09-17 21:19:03 +03:00
call-core 3
call-core 2
string.lift_memory
call-core 1)
(@interface func (type 62)
2020-09-17 21:19:03 +03:00
arg.get 0
i32.from_u32
arg.get 1
i32.from_u32
call-core 32
2020-09-17 21:19:03 +03:00
s32.from_i32)
(@interface func (type 64)
arg.get 0
i32.from_u32
call-core 33
call-core 3
call-core 2
string.lift_memory
call-core 1)
2020-09-17 21:19:03 +03:00
;; Exports
(@interface export "allocate" (func 0))
2021-04-11 23:13:00 +03:00
(@interface export "release_objects" (func 1))
2020-09-17 21:19:03 +03:00
(@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_bind_int64" (func 11))
(@interface export "sqlite3_column_text" (func 13))
(@interface export "sqlite3_prepare_v2" (func 15))
(@interface export "sqlite3_close" (func 17))
(@interface export "sqlite3_bind_double" (func 19))
(@interface export "sqlite3_open_v2" (func 21))
(@interface export "sqlite3_changes" (func 23))
(@interface export "sqlite3_column_count" (func 25))
(@interface export "sqlite3_finalize" (func 27))
(@interface export "sqlite3_soft_heap_limit64" (func 29))
(@interface export "sqlite3_errcode" (func 31))
(@interface export "sqlite3_exec" (func 33))
(@interface export "sqlite3_column_double" (func 35))
(@interface export "sqlite3_column_bytes" (func 37))
(@interface export "sqlite3_bind_null" (func 39))
(@interface export "sqlite3_bind_blob" (func 41))
(@interface export "sqlite3_total_changes" (func 43))
(@interface export "sqlite3_step" (func 45))
(@interface export "sqlite3_bind_text" (func 47))
(@interface export "sqlite3_reset" (func 49))
(@interface export "sqlite3_hard_heap_limit64" (func 51))
(@interface export "sqlite3_libversion_number" (func 53))
(@interface export "sqlite3_column_int64" (func 55))
(@interface export "sqlite3_busy_timeout" (func 57))
(@interface export "sqlite3_column_blob" (func 59))
(@interface export "sqlite3_column_name" (func 61))
(@interface export "sqlite3_column_type" (func 63))
(@interface export "sqlite3_errmsg" (func 65))
2020-09-17 21:19:03 +03:00
;; Implementations
(@interface implement (func 11) (func 10))
(@interface implement (func 13) (func 12))
(@interface implement (func 15) (func 14))
(@interface implement (func 17) (func 16))
(@interface implement (func 19) (func 18))
(@interface implement (func 21) (func 20))
(@interface implement (func 23) (func 22))
(@interface implement (func 25) (func 24))
(@interface implement (func 27) (func 26))
(@interface implement (func 29) (func 28))
(@interface implement (func 31) (func 30))
(@interface implement (func 33) (func 32))
(@interface implement (func 35) (func 34))
(@interface implement (func 37) (func 36))
(@interface implement (func 39) (func 38))
(@interface implement (func 41) (func 40))
(@interface implement (func 43) (func 42))
(@interface implement (func 45) (func 44))
(@interface implement (func 47) (func 46))
(@interface implement (func 49) (func 48))
(@interface implement (func 51) (func 50))
(@interface implement (func 53) (func 52))
(@interface implement (func 55) (func 54))
(@interface implement (func 57) (func 56))
(@interface implement (func 59) (func 58))
(@interface implement (func 61) (func 60))
(@interface implement (func 63) (func 62))
(@interface implement (func 65) (func 64))