@malloydata/db-duckdb 0.0.29-dev230329215340 → 0.0.29-dev230330180545
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.d.ts +1 -0
- package/dist/duckdb_connection.js +12 -15
- package/dist/duckdb_wasm_connection.d.ts +1 -1
- package/dist/duckdb_wasm_connection.js +1 -1
- package/dist/duckdb_wasm_connection_browser.d.ts +1 -1
- package/dist/duckdb_wasm_connection_browser.js +1 -1
- package/dist/duckdb_wasm_connection_node.d.ts +1 -1
- package/dist/duckdb_wasm_connection_node.js +3 -3
- package/package.json +3 -3
|
@@ -11,6 +11,7 @@ export declare class DuckDBConnection extends DuckDBCommon {
|
|
|
11
11
|
protected isSetup: Promise<void> | undefined;
|
|
12
12
|
constructor(name: string, databasePath?: string, workingDirectory?: string, queryOptions?: QueryOptionsReader);
|
|
13
13
|
private init;
|
|
14
|
+
loadExtension(ext: string): Promise<void>;
|
|
14
15
|
protected setup(): Promise<void>;
|
|
15
16
|
protected runDuckDBQuery(sql: string): Promise<{
|
|
16
17
|
rows: Row[];
|
|
@@ -52,26 +52,23 @@ class DuckDBConnection extends duckdb_common_1.DuckDBCommon {
|
|
|
52
52
|
resolve();
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
+
async loadExtension(ext) {
|
|
56
|
+
try {
|
|
57
|
+
await this.runDuckDBQuery(`INSTALL '${ext}'`);
|
|
58
|
+
await this.runDuckDBQuery(`LOAD '${ext}'`);
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
// eslint-disable-next-line no-console
|
|
62
|
+
console.error('Unable to load ${ext} extension', error);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
55
65
|
async setup() {
|
|
56
66
|
const doSetup = async () => {
|
|
57
67
|
if (this.workingDirectory) {
|
|
58
68
|
await this.runDuckDBQuery(`SET FILE_SEARCH_PATH='${this.workingDirectory}'`);
|
|
59
69
|
}
|
|
60
|
-
|
|
61
|
-
await this.
|
|
62
|
-
await this.runDuckDBQuery("LOAD 'json'");
|
|
63
|
-
}
|
|
64
|
-
catch (error) {
|
|
65
|
-
// eslint-disable-next-line no-console
|
|
66
|
-
console.error('Unable to load json extension', error);
|
|
67
|
-
}
|
|
68
|
-
try {
|
|
69
|
-
await this.runDuckDBQuery("INSTALL 'httpfs'");
|
|
70
|
-
await this.runDuckDBQuery("LOAD 'httpfs'");
|
|
71
|
-
}
|
|
72
|
-
catch (error) {
|
|
73
|
-
// eslint-disable-next-line no-console
|
|
74
|
-
console.error('Unable to load httpfs extension', error);
|
|
70
|
+
for (const ext of ['json', 'httpfs', 'icu']) {
|
|
71
|
+
await this.loadExtension(ext);
|
|
75
72
|
}
|
|
76
73
|
};
|
|
77
74
|
await this.connecting;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as duckdb from '@
|
|
1
|
+
import * as duckdb from '@malloydata/duckdb-wasm';
|
|
2
2
|
import { QueryDataRow, RunSQLOptions, StructDef } from '@malloydata/malloy';
|
|
3
3
|
import { DuckDBCommon, QueryOptionsReader } from './duckdb_common';
|
|
4
4
|
declare type RemoteFileCallback = (tableName: string) => Promise<Uint8Array | undefined>;
|
|
@@ -49,7 +49,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
49
49
|
};
|
|
50
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
51
|
exports.DuckDBWASMConnection = void 0;
|
|
52
|
-
const duckdb = __importStar(require("@
|
|
52
|
+
const duckdb = __importStar(require("@malloydata/duckdb-wasm"));
|
|
53
53
|
const web_worker_1 = __importDefault(require("web-worker"));
|
|
54
54
|
const malloy_1 = require("@malloydata/malloy");
|
|
55
55
|
const apache_arrow_1 = require("apache-arrow");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as duckdb from '@
|
|
1
|
+
import * as duckdb from '@malloydata/duckdb-wasm';
|
|
2
2
|
import { DuckDBWASMConnection as DuckDBWASMConnectionBase } from './duckdb_wasm_connection';
|
|
3
3
|
export declare class DuckDBWASMConnection extends DuckDBWASMConnectionBase {
|
|
4
4
|
getBundles(): duckdb.DuckDBBundles;
|
|
@@ -46,7 +46,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
46
46
|
};
|
|
47
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
48
|
exports.DuckDBWASMConnection = void 0;
|
|
49
|
-
const duckdb = __importStar(require("@
|
|
49
|
+
const duckdb = __importStar(require("@malloydata/duckdb-wasm"));
|
|
50
50
|
const duckdb_wasm_connection_1 = require("./duckdb_wasm_connection");
|
|
51
51
|
class DuckDBWASMConnection extends duckdb_wasm_connection_1.DuckDBWASMConnection {
|
|
52
52
|
getBundles() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DuckDBBundles } from '@
|
|
1
|
+
import { DuckDBBundles } from '@malloydata/duckdb-wasm';
|
|
2
2
|
import { DuckDBWASMConnection as DuckDBWASMConnectionBase } from './duckdb_wasm_connection';
|
|
3
3
|
export declare class DuckDBWASMConnection extends DuckDBWASMConnectionBase {
|
|
4
4
|
getBundles(): DuckDBBundles;
|
|
@@ -30,13 +30,13 @@ const crypto_1 = __importDefault(require("crypto"));
|
|
|
30
30
|
const duckdb_wasm_connection_1 = require("./duckdb_wasm_connection");
|
|
31
31
|
class DuckDBWASMConnection extends duckdb_wasm_connection_1.DuckDBWASMConnection {
|
|
32
32
|
getBundles() {
|
|
33
|
-
const resolvePath = require.resolve('@
|
|
33
|
+
const resolvePath = require.resolve('@malloydata/duckdb-wasm');
|
|
34
34
|
if (!resolvePath) {
|
|
35
|
-
throw new Error('Unable to resolve @
|
|
35
|
+
throw new Error('Unable to resolve @malloydata/duckdb-wasm path');
|
|
36
36
|
}
|
|
37
37
|
const distMatch = resolvePath.match(/^.*\/dist\//);
|
|
38
38
|
if (!distMatch) {
|
|
39
|
-
throw new Error('Unable to resolve @
|
|
39
|
+
throw new Error('Unable to resolve @malloydata/duckdb-wasm dist path');
|
|
40
40
|
}
|
|
41
41
|
const dist = distMatch[0];
|
|
42
42
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@malloydata/db-duckdb",
|
|
3
|
-
"version": "0.0.29-
|
|
3
|
+
"version": "0.0.29-dev230330180545",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"prepublishOnly": "npm run build"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@
|
|
44
|
-
"@malloydata/malloy": "^0.0.29-
|
|
43
|
+
"@malloydata/duckdb-wasm": "0.0.1",
|
|
44
|
+
"@malloydata/malloy": "^0.0.29-dev230330180545",
|
|
45
45
|
"apache-arrow": "^11.0.0",
|
|
46
46
|
"duckdb": "0.7.1",
|
|
47
47
|
"web-worker": "^1.2.0"
|