Skip to content

Commit

Permalink
Update ClickHouseDriver.ts
Browse files Browse the repository at this point in the history
Add possibility to override username and password from driver config
  • Loading branch information
danieljaniga authored Jan 9, 2025
1 parent 4bdd149 commit 067854b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/cubejs-clickhouse-driver/src/ClickHouseDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ export class ClickHouseDriver extends BaseDriver implements DriverInterface {
const protocol = config.protocol ?? getEnv('dbSsl', { dataSource }) ? 'https:' : 'http:';
const url = `${protocol}//${host}:${port}`;

const username = getEnv('dbUser', { dataSource });
const password = getEnv('dbPass', { dataSource });
const username = config.username ?? getEnv('dbUser', { dataSource });
const password = config.password ?? getEnv('dbPass', { dataSource });
const database = config.database ?? (getEnv('dbName', { dataSource }) as string) ?? 'default';

// TODO this is a bit inconsistent with readOnly
Expand Down

0 comments on commit 067854b

Please sign in to comment.