Skip to content

Commit c5aa6cc

Browse files
authored
fix(clickhouse-driver): Support overriding Username & Password from Driver Config (#9085)
Add possibility to override username and password from driver config
1 parent a7cf544 commit c5aa6cc

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)