Skip to content

Commit

Permalink
feat(snowflake-driver): host env variable (#8898)
Browse files Browse the repository at this point in the history
  • Loading branch information
johancube authored Nov 1, 2024
1 parent 5827244 commit 26c765b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/cubejs-backend-shared/src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1426,6 +1426,19 @@ const variables: Record<string, (...args: any) => any> = {
]
),

/**
* Snowflake host.
*/
snowflakeHost: ({
dataSource
}: {
dataSource: string,
}) => (
process.env[
keyByDataSource('CUBEJS_DB_SNOWFLAKE_HOST', dataSource)
]
),

/**
* Snowflake private key.
*/
Expand Down
2 changes: 2 additions & 0 deletions packages/cubejs-snowflake-driver/src/SnowflakeDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ export type SnowflakeDriverExportBucket = SnowflakeDriverExportAWS | SnowflakeDr
| SnowflakeDriverExportAzure;

interface SnowflakeDriverOptions {
host?: string,
account: string,
username: string,
password: string,
Expand Down Expand Up @@ -261,6 +262,7 @@ export class SnowflakeDriver extends BaseDriver implements DriverInterface {

this.config = {
readOnly: false,
host: getEnv('snowflakeHost', { dataSource }),
account: getEnv('snowflakeAccount', { dataSource }),
region: getEnv('snowflakeRegion', { dataSource }),
warehouse: getEnv('snowflakeWarehouse', { dataSource }),
Expand Down

0 comments on commit 26c765b

Please sign in to comment.