@malloydata/db-duckdb 0.0.102-dev231115031800 → 0.0.102-dev231115164346

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.
@@ -67,15 +67,10 @@ class DuckDBConnection extends duckdb_common_1.DuckDBCommon {
67
67
  if (this.workingDirectory) {
68
68
  await this.runDuckDBQuery(`SET FILE_SEARCH_PATH='${this.workingDirectory}'`);
69
69
  }
70
- const setupCmds = [
71
- "INSTALL 'json'",
72
- "LOAD 'json'",
73
- "INSTALL 'httpfs'",
74
- "LOAD 'httpfs'",
75
- "INSTALL 'icu'",
76
- "LOAD 'icu'",
77
- "SET TimeZone='UTC'",
78
- ];
70
+ for (const ext of ['json', 'httpfs', 'icu']) {
71
+ await this.loadExtension(ext);
72
+ }
73
+ const setupCmds = ["SET TimeZone='UTC'"];
79
74
  for (const cmd of setupCmds) {
80
75
  try {
81
76
  await this.runDuckDBQuery(cmd);
@@ -100,6 +95,12 @@ class DuckDBConnection extends duckdb_common_1.DuckDBCommon {
100
95
  reject(err);
101
96
  }
102
97
  else {
98
+ rows = JSON.parse(JSON.stringify(rows, (_key, value) => {
99
+ if (typeof value === 'bigint') {
100
+ return Number(value);
101
+ }
102
+ return value;
103
+ }));
103
104
  resolve({
104
105
  rows,
105
106
  totalRows: rows.length,
@@ -184,6 +184,16 @@ class DuckDBWASMConnection extends duckdb_common_1.DuckDBCommon {
184
184
  // for (const ext of ['json', 'httpfs', 'icu']) {
185
185
  // await this.loadExtension(ext);
186
186
  // }
187
+ const setupCmds = ["SET TimeZone='UTC'"];
188
+ for (const cmd of setupCmds) {
189
+ try {
190
+ await this.runDuckDBQuery(cmd);
191
+ }
192
+ catch (error) {
193
+ // eslint-disable-next-line no-console
194
+ console.error(`duckdb setup ${cmd} => ${error}`);
195
+ }
196
+ }
187
197
  };
188
198
  await this.connecting;
189
199
  if (!this.isSetup) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/db-duckdb",
3
- "version": "0.0.102-dev231115031800",
3
+ "version": "0.0.102-dev231115164346",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -40,11 +40,11 @@
40
40
  "prepublishOnly": "npm run build"
41
41
  },
42
42
  "dependencies": {
43
- "@malloydata/duckdb-wasm": "0.0.2-rev3",
44
- "@malloydata/malloy": "^0.0.102-dev231115031800",
45
- "@malloydata/malloy-interfaces": "^0.0.102-dev231115031800",
46
- "apache-arrow": "^11.0.0",
47
- "duckdb": "0.8.1",
43
+ "@malloydata/duckdb-wasm": "0.0.6",
44
+ "@malloydata/malloy": "^0.0.102-dev231115164346",
45
+ "@malloydata/malloy-interfaces": "^0.0.102-dev231115164346",
46
+ "apache-arrow": "^13.0.0",
47
+ "duckdb": "0.9.2",
48
48
  "web-worker": "^1.2.0"
49
49
  }
50
50
  }