@@ -430,7 +430,7 @@ export class SnowflakeDriver extends BaseDriver implements DriverInterface {
430430 if ( ! options . query ) {
431431 throw new Error ( 'Unload query is missed.' ) ;
432432 } else {
433- const types = await this . queryColumnTypes ( options . query . sql ) ;
433+ const types = await this . queryColumnTypes ( options . query . sql , options . query . params ) ;
434434 const connection = await this . getConnection ( ) ;
435435 const { bucketType, bucketName } =
436436 < SnowflakeDriverExportBucket > this . config . exportBucket ;
@@ -441,7 +441,7 @@ export class SnowflakeDriver extends BaseDriver implements DriverInterface {
441441 const result = await this . execute < UnloadResponse [ ] > (
442442 connection ,
443443 unloadSql ,
444- [ ] ,
444+ options . query . params ,
445445 false ,
446446 ) ;
447447 if ( ! result ) {
@@ -454,11 +454,11 @@ export class SnowflakeDriver extends BaseDriver implements DriverInterface {
454454 /**
455455 * Returns an array of queried fields meta info.
456456 */
457- public async queryColumnTypes ( sql : string ) : Promise < TableStructure > {
457+ public async queryColumnTypes ( sql : string , params ?: unknown [ ] ) : Promise < TableStructure > {
458458 const connection = await this . getConnection ( ) ;
459459 return new Promise ( ( resolve , reject ) => connection . execute ( {
460460 sqlText : `${ sql } LIMIT 0` ,
461- binds : [ ] ,
461+ binds : < string [ ] | undefined > params ,
462462 fetchAsString : [ 'Number' ] ,
463463 complete : ( err , stmt ) => {
464464 if ( err ) {
0 commit comments