1
1
// Auto-generated with deno_bindgen
2
- import { CachePolicy , prepare } from "https://deno.land/x/[email protected] /plug.ts" ;
2
+ import { CachePolicy , prepare } from "https://deno.land/x/[email protected] /plug.ts"
3
3
function encode ( v : string | Uint8Array ) : Uint8Array {
4
- if ( typeof v !== "string" ) return v ;
5
- return new TextEncoder ( ) . encode ( v ) ;
4
+ if ( typeof v !== "string" ) return v
5
+ return new TextEncoder ( ) . encode ( v )
6
6
}
7
7
const opts = {
8
8
name : "deno_sqlite3" ,
9
9
url : ( new URL ( "../target/release" , import . meta. url ) ) . toString ( ) ,
10
10
policy : undefined ,
11
- } ;
11
+ }
12
12
const _lib = await prepare ( opts , {
13
- sqlite3_execute : {
14
- parameters : [ "usize" , "pointer" , "usize" , "pointer" , "usize" ] ,
15
- result : "isize" ,
16
- nonblocking : true ,
17
- } ,
18
13
fill_result : {
19
14
parameters : [ "pointer" , "usize" ] ,
20
15
result : "void" ,
@@ -25,11 +20,22 @@ const _lib = await prepare(opts, {
25
20
result : "void" ,
26
21
nonblocking : false ,
27
22
} ,
23
+ get_result_len : { parameters : [ ] , result : "usize" , nonblocking : false } ,
24
+ sqlite3_execute : {
25
+ parameters : [ "usize" , "pointer" , "usize" , "pointer" , "usize" ] ,
26
+ result : "isize" ,
27
+ nonblocking : true ,
28
+ } ,
28
29
deno_sqlite3_open : {
29
30
parameters : [ "usize" , "pointer" , "usize" ] ,
30
31
result : "isize" ,
31
32
nonblocking : true ,
32
33
} ,
34
+ deno_sqlite3_close : {
35
+ parameters : [ "usize" ] ,
36
+ result : "isize" ,
37
+ nonblocking : true ,
38
+ } ,
33
39
sqlite3_query : {
34
40
parameters : [
35
41
"usize" ,
@@ -43,55 +49,55 @@ const _lib = await prepare(opts, {
43
49
result : "isize" ,
44
50
nonblocking : true ,
45
51
} ,
46
- get_result_len : { parameters : [ ] , result : "usize" , nonblocking : false } ,
47
52
sqlite3_open_memory : {
48
53
parameters : [ "usize" ] ,
49
54
result : "isize" ,
50
55
nonblocking : true ,
51
56
} ,
52
- deno_sqlite3_close : {
53
- parameters : [ "usize" ] ,
54
- result : "isize" ,
55
- nonblocking : true ,
56
- } ,
57
- } ) ;
57
+ } )
58
58
59
+ export function fill_result ( a0 : Uint8Array ) {
60
+ const a0_buf = encode ( a0 )
61
+ return _lib . symbols . fill_result ( a0_buf , a0_buf . byteLength ) as null
62
+ }
63
+ export function get_last_error ( a0 : Uint8Array ) {
64
+ const a0_buf = encode ( a0 )
65
+ return _lib . symbols . get_last_error ( a0_buf , a0_buf . byteLength ) as null
66
+ }
67
+ export function get_result_len ( ) {
68
+ return _lib . symbols . get_result_len ( ) as number
69
+ }
59
70
export function sqlite3_execute ( a0 : number , a1 : string , a2 : Uint8Array ) {
60
- const a1_buf = encode ( a1 ) ;
61
- const a2_buf = encode ( a2 ) ;
71
+ const a1_buf = encode ( a1 )
72
+ const a2_buf = encode ( a2 )
62
73
return _lib . symbols . sqlite3_execute (
63
74
a0 ,
64
75
a1_buf ,
65
76
a1_buf . byteLength ,
66
77
a2_buf ,
67
78
a2_buf . byteLength ,
68
- ) as Promise < number > ;
69
- }
70
- export function fill_result ( a0 : Uint8Array ) {
71
- const a0_buf = encode ( a0 ) ;
72
- return _lib . symbols . fill_result ( a0_buf , a0_buf . byteLength ) as null ;
73
- }
74
- export function get_last_error ( a0 : Uint8Array ) {
75
- const a0_buf = encode ( a0 ) ;
76
- return _lib . symbols . get_last_error ( a0_buf , a0_buf . byteLength ) as null ;
79
+ ) as Promise < number >
77
80
}
78
81
export function deno_sqlite3_open ( a0 : number , a1 : string ) {
79
- const a1_buf = encode ( a1 ) ;
82
+ const a1_buf = encode ( a1 )
80
83
return _lib . symbols . deno_sqlite3_open (
81
84
a0 ,
82
85
a1_buf ,
83
86
a1_buf . byteLength ,
84
- ) as Promise < number > ;
87
+ ) as Promise < number >
88
+ }
89
+ export function deno_sqlite3_close ( a0 : number ) {
90
+ return _lib . symbols . deno_sqlite3_close ( a0 ) as Promise < number >
85
91
}
86
92
export function sqlite3_query (
87
93
a0 : number ,
88
94
a1 : string ,
89
95
a2 : Uint8Array ,
90
96
a3 : Uint8Array ,
91
97
) {
92
- const a1_buf = encode ( a1 ) ;
93
- const a2_buf = encode ( a2 ) ;
94
- const a3_buf = encode ( a3 ) ;
98
+ const a1_buf = encode ( a1 )
99
+ const a2_buf = encode ( a2 )
100
+ const a3_buf = encode ( a3 )
95
101
return _lib . symbols . sqlite3_query (
96
102
a0 ,
97
103
a1_buf ,
@@ -100,14 +106,8 @@ export function sqlite3_query(
100
106
a2_buf . byteLength ,
101
107
a3_buf ,
102
108
a3_buf . byteLength ,
103
- ) as Promise < number > ;
104
- }
105
- export function get_result_len ( ) {
106
- return _lib . symbols . get_result_len ( ) as number ;
109
+ ) as Promise < number >
107
110
}
108
111
export function sqlite3_open_memory ( a0 : number ) {
109
- return _lib . symbols . sqlite3_open_memory ( a0 ) as Promise < number > ;
110
- }
111
- export function deno_sqlite3_close ( a0 : number ) {
112
- return _lib . symbols . deno_sqlite3_close ( a0 ) as Promise < number > ;
112
+ return _lib . symbols . sqlite3_open_memory ( a0 ) as Promise < number >
113
113
}
0 commit comments