File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -164,10 +164,16 @@ export class Statement {
164164 async fetchResult ( ) {
165165 const response = await this . request . ready ( ) ;
166166 const text = await response . text ( ) ;
167+
168+ if ( this . executeQueryOptions ?. settings ?. async_execution ) {
169+ return JSONbig . parse ( text ) ;
170+ }
171+
167172 const parsed = this . handleParseResponse ( text ) ;
168173 const normalized = normalizeResponse ( parsed , this . executeQueryOptions ) ;
169174
170175 const { data, meta, statistics } = normalized ;
176+
171177 return {
172178 data,
173179 meta,
Original file line number Diff line number Diff line change @@ -60,6 +60,19 @@ describe("integration test", () => {
6060 const row = data [ 0 ] ;
6161 expect ( row ) . toMatchObject ( { "1" : 1 } ) ;
6262 } ) ;
63+ it ( "async query" , async ( ) => {
64+ const firebolt = Firebolt ( {
65+ apiEndpoint : process . env . FIREBOLT_API_ENDPOINT as string
66+ } ) ;
67+
68+ const connection = await firebolt . connect ( connectionParams ) ;
69+ const statement = await connection . execute ( "SELECT 1" , {
70+ settings : { async_execution : true } ,
71+ response : { normalizeData : false }
72+ } ) ;
73+ const result = await statement . fetchResult ( ) ;
74+ expect ( result . query_id ) . toBeTruthy ( ) ;
75+ } ) ;
6376 it ( "returns Date type" , async ( ) => {
6477 const firebolt = Firebolt ( {
6578 apiEndpoint : process . env . FIREBOLT_API_ENDPOINT as string
You can’t perform that action at this time.
0 commit comments