Skip to content

Commit 6f43138

Browse files
authored
feat(duckdb-driver): Add databasePath and motherDuckToken config options
1 parent 1fca9ee commit 6f43138

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/cubejs-duckdb-driver/src/DuckDBDriver.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ import { HydrationStream, transformRow } from './HydrationStream';
1717
const { version } = require('../../package.json');
1818

1919
export type DuckDBDriverConfiguration = {
20+
databasePath?: string,
2021
dataSource?: string,
2122
initSql?: string,
23+
motherDuckToken?: string,
2224
schema?: string,
2325
};
2426

@@ -56,8 +58,8 @@ export class DuckDBDriver extends BaseDriver implements DriverInterface {
5658
}
5759

5860
protected async init(): Promise<InitPromise> {
59-
const token = getEnv('duckdbMotherDuckToken', this.config);
60-
const dbPath = getEnv('duckdbDatabasePath', this.config);
61+
const token = this.config.motherDuckToken || getEnv('duckdbMotherDuckToken', this.config);
62+
const dbPath = this.config.databasePath || getEnv('duckdbDatabasePath', this.config);
6163

6264
// Determine the database URL based on the provided db_path or token
6365
let dbUrl: string;

0 commit comments

Comments
 (0)