@@ -189,13 +189,15 @@ describe("test type casting on fetch", () => {
189189 " true as col_boolean,\n" +
190190 " null::bool as col_boolean_null,\n" +
191191 " [1,2,3,4] as col_array,\n" +
192- // " null::array(int) as col_array_null,\n" +
192+ " null::array(int) as col_array_null,\n" +
193193 " '1231232.123459999990457054844258706536'::decimal(38, 30) as col_decimal,\n" +
194- // " null::decimal(38, 30) as col_decimal_null,\n" +
194+ " null::decimal(38, 30) as col_decimal_null,\n" +
195195 " 'abc123'::bytea as col_bytea,\n" +
196196 " null::bytea as col_bytea_null,\n" +
197197 " 'point(1 2)'::geography as col_geography,\n" +
198- " null::geography as col_geography_null,"
198+ " null::geography as col_geography_null,\n" +
199+ " [[1,2],[null,2],null]::array(array(int)) as col_arr_arr,\n" +
200+ " null::array(array(int)) as col_arr_arr_null"
199201 ) ;
200202 const { data, meta } = await statement . fetchResult ( ) ;
201203 const metaObjects = [
@@ -218,14 +220,15 @@ describe("test type casting on fetch", () => {
218220 { name : "col_boolean" , type : "boolean" } ,
219221 { name : "col_boolean_null" , type : "boolean null" } ,
220222 { name : "col_array" , type : "array(int)" } ,
221- // { name: "col_array_null", type: "array(int) null" },
222- // { name: "col_decimal", type: "decimal(38, 30)" },
223- { name : "col_decimal" , type : "decimal" } ,
224- // { name: "col_decimal_null", type: "decimal(38, 30) null" },
223+ { name : "col_array_null" , type : "array(int) null" } ,
224+ { name : "col_decimal" , type : "decimal(38, 30)" } ,
225+ { name : "col_decimal_null" , type : "decimal(38, 30) null" } ,
225226 { name : "col_bytea" , type : "bytea" } ,
226227 { name : "col_bytea_null" , type : "bytea null" } ,
227228 { name : "col_geography" , type : "geography" } ,
228- { name : "col_geography_null" , type : "geography null" }
229+ { name : "col_geography_null" , type : "geography null" } ,
230+ { name : "col_arr_arr" , type : "array(array(int null) null)" } ,
231+ { name : "col_arr_arr_null" , type : "array(array(int)) null" }
229232 ] ;
230233 for ( let i = 0 ; i < meta . length ; i ++ ) {
231234 expect ( meta [ i ] ) . toEqual ( metaObjects [ i ] ) ;
@@ -261,29 +264,27 @@ describe("test type casting on fetch", () => {
261264 " true as col_boolean,\n" +
262265 " null::bool as col_boolean_null,\n" +
263266 " [1,2,3,4] as col_array,\n" +
264- // " null::array(int) as col_array_null,\n" +
267+ " null::array(int) as col_array_null,\n" +
265268 " '1231232.123459999990457054844258706536'::decimal(38, 30) as col_decimal,\n" +
266- // " null::decimal(38, 30) as col_decimal_null,\n" +
269+ " null::decimal(38, 30) as col_decimal_null,\n" +
267270 " 'abc123'::bytea as col_bytea,\n" +
268271 " null::bytea as col_bytea_null,\n" +
269272 " 'point(1 2)'::geography as col_geography,\n" +
270- " null::geography as col_geography_null,"
273+ " null::geography as col_geography_null,\n" +
274+ " [[1,2],[null,2],null]::array(array(int)) as col_arr_arr,\n" +
275+ " null::array(array(int)) as col_arr_arr_null"
271276 ) ;
272277 const { data } = await statement . streamResult ( ) ;
273278 const [ meta ] = await stream . once ( data , "meta" ) ;
274279 const metaObjects = [
275280 { name : "col_int" , type : "int" } ,
276- // { name: "col_int_null", type: "int null" },
277- { name : "col_int_null" , type : "integer null" } ,
281+ { name : "col_int_null" , type : "int null" } ,
278282 { name : "col_long" , type : "long" } ,
279- // { name: "col_long_null", type: "long null" },
280- { name : "col_long_null" , type : "bigint null" } ,
283+ { name : "col_long_null" , type : "long null" } ,
281284 { name : "col_float" , type : "float" } ,
282- // { name: "col_float_null", type: "float null" },
283- { name : "col_float_null" , type : "real null" } ,
285+ { name : "col_float_null" , type : "float null" } ,
284286 { name : "col_double" , type : "double" } ,
285- // { name: "col_double_null", type: "double null" },
286- { name : "col_double_null" , type : "double precision null" } ,
287+ { name : "col_double_null" , type : "double null" } ,
287288 { name : "col_text" , type : "text" } ,
288289 { name : "col_text_null" , type : "text null" } ,
289290 { name : "col_date" , type : "date" } ,
@@ -295,14 +296,15 @@ describe("test type casting on fetch", () => {
295296 { name : "col_boolean" , type : "boolean" } ,
296297 { name : "col_boolean_null" , type : "boolean null" } ,
297298 { name : "col_array" , type : "array(int)" } ,
298- // { name: "col_array_null", type: "array(int) null" },
299- // { name: "col_decimal", type: "decimal(38, 30)" },
300- { name : "col_decimal" , type : "decimal" } ,
301- // { name: "col_decimal_null", type: "decimal(38, 30) null" },
299+ { name : "col_array_null" , type : "array(int) null" } ,
300+ { name : "col_decimal" , type : "decimal(38, 30)" } ,
301+ { name : "col_decimal_null" , type : "decimal(38, 30) null" } ,
302302 { name : "col_bytea" , type : "bytea" } ,
303303 { name : "col_bytea_null" , type : "bytea null" } ,
304304 { name : "col_geography" , type : "geography" } ,
305- { name : "col_geography_null" , type : "geography null" }
305+ { name : "col_geography_null" , type : "geography null" } ,
306+ { name : "col_arr_arr" , type : "array(array(int null) null)" } ,
307+ { name : "col_arr_arr_null" , type : "array(array(int)) null" }
306308 ] ;
307309 for ( let i = 0 ; i < meta . length ; i ++ ) {
308310 expect ( meta [ i ] ) . toEqual ( metaObjects [ i ] ) ;
0 commit comments