File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
packages/cubejs-duckdb-driver/src Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ import { Connection, Database } from 'duckdb';
1414import { DuckDBQuery } from './DuckDBQuery' ;
1515import { HydrationStream , transformRow } from './HydrationStream' ;
1616
17+ const { version } = require ( '../../package.json' ) ;
18+
1719export type DuckDBDriverConfiguration = {
1820 dataSource ?: string ,
1921 initSql ?: string ,
@@ -55,8 +57,8 @@ export class DuckDBDriver extends BaseDriver implements DriverInterface {
5557
5658 protected async init ( ) : Promise < InitPromise > {
5759 const token = getEnv ( 'duckdbMotherDuckToken' , this . config ) ;
58-
59- const db = new Database ( token ? `md:?motherduck_token=${ token } ` : ':memory:' ) ;
60+
61+ const db = new Database ( token ? `md:?motherduck_token=${ token } &custom_user_agent=Cube/ ${ version } ` : ':memory:' ) ;
6062 // Under the hood all methods of Database uses internal default connection, but there is no way to expose it
6163 const defaultConnection = db . connect ( ) ;
6264 const execAsync : ( sql : string , ...params : any [ ] ) => Promise < void > = promisify ( defaultConnection . exec ) . bind ( defaultConnection ) as any ;
You can’t perform that action at this time.
0 commit comments