import { Snowflake } from "snowflake-promise" ; import { SnowflakeConnectionParams } from "../../types/integrations/snowflake" ; export async function runSnowflakeQuery < T > ( conn , sql , values = [ ] ) { const snowflake = new Snowflake ( { account : conn . account , username : conn . username , password : conn . password , database : conn . database , schema : conn . schema , warehouse : conn . warehouse , role : conn . role , } ) ; await snowflake . connect ( ) ; const res = await snowflake . execute ( sql , values ) ; const lowercase = [ ] ; res . forEach ( ( row ) => { const o = { } ; Object . keys ( row ) . forEach ( ( k ) => { o [ k . toLowerCase ( ) ] = row [ k ] ; } ) ; lowercase . push ( o ) ; } ) ; return lowercase ; }