File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ import { Firebolt } from "../../src/index" ;
2+
3+ const connectionParams = {
4+ auth : {
5+ username : process . env . FIREBOLT_USERNAME as string ,
6+ password : process . env . FIREBOLT_PASSWORD as string
7+ } ,
8+ database : process . env . FIREBOLT_DATABASE as string ,
9+ engineName : process . env . FIREBOLT_ENGINE_NAME as string
10+ } ;
11+
12+ jest . setTimeout ( 100000 ) ;
13+
14+ describe ( "boolean" , ( ) => {
15+ it ( "handles select boolean" , async ( ) => {
16+ const firebolt = Firebolt ( {
17+ apiEndpoint : process . env . FIREBOLT_API_ENDPOINT as string
18+ } ) ;
19+
20+ const connection = await firebolt . connect ( connectionParams ) ;
21+
22+ const statement = await connection . execute ( "select true::boolean" , {
23+ settings : {
24+ advanced_mode : "true" ,
25+ bool_output_format : "postgres" ,
26+ output_format_firebolt_type_names : "true"
27+ }
28+ } ) ;
29+
30+ const { data, meta } = await statement . fetchResult ( ) ;
31+ expect ( meta [ 0 ] . type ) . toEqual ( "boolean" ) ;
32+ const row = data [ 0 ] ;
33+ expect ( ( row as unknown [ ] ) [ 0 ] ) . toEqual ( true ) ;
34+ } ) ;
35+ } ) ;
You can’t perform that action at this time.
0 commit comments