Skip to content

Commit 6b7aff6

Browse files
authored
feat(duckdb-driver): pass Cube user agent
1 parent b4deacd commit 6b7aff6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,12 @@ export class DuckDBDriver extends BaseDriver implements DriverInterface {
5858
protected async init(): Promise<InitPromise> {
5959
const token = getEnv('duckdbMotherDuckToken', this.config);
6060

61-
const db = new Database(token ? `md:?motherduck_token=${token}&custom_user_agent=Cube/${version}` : ':memory:');
61+
const db = new Database(
62+
token ? `md:?motherduck_token=${token}&custom_user_agent=Cube/${version}` : ':memory:',
63+
{
64+
custom_user_agent: `Cube/${version}`,
65+
}
66+
);
6267
// Under the hood all methods of Database uses internal default connection, but there is no way to expose it
6368
const defaultConnection = db.connect();
6469
const execAsync: (sql: string, ...params: any[]) => Promise<void> = promisify(defaultConnection.exec).bind(defaultConnection) as any;

0 commit comments

Comments
 (0)