@malloydata/db-duckdb 0.0.176-dev240827153920 → 0.0.176
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/duckdb_connection.js +9 -10
- package/package.json +2 -2
|
@@ -29,6 +29,7 @@ exports.DuckDBConnection = void 0;
|
|
|
29
29
|
const crypto_1 = __importDefault(require("crypto"));
|
|
30
30
|
const duckdb_common_1 = require("./duckdb_common");
|
|
31
31
|
const duckdb_1 = require("duckdb");
|
|
32
|
+
const package_json_1 = __importDefault(require("@malloydata/malloy/package.json"));
|
|
32
33
|
class DuckDBConnection extends duckdb_common_1.DuckDBCommon {
|
|
33
34
|
constructor(arg, arg2, workingDirectory, queryOptions) {
|
|
34
35
|
super();
|
|
@@ -87,6 +88,9 @@ class DuckDBConnection extends duckdb_common_1.DuckDBCommon {
|
|
|
87
88
|
resolve();
|
|
88
89
|
}
|
|
89
90
|
else {
|
|
91
|
+
const config = {
|
|
92
|
+
'custom_user_agent': `Malloy/${package_json_1.default.version}`,
|
|
93
|
+
};
|
|
90
94
|
if (this.isMotherDuck) {
|
|
91
95
|
if (!this.motherDuckToken &&
|
|
92
96
|
!process.env['motherduck_token'] &&
|
|
@@ -96,18 +100,13 @@ class DuckDBConnection extends duckdb_common_1.DuckDBCommon {
|
|
|
96
100
|
return resolve();
|
|
97
101
|
}
|
|
98
102
|
if (this.motherDuckToken) {
|
|
99
|
-
|
|
100
|
-
const dbUrl = new URL(this.databasePath);
|
|
101
|
-
dbUrl.searchParams.set('motherduck_token', this.motherDuckToken);
|
|
102
|
-
this.databasePath = dbUrl.toString();
|
|
103
|
-
}
|
|
104
|
-
catch {
|
|
105
|
-
// eslint-disable-next-line no-console
|
|
106
|
-
console.warn('Unable to update MotherDuck URL with token');
|
|
107
|
-
}
|
|
103
|
+
config['motherduck_token'] = this.motherDuckToken;
|
|
108
104
|
}
|
|
109
105
|
}
|
|
110
|
-
|
|
106
|
+
if (this.readOnly) {
|
|
107
|
+
config['access_mode'] = 'read_only';
|
|
108
|
+
}
|
|
109
|
+
const database = new duckdb_1.Database(this.databasePath, config, err => {
|
|
111
110
|
if (err) {
|
|
112
111
|
this.setupError = err;
|
|
113
112
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@malloydata/db-duckdb",
|
|
3
|
-
"version": "0.0.176
|
|
3
|
+
"version": "0.0.176",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@duckdb/duckdb-wasm": "1.28.1-dev242.0",
|
|
44
|
-
"@malloydata/malloy": "^0.0.176
|
|
44
|
+
"@malloydata/malloy": "^0.0.176",
|
|
45
45
|
"@motherduck/wasm-client": "^0.6.3",
|
|
46
46
|
"apache-arrow": "^16.0.0",
|
|
47
47
|
"duckdb": "1.0.0",
|