@malloydata/db-duckdb 0.0.361 → 0.0.362
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/browser.d.ts +1 -0
- package/dist/browser.js +41 -0
- package/dist/duckdb_wasm_connection.d.ts +1 -1
- package/dist/index.js +0 -64
- package/dist/native.d.ts +1 -0
- package/dist/native.js +71 -0
- package/package.json +16 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/browser.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Contributors to the Malloy project
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const malloy_1 = require("@malloydata/malloy");
|
|
8
|
+
const duckdb_wasm_connection_browser_1 = require("./duckdb_wasm_connection_browser");
|
|
9
|
+
(0, malloy_1.registerConnectionType)('duckdb_wasm', {
|
|
10
|
+
displayName: 'DuckDB',
|
|
11
|
+
factory: async (config) => new duckdb_wasm_connection_browser_1.DuckDBWASMConnection(config),
|
|
12
|
+
properties: [
|
|
13
|
+
{
|
|
14
|
+
name: 'databasePath',
|
|
15
|
+
displayName: 'Database Path',
|
|
16
|
+
type: 'string',
|
|
17
|
+
optional: true,
|
|
18
|
+
default: ':memory:',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'workingDirectory',
|
|
22
|
+
displayName: 'Working Directory',
|
|
23
|
+
type: 'string',
|
|
24
|
+
optional: true,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'motherDuckToken',
|
|
28
|
+
displayName: 'MotherDuck Token',
|
|
29
|
+
type: 'secret',
|
|
30
|
+
optional: true,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'setupSQL',
|
|
34
|
+
displayName: 'Setup SQL',
|
|
35
|
+
type: 'text',
|
|
36
|
+
optional: true,
|
|
37
|
+
description: 'SQL statements to run when the connection is established',
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
});
|
|
41
|
+
//# sourceMappingURL=browser.js.map
|
|
@@ -5,7 +5,7 @@ type RemoteFileCallback = (tableName: string) => Promise<Uint8Array | undefined>
|
|
|
5
5
|
export interface DuckDBWasmOptions extends ConnectionConfig {
|
|
6
6
|
additionalExtensions?: string[];
|
|
7
7
|
databasePath?: string;
|
|
8
|
-
motherDuckToken
|
|
8
|
+
motherDuckToken?: string;
|
|
9
9
|
workingDirectory?: string;
|
|
10
10
|
setupSQL?: string;
|
|
11
11
|
}
|
package/dist/index.js
CHANGED
|
@@ -25,68 +25,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
25
25
|
exports.DuckDBConnection = void 0;
|
|
26
26
|
var duckdb_connection_1 = require("./duckdb_connection");
|
|
27
27
|
Object.defineProperty(exports, "DuckDBConnection", { enumerable: true, get: function () { return duckdb_connection_1.DuckDBConnection; } });
|
|
28
|
-
const malloy_1 = require("@malloydata/malloy");
|
|
29
|
-
const duckdb_connection_2 = require("./duckdb_connection");
|
|
30
|
-
(0, malloy_1.registerConnectionType)('duckdb', {
|
|
31
|
-
displayName: 'DuckDB',
|
|
32
|
-
factory: async (config) => {
|
|
33
|
-
const options = { ...config };
|
|
34
|
-
// Map user-friendly "path" to the constructor's "databasePath"
|
|
35
|
-
if ('path' in options && !('databasePath' in options)) {
|
|
36
|
-
options['databasePath'] = options['path'];
|
|
37
|
-
delete options['path'];
|
|
38
|
-
}
|
|
39
|
-
// Parse comma-separated extensions string into array
|
|
40
|
-
if (typeof options['additionalExtensions'] === 'string') {
|
|
41
|
-
options['additionalExtensions'] = options['additionalExtensions']
|
|
42
|
-
.split(',')
|
|
43
|
-
.map(s => s.trim())
|
|
44
|
-
.filter(s => s.length > 0);
|
|
45
|
-
}
|
|
46
|
-
return new duckdb_connection_2.DuckDBConnection(options);
|
|
47
|
-
},
|
|
48
|
-
properties: [
|
|
49
|
-
{
|
|
50
|
-
name: 'databasePath',
|
|
51
|
-
displayName: 'Database Path',
|
|
52
|
-
type: 'file',
|
|
53
|
-
optional: true,
|
|
54
|
-
default: ':memory:',
|
|
55
|
-
fileFilters: { DuckDB: ['db', 'duckdb', 'ddb'] },
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
name: 'workingDirectory',
|
|
59
|
-
displayName: 'Working Directory',
|
|
60
|
-
type: 'string',
|
|
61
|
-
optional: true,
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
name: 'motherDuckToken',
|
|
65
|
-
displayName: 'MotherDuck Token',
|
|
66
|
-
type: 'secret',
|
|
67
|
-
optional: true,
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
name: 'additionalExtensions',
|
|
71
|
-
displayName: 'Additional Extensions',
|
|
72
|
-
type: 'string',
|
|
73
|
-
optional: true,
|
|
74
|
-
description: 'Comma-separated list of DuckDB extensions to load (e.g. "spatial,fts"). ' +
|
|
75
|
-
'These are loaded in addition to the built-in extensions: json, httpfs, icu.',
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
name: 'readOnly',
|
|
79
|
-
displayName: 'Read Only',
|
|
80
|
-
type: 'boolean',
|
|
81
|
-
optional: true,
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
name: 'setupSQL',
|
|
85
|
-
displayName: 'Setup SQL',
|
|
86
|
-
type: 'text',
|
|
87
|
-
optional: true,
|
|
88
|
-
description: 'SQL statements to run when the connection is established',
|
|
89
|
-
},
|
|
90
|
-
],
|
|
91
|
-
});
|
|
92
28
|
//# sourceMappingURL=index.js.map
|
package/dist/native.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/native.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Contributors to the Malloy project
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const malloy_1 = require("@malloydata/malloy");
|
|
8
|
+
const duckdb_connection_1 = require("./duckdb_connection");
|
|
9
|
+
(0, malloy_1.registerConnectionType)('duckdb', {
|
|
10
|
+
displayName: 'DuckDB',
|
|
11
|
+
factory: async (config) => {
|
|
12
|
+
const options = { ...config };
|
|
13
|
+
// Map user-friendly "path" to the constructor's "databasePath"
|
|
14
|
+
if ('path' in options && !('databasePath' in options)) {
|
|
15
|
+
options['databasePath'] = options['path'];
|
|
16
|
+
delete options['path'];
|
|
17
|
+
}
|
|
18
|
+
// Parse comma-separated extensions string into array
|
|
19
|
+
if (typeof options['additionalExtensions'] === 'string') {
|
|
20
|
+
options['additionalExtensions'] = options['additionalExtensions']
|
|
21
|
+
.split(',')
|
|
22
|
+
.map(s => s.trim())
|
|
23
|
+
.filter(s => s.length > 0);
|
|
24
|
+
}
|
|
25
|
+
return new duckdb_connection_1.DuckDBConnection(options);
|
|
26
|
+
},
|
|
27
|
+
properties: [
|
|
28
|
+
{
|
|
29
|
+
name: 'databasePath',
|
|
30
|
+
displayName: 'Database Path',
|
|
31
|
+
type: 'file',
|
|
32
|
+
optional: true,
|
|
33
|
+
default: ':memory:',
|
|
34
|
+
fileFilters: { DuckDB: ['db', 'duckdb', 'ddb'] },
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'workingDirectory',
|
|
38
|
+
displayName: 'Working Directory',
|
|
39
|
+
type: 'string',
|
|
40
|
+
optional: true,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'motherDuckToken',
|
|
44
|
+
displayName: 'MotherDuck Token',
|
|
45
|
+
type: 'secret',
|
|
46
|
+
optional: true,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'additionalExtensions',
|
|
50
|
+
displayName: 'Additional Extensions',
|
|
51
|
+
type: 'string',
|
|
52
|
+
optional: true,
|
|
53
|
+
description: 'Comma-separated list of DuckDB extensions to load (e.g. "spatial,fts"). ' +
|
|
54
|
+
'These are loaded in addition to the built-in extensions: json, httpfs, icu.',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'readOnly',
|
|
58
|
+
displayName: 'Read Only',
|
|
59
|
+
type: 'boolean',
|
|
60
|
+
optional: true,
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'setupSQL',
|
|
64
|
+
displayName: 'Setup SQL',
|
|
65
|
+
type: 'text',
|
|
66
|
+
optional: true,
|
|
67
|
+
description: 'SQL statements to run when the connection is established',
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
});
|
|
71
|
+
//# sourceMappingURL=native.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@malloydata/db-duckdb",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.362",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -13,6 +13,14 @@
|
|
|
13
13
|
"default": "./dist/index.js"
|
|
14
14
|
},
|
|
15
15
|
"./package.json": "./package.json",
|
|
16
|
+
"./native": {
|
|
17
|
+
"types": "./dist/native.d.ts",
|
|
18
|
+
"default": "./dist/native.js"
|
|
19
|
+
},
|
|
20
|
+
"./browser": {
|
|
21
|
+
"types": "./dist/browser.d.ts",
|
|
22
|
+
"default": "./dist/browser.js"
|
|
23
|
+
},
|
|
16
24
|
"./wasm": {
|
|
17
25
|
"browser": "./dist/duckdb_wasm_connection_browser.js",
|
|
18
26
|
"node": "./dist/duckdb_wasm_connection_node.js",
|
|
@@ -24,6 +32,12 @@
|
|
|
24
32
|
"index": [
|
|
25
33
|
"./dist/index.d.ts"
|
|
26
34
|
],
|
|
35
|
+
"native": [
|
|
36
|
+
"./dist/native.d.ts"
|
|
37
|
+
],
|
|
38
|
+
"browser": [
|
|
39
|
+
"./dist/browser.d.ts"
|
|
40
|
+
],
|
|
27
41
|
"wasm": [
|
|
28
42
|
"./dist/duckdb_wasm_connection_browser.d.ts"
|
|
29
43
|
]
|
|
@@ -46,7 +60,7 @@
|
|
|
46
60
|
"dependencies": {
|
|
47
61
|
"@duckdb/duckdb-wasm": "1.33.1-dev13.0",
|
|
48
62
|
"@duckdb/node-api": "1.4.4-r.1",
|
|
49
|
-
"@malloydata/malloy": "0.0.
|
|
63
|
+
"@malloydata/malloy": "0.0.362",
|
|
50
64
|
"@motherduck/wasm-client": "^0.6.6",
|
|
51
65
|
"apache-arrow": "^17.0.0",
|
|
52
66
|
"web-worker": "^1.3.0"
|