From 26c765b6e02fd7ebddd7d387f705fc7da19921c0 Mon Sep 17 00:00:00 2001 From: johancube Date: Fri, 1 Nov 2024 19:20:22 +0300 Subject: [PATCH] feat(snowflake-driver): host env variable (#8898) --- packages/cubejs-backend-shared/src/env.ts | 13 +++++++++++++ .../cubejs-snowflake-driver/src/SnowflakeDriver.ts | 2 ++ 2 files changed, 15 insertions(+) diff --git a/packages/cubejs-backend-shared/src/env.ts b/packages/cubejs-backend-shared/src/env.ts index 2940fabf1beeb..3d85a197b7add 100644 --- a/packages/cubejs-backend-shared/src/env.ts +++ b/packages/cubejs-backend-shared/src/env.ts @@ -1426,6 +1426,19 @@ const variables: Record any> = { ] ), + /** + * Snowflake host. + */ + snowflakeHost: ({ + dataSource + }: { + dataSource: string, + }) => ( + process.env[ + keyByDataSource('CUBEJS_DB_SNOWFLAKE_HOST', dataSource) + ] + ), + /** * Snowflake private key. */ diff --git a/packages/cubejs-snowflake-driver/src/SnowflakeDriver.ts b/packages/cubejs-snowflake-driver/src/SnowflakeDriver.ts index 8a4b893ef37dc..ccf19191fa980 100644 --- a/packages/cubejs-snowflake-driver/src/SnowflakeDriver.ts +++ b/packages/cubejs-snowflake-driver/src/SnowflakeDriver.ts @@ -155,6 +155,7 @@ export type SnowflakeDriverExportBucket = SnowflakeDriverExportAWS | SnowflakeDr | SnowflakeDriverExportAzure; interface SnowflakeDriverOptions { + host?: string, account: string, username: string, password: string, @@ -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 }),