@@ -30,6 +30,7 @@ export type FireboltDriverConfiguration = {
3030 readOnly ?: boolean ;
3131 apiEndpoint ?: string ;
3232 connection : ConnectionOptions ;
33+ requestTimeout : number ;
3334} ;
3435
3536const FireboltTypeToGeneric : Record < string , string > = {
@@ -91,6 +92,7 @@ export class FireboltDriver extends BaseDriver implements DriverInterface {
9192
9293 this . config = {
9394 readOnly : true ,
95+ requestTimeout : getEnv ( 'dbQueryTimeout' ) * 1000 ,
9496 apiEndpoint :
9597 getEnv ( 'fireboltApiEndpoint' , { dataSource } ) || 'api.app.firebolt.io' ,
9698 ...config ,
@@ -225,7 +227,7 @@ export class FireboltDriver extends BaseDriver implements DriverInterface {
225227 const connection = await this . getConnection ( ) ;
226228
227229 const statement = await connection . execute ( query , {
228- settings : { output_format : OutputFormat . JSON } ,
230+ settings : { output_format : OutputFormat . JSON , statement_timeout : this . config . requestTimeout } ,
229231 parameters,
230232 response : { hydrateRow : this . hydrateRow }
231233 } ) ;
@@ -275,7 +277,7 @@ export class FireboltDriver extends BaseDriver implements DriverInterface {
275277 const connection = await this . getConnection ( ) ;
276278
277279 const statement = await connection . execute ( query , {
278- settings : { output_format : OutputFormat . JSON } ,
280+ settings : { output_format : OutputFormat . JSON , statement_timeout : this . config . requestTimeout } ,
279281 parameters,
280282 response : { hydrateRow : this . hydrateRow }
281283 } ) ;
0 commit comments