@@ -92,6 +92,22 @@ t('Boolean false', async() =>
92
92
[ false , ( await sql `select ${ false } as x` ) [ 0 ] . x ]
93
93
)
94
94
95
+ t ( 'Boolean[] [true, false]' , async ( ) =>
96
+ [ "[true,false]" , JSON . stringify ( ( await sql `select ${ [ true , false ] } ::bool[] as x` ) [ 0 ] . x ) ]
97
+ )
98
+
99
+ t ( 'Number[] [1, 2]' , async ( ) =>
100
+ [ "[1,2]" , JSON . stringify ( ( await sql `select ${ [ 1 , 2 ] } ::int4[] as x` ) [ 0 ] . x ) ]
101
+ )
102
+
103
+ t ( 'String[] ["a", "b"]' , async ( ) =>
104
+ [ '["a","b"]' , JSON . stringify ( ( await sql `select ${ [ "a" , "b" ] } ::text[] as x` ) [ 0 ] . x ) ]
105
+ )
106
+
107
+ t ( 'BigInt[] [BigInt(1), BigInt(2)]' , async ( ) =>
108
+ [ '[1,2]' , JSON . stringify ( ( await sql `select ${ [ BigInt ( 1 ) , BigInt ( 2 ) ] } ::float4[] as x` ) [ 0 ] . x ) ]
109
+ )
110
+
95
111
t ( 'Boolean true' , async ( ) =>
96
112
[ true , ( await sql `select ${ true } as x` ) [ 0 ] . x ]
97
113
)
@@ -125,7 +141,7 @@ t('String array', async() =>
125
141
)
126
142
127
143
t ( 'Array of Integer' , async ( ) =>
128
- [ '3' , ( await sql `select ${ sql . array ( [ 1 , 2 , 3 ] ) } as x` ) [ 0 ] . x [ 2 ] ]
144
+ [ 3 , ( await sql `select ${ sql . array ( [ 1 , 2 , 3 ] ) } as x` ) [ 0 ] . x [ 2 ] ]
129
145
)
130
146
131
147
t ( 'Array of String' , async ( ) =>
@@ -143,11 +159,11 @@ t('Array of Box', async() => [
143
159
] )
144
160
145
161
t ( 'Nested array n2' , async ( ) =>
146
- [ '4' , ( await sql `select ${ sql . array ( [ [ 1 , 2 ] , [ 3 , 4 ] ] ) } as x` ) [ 0 ] . x [ 1 ] [ 1 ] ]
162
+ [ 4 , ( await sql `select ${ sql . array ( [ [ 1 , 2 ] , [ 3 , 4 ] ] ) } as x` ) [ 0 ] . x [ 1 ] [ 1 ] ]
147
163
)
148
164
149
165
t ( 'Nested array n3' , async ( ) =>
150
- [ '6' , ( await sql `select ${ sql . array ( [ [ [ 1 , 2 ] ] , [ [ 3 , 4 ] ] , [ [ 5 , 6 ] ] ] ) } as x` ) [ 0 ] . x [ 2 ] [ 0 ] [ 1 ] ]
166
+ [ 6 , ( await sql `select ${ sql . array ( [ [ [ 1 , 2 ] ] , [ [ 3 , 4 ] ] , [ [ 5 , 6 ] ] ] ) } as x` ) [ 0 ] . x [ 2 ] [ 0 ] [ 1 ] ]
151
167
)
152
168
153
169
t ( 'Escape in arrays' , async ( ) =>
0 commit comments