[@ciq-dev/ciq-node-utils](../README.md) › [Globals](../globals.md) › ["src/snowflake/snowflake-executor"](_src_snowflake_snowflake_executor_.md)

# Module: "src/snowflake/snowflake-executor"

## Index

### Functions

* [createConnectionAndExectue](_src_snowflake_snowflake_executor_.md#const-createconnectionandexectue)
* [snowFlakeExecute](_src_snowflake_snowflake_executor_.md#snowflakeexecute)
* [snowflakeExecuteForMultiClients](_src_snowflake_snowflake_executor_.md#const-snowflakeexecuteformulticlients)
* [snowflakeParallelQueriesRunner](_src_snowflake_snowflake_executor_.md#const-snowflakeparallelqueriesrunner)

## Functions

### `Const` createConnectionAndExectue

▸ **createConnectionAndExectue**(`client`: string, `query`: string, `callback?`: Function): *Promise‹object›*

Defined in src/snowflake/snowflake-executor.ts:35

It will create connection and disconnect after exectuing the query

**`stable`** 

**`async`** 

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`client` | string | - |
`query` | string | - |
`callback?` | Function |   |

**Returns:** *Promise‹object›*

___

###  snowFlakeExecute

▸ **snowFlakeExecute**(`connection`: any, `query`: String): *Promise‹unknown›*

Defined in src/snowflake/snowflake-executor.ts:13

It will exectue the query on the given connection

**`note`** It will NOT disconnect

**`stable`** 

**`async`** 

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`connection` | any | - |
`query` | String |   |

**Returns:** *Promise‹unknown›*

___

### `Const` snowflakeExecuteForMultiClients

▸ **snowflakeExecuteForMultiClients**(`clientsArray`: Array‹string›, `query`: string, `callback?`: Function): *Promise‹Promise‹any›[]›*

Defined in src/snowflake/snowflake-executor.ts:55

Will accept list of client array and execute for all the clients by creating a seprate connection in parallel, callback will be called after each query execution for each client
This callback calls with (client, query, result) so that you process the data as in when it is getting exectued.

**`stable`** 

**`async`** 

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`clientsArray` | Array‹string› | - |
`query` | string | - |
`callback?` | Function |   |

**Returns:** *Promise‹Promise‹any›[]›*

___

### `Const` snowflakeParallelQueriesRunner

▸ **snowflakeParallelQueriesRunner**(`connection`: any, `queries`: Array‹string›): *Promise‹any[]›*

Defined in src/snowflake/snowflake-executor.ts:70

This will run queries on the same connection in parallel and return array of promises

**`stable`** 

**`async`** 

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`connection` | any | - |
`queries` | Array‹string› |   |

**Returns:** *Promise‹any[]›*
