Skip to content

Commit 067854b

Browse files
authored
Update ClickHouseDriver.ts
Add possibility to override username and password from driver config
1 parent 4bdd149 commit 067854b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/cubejs-clickhouse-driver/src/ClickHouseDriver.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ export class ClickHouseDriver extends BaseDriver implements DriverInterface {
145145
const protocol = config.protocol ?? getEnv('dbSsl', { dataSource }) ? 'https:' : 'http:';
146146
const url = `${protocol}//${host}:${port}`;
147147

148-
const username = getEnv('dbUser', { dataSource });
149-
const password = getEnv('dbPass', { dataSource });
148+
const username = config.username ?? getEnv('dbUser', { dataSource });
149+
const password = config.password ?? getEnv('dbPass', { dataSource });
150150
const database = config.database ?? (getEnv('dbName', { dataSource }) as string) ?? 'default';
151151

152152
// TODO this is a bit inconsistent with readOnly

0 commit comments

Comments
 (0)