@sqlrooms/motherduck 0.21.0 → 0.22.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WasmMotherDuckDbConnector.d.ts","sourceRoot":"","sources":["../src/WasmMotherDuckDbConnector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,kBAAkB,EAAC,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAGL,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAI1B,MAAM,MAAM,yBAAyB,GAAG,iBAAiB,CAAC;AAE1D,MAAM,MAAM,4BAA4B,GAAG;IACzC,IAAI,EAAE,yBAAyB,CAAC;CACjC,GAAG,gCAAgC,CAAC;AAErC,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,eAAe,GACzB,SAAS,IAAI,yBAAyB,CAExC;AAED,MAAM,WAAW,gCAAiC,SAAQ,kBAAkB;IAC1E,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,yBAA0B,SAAQ,eAAe;IAChE,aAAa,IAAI,YAAY,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;CAClC;AAED,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,gCAAgC,GACxC,yBAAyB,
|
|
1
|
+
{"version":3,"file":"WasmMotherDuckDbConnector.d.ts","sourceRoot":"","sources":["../src/WasmMotherDuckDbConnector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,kBAAkB,EAAC,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAGL,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAI1B,MAAM,MAAM,yBAAyB,GAAG,iBAAiB,CAAC;AAE1D,MAAM,MAAM,4BAA4B,GAAG;IACzC,IAAI,EAAE,yBAAyB,CAAC;CACjC,GAAG,gCAAgC,CAAC;AAErC,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,eAAe,GACzB,SAAS,IAAI,yBAAyB,CAExC;AAED,MAAM,WAAW,gCAAiC,SAAQ,kBAAkB;IAC1E,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,yBAA0B,SAAQ,eAAe;IAChE,aAAa,IAAI,YAAY,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;CAClC;AAED,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,gCAAgC,GACxC,yBAAyB,CAmE3B"}
|
|
@@ -11,9 +11,6 @@ export function createWasmMotherDuckDbConnector(options) {
|
|
|
11
11
|
async initializeInternal() {
|
|
12
12
|
connection = MDConnection.create(params);
|
|
13
13
|
await connection.isInitialized();
|
|
14
|
-
if (initializationQuery) {
|
|
15
|
-
await connection.evaluateQuery(initializationQuery);
|
|
16
|
-
}
|
|
17
14
|
},
|
|
18
15
|
async destroyInternal() {
|
|
19
16
|
if (connection) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WasmMotherDuckDbConnector.js","sourceRoot":"","sources":["../src/WasmMotherDuckDbConnector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAqB,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAEL,yBAAyB,GAE1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAStC,MAAM,UAAU,2BAA2B,CACzC,SAA0B;IAE1B,OAAQ,SAAiB,CAAC,IAAI,KAAK,iBAAiB,CAAC;AACvD,CAAC;AAWD,MAAM,UAAU,+BAA+B,CAC7C,OAAyC;IAEzC,MAAM,EAAC,mBAAmB,GAAG,EAAE,EAAE,GAAG,MAAM,EAAC,GAAG,OAAO,CAAC;IACtD,IAAI,UAAU,GAAwB,IAAI,CAAC;IAE3C,MAAM,IAAI,GAA4B;QACpC,KAAK,CAAC,kBAAkB;YACtB,UAAU,GAAG,YAAY,CAAC,MAAM,C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AM,MAAM,GAAG,MAAM,UAAU,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC;YAC9D,MAAM,OAAO,GAAG,IAAI,KAAK,EAAoB,CAAC;YAE9C,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;gBAC7C,sDAAsD;gBACtD,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;oBACnB,MAAM,IAAI,YAAY,CAAC,qBAAqB,EAAE,YAAY,CAAC,CAAC;gBAC9D,CAAC;gBACD,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACtB,CAAC;YAED,OAAO,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAClC,CAAC;QAED,KAAK,CAAC,mBAAmB,CAAC,OAAe;YACvC,6EAA6E;YAC7E,gGAAgG;QAClG,CAAC;KACF,CAAC;IAEF,MAAM,IAAI,GAAG,yBAAyB,CAAC,EAAC,mBAAmB,EAAC,EAAE,IAAI,CAAC,CAAC;IAEpE,OAAO;QACL,GAAG,IAAI;QACP,aAAa;YACX,IAAI,CAAC,UAAU,EAAE,CAAC;gBAChB,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;YAC3D,CAAC;YACD,OAAO,UAAU,CAAC;QACpB,CAAC;QACD,IAAI,IAAI;YACN,OAAO,iBAA0B,CAAC;QACpC,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import {MDConnection, MDConnectionParams} from '@motherduck/wasm-client';\nimport {\n BaseDuckDbConnectorImpl,\n createBaseDuckDbConnector,\n DuckDbConnector,\n} from '@sqlrooms/duckdb';\nimport * as arrow from 'apache-arrow';\nimport {RecordBatch} from 'apache-arrow';\n\nexport type MotherDuckDbConnectorType = 'wasm-motherduck';\n\nexport type MotherDuckDbConnectorOptions = {\n type: MotherDuckDbConnectorType;\n} & WasmMotherDuckDbConnectorOptions;\n\nexport function isWasmMotherDuckDbConnector(\n connector: DuckDbConnector,\n): connector is WasmMotherDuckDbConnector {\n return (connector as any).type === 'wasm-motherduck';\n}\n\nexport interface WasmMotherDuckDbConnectorOptions extends MDConnectionParams {\n initializationQuery?: string;\n}\n\nexport interface WasmMotherDuckDbConnector extends DuckDbConnector {\n getConnection(): MDConnection;\n readonly type: 'wasm-motherduck';\n}\n\nexport function createWasmMotherDuckDbConnector(\n options: WasmMotherDuckDbConnectorOptions,\n): WasmMotherDuckDbConnector {\n const {initializationQuery = '', ...params} = options;\n let connection: MDConnection | null = null;\n\n const impl: BaseDuckDbConnectorImpl = {\n async initializeInternal() {\n connection = MDConnection.create(params);\n await connection.isInitialized();\n },\n\n async destroyInternal() {\n if (connection) {\n await connection.close();\n connection = null;\n }\n },\n\n async executeQueryInternal(\n query: string,\n signal: AbortSignal,\n id: string,\n ): Promise<arrow.Table> {\n if (!connection) {\n throw new Error('MotherDuck connection not initialized');\n }\n\n // Check if already cancelled before starting\n if (signal.aborted) {\n throw new DOMException('Query was cancelled', 'AbortError');\n }\n\n // Not using evaluateQueuedQuery which supports cancellation\n // because it doesn't provide arrow results\n const result = await connection.evaluateStreamingQuery(query);\n const batches = new Array<RecordBatch<any>>();\n\n for await (const batch of result.arrowStream) {\n // Check for cancellation before processing each batch\n if (signal.aborted) {\n throw new DOMException('Query was cancelled', 'AbortError');\n }\n batches.push(batch);\n }\n\n return new arrow.Table(batches);\n },\n\n async cancelQueryInternal(queryId: string) {\n // Cancellation is handled by checking AbortSignal in the stream reading loop\n // No server-side cancellation is performed since evaluateStreamingQuery doesn't provide queryId\n },\n };\n\n const base = createBaseDuckDbConnector({initializationQuery}, impl);\n\n return {\n ...base,\n getConnection() {\n if (!connection) {\n throw new Error('MotherDuck connection not initialized');\n }\n return connection;\n },\n get type() {\n return 'wasm-motherduck' as const;\n },\n };\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sqlrooms/motherduck",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@motherduck/wasm-client": "^0.6.6",
|
|
22
|
-
"@sqlrooms/duckdb": "0.
|
|
22
|
+
"@sqlrooms/duckdb": "0.22.0",
|
|
23
23
|
"apache-arrow": "^17.0.0"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"typecheck": "tsc --noEmit",
|
|
30
30
|
"typedoc": "typedoc"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "8314c58ee9d14606ce1d704d23b772a092ddcd64"
|
|
33
33
|
}
|