@motherduck/wasm-client 0.8.1 → 1.5.2-r.2
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/README.md +2 -25
- package/index.js +1 -1
- package/index_with_arrow.js +8 -8
- package/package.json +1 -1
- package/types/@motherduck/wasm-extension/LoadMotherDuckWasmExtensionOptions.d.ts +6 -0
- package/types/@motherduck/wasm-extension/index.d.ts +0 -1
- package/types/DuckDBInstance.d.ts +6 -0
- package/types/MDConnection.d.ts +7 -7
- package/types/MDConnectionParams.d.ts +5 -0
- package/types/MaterializedQueryTask.d.ts +2 -2
- package/types/StreamingQueryTask.d.ts +2 -2
- package/types/buildDuckDBBundleURLs.d.ts +9 -0
- package/types/createDuckDbConnection.d.ts +1 -1
- package/types/duckdbAccessModeFromString.d.ts +2 -0
- package/types/environment.d.ts +6 -0
- package/types/getAsyncDuckDb.d.ts +1 -1
- package/types/index.d.ts +9 -7
- package/types/instantiateDB.d.ts +1 -1
- package/types/readLocalFS.d.ts +1 -1
- package/types/registerFiles.d.ts +1 -1
- package/types/fetchDuckDBBundlesFromDuckDBAssets.d.ts +0 -2
- package/types/getVersionSuffix.d.ts +0 -1
- package/types/isDuckDBBundles.d.ts +0 -2
- package/types/prefixDuckDBBundles.d.ts +0 -2
package/package.json
CHANGED
|
@@ -41,6 +41,12 @@ export interface LoadMotherDuckWasmExtensionOptions {
|
|
|
41
41
|
* Default: 'workspace' (attaches all available MotherDuck databases)
|
|
42
42
|
*/
|
|
43
43
|
attachMode?: 'single' | 'workspace';
|
|
44
|
+
/**
|
|
45
|
+
* Set the MotherDuck session_name.
|
|
46
|
+
*
|
|
47
|
+
* See https://motherduck.com/docs/key-tasks/authenticating-and-connecting-to-motherduck/connecting-to-motherduck/#annotating-queries-with-session-names
|
|
48
|
+
*/
|
|
49
|
+
sessionName?: string;
|
|
44
50
|
/**
|
|
45
51
|
* Skip the "welcome pack", the first message exchange between the MotherDuck client and server.
|
|
46
52
|
*/
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import { AsyncDuckDB } from '././@duckdb/duckdb-wasm';
|
|
2
2
|
export declare function getDuckDBInstance(): Promise<AsyncDuckDB> | AsyncDuckDB | null;
|
|
3
3
|
export declare function setDuckDBInstance(instance: Promise<AsyncDuckDB> | AsyncDuckDB): void;
|
|
4
|
+
export declare function clearDuckDBInstance(): void;
|
|
5
|
+
/**
|
|
6
|
+
* Terminate the DuckDB WASM instance (kills the Web Worker + frees WASM memory)
|
|
7
|
+
* and clear the singleton so the next call to getAsyncDuckDb() re-initializes.
|
|
8
|
+
*/
|
|
9
|
+
export declare function terminateDuckDB(): Promise<void>;
|
package/types/MDConnection.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AsyncPreparedStatement, ScriptTokens, TokenType } from '././@duckdb/duckdb-wasm';
|
|
2
|
-
import { MDConnectionParams } from './MDConnectionParams';
|
|
3
|
-
import { MaterializedQueryResult, SafePrepareResult, SafeQueryResult, StreamingQueryResult } from './QueryTypes';
|
|
2
|
+
import { MDConnectionParams } from './MDConnectionParams.js';
|
|
3
|
+
import { MaterializedQueryResult, SafePrepareResult, SafeQueryResult, StreamingQueryResult } from './QueryTypes.js';
|
|
4
4
|
export { AsyncPreparedStatement, ScriptTokens, TokenType };
|
|
5
5
|
export declare class MDConnection {
|
|
6
6
|
readonly params: MDConnectionParams;
|
|
@@ -11,18 +11,18 @@ export declare class MDConnection {
|
|
|
11
11
|
isInitialized(): Promise<boolean>;
|
|
12
12
|
tokenize(text: string): Promise<ScriptTokens>;
|
|
13
13
|
incompleteQueryCount(): number;
|
|
14
|
-
enqueueQuery(query: string, args?:
|
|
14
|
+
enqueueQuery(query: string, args?: unknown[]): string;
|
|
15
15
|
safePrepareQuery(query: string): Promise<SafePrepareResult>;
|
|
16
16
|
safeEvaluateQuery(query: string): Promise<SafeQueryResult<MaterializedQueryResult>>;
|
|
17
|
-
safeEvaluatePreparedStatement(query: string, ...args:
|
|
17
|
+
safeEvaluatePreparedStatement(query: string, ...args: unknown[]): Promise<SafeQueryResult<MaterializedQueryResult>>;
|
|
18
18
|
safeEvaluateStreamingQuery(query: string): Promise<SafeQueryResult<StreamingQueryResult>>;
|
|
19
|
-
safeEvaluateStreamingPreparedStatement(query: string, args:
|
|
19
|
+
safeEvaluateStreamingPreparedStatement(query: string, args: unknown[]): Promise<SafeQueryResult<StreamingQueryResult>>;
|
|
20
20
|
safeEvaluateQueuedQuery(queryId: string): Promise<SafeQueryResult<MaterializedQueryResult>>;
|
|
21
21
|
prepareQuery(query: string): Promise<AsyncPreparedStatement>;
|
|
22
22
|
evaluateQuery(query: string): Promise<MaterializedQueryResult>;
|
|
23
|
-
evaluatePreparedStatement(query: string, args:
|
|
23
|
+
evaluatePreparedStatement(query: string, args: unknown[]): Promise<MaterializedQueryResult>;
|
|
24
24
|
evaluateStreamingQuery(query: string): Promise<StreamingQueryResult>;
|
|
25
|
-
evaluateStreamingPreparedStatement(query: string, args:
|
|
25
|
+
evaluateStreamingPreparedStatement(query: string, args: unknown[]): Promise<StreamingQueryResult>;
|
|
26
26
|
private evaluateExclusive;
|
|
27
27
|
evaluateQueuedQuery(queryId: string): Promise<MaterializedQueryResult>;
|
|
28
28
|
cancelQuery(queryId: string, errorMessage?: string): Promise<boolean>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ConsoleLike } from '././@motherduck/task-sequencer';
|
|
2
|
+
import { MDWasmEnvironement } from './environment.js';
|
|
2
3
|
export { ConsoleLike };
|
|
3
4
|
export interface MDConnectionParams {
|
|
4
5
|
mdToken: string;
|
|
@@ -10,6 +11,10 @@ export interface MDConnectionParams {
|
|
|
10
11
|
extensionVersion?: string;
|
|
11
12
|
enableDebugLogging?: boolean;
|
|
12
13
|
customUserAgent?: string;
|
|
14
|
+
databasePath?: string;
|
|
15
|
+
accessMode?: 'automatic' | 'read_only' | 'read_write';
|
|
13
16
|
attachMode?: 'single' | 'workspace';
|
|
17
|
+
sessionName?: string;
|
|
14
18
|
skipWelcomePack?: boolean;
|
|
19
|
+
mdWasmEnvironment?: MDWasmEnvironement;
|
|
15
20
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { AsyncDuckDBConnection } from '././@duckdb/duckdb-wasm';
|
|
2
2
|
import { Task } from '././@motherduck/task-sequencer';
|
|
3
|
-
import { MaterializedQueryResult } from './QueryTypes';
|
|
3
|
+
import { MaterializedQueryResult } from './QueryTypes.js';
|
|
4
4
|
export declare class MaterializedQueryTask implements Task<MaterializedQueryResult> {
|
|
5
5
|
private connection;
|
|
6
6
|
private deferredConnection;
|
|
7
7
|
private query;
|
|
8
8
|
private args?;
|
|
9
|
-
constructor(connection: Promise<AsyncDuckDBConnection>, query: string, args?:
|
|
9
|
+
constructor(connection: Promise<AsyncDuckDBConnection>, query: string, args?: unknown[]);
|
|
10
10
|
run(): Promise<MaterializedQueryResult>;
|
|
11
11
|
cancel(): Promise<boolean>;
|
|
12
12
|
private getConnection;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { AsyncDuckDBConnection } from '././@duckdb/duckdb-wasm';
|
|
2
2
|
import { Task } from '././@motherduck/task-sequencer';
|
|
3
|
-
import { StreamingQueryResult } from './QueryTypes';
|
|
3
|
+
import { StreamingQueryResult } from './QueryTypes.js';
|
|
4
4
|
export declare class StreamingQueryTask implements Task<StreamingQueryResult> {
|
|
5
5
|
private connection;
|
|
6
6
|
private deferredConnection;
|
|
7
7
|
private query;
|
|
8
8
|
private args?;
|
|
9
|
-
constructor(connection: Promise<AsyncDuckDBConnection>, query: string, args?:
|
|
9
|
+
constructor(connection: Promise<AsyncDuckDBConnection>, query: string, args?: unknown[]);
|
|
10
10
|
run(): Promise<StreamingQueryResult>;
|
|
11
11
|
cancel(): Promise<boolean>;
|
|
12
12
|
private getConnection;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DuckDBBundles } from '././@duckdb/duckdb-wasm';
|
|
2
|
+
/**
|
|
3
|
+
* Constructs DuckDB bundle URLs using the duckdb-wasm package version.
|
|
4
|
+
*
|
|
5
|
+
* Assets are served from the persistent store at
|
|
6
|
+
* `{baseUrl}/duckdb-wasm-assets/{version}/` with original filenames
|
|
7
|
+
* (e.g. `duckdb-eh.wasm`, `duckdb-browser-eh.worker.js`).
|
|
8
|
+
*/
|
|
9
|
+
export declare function buildDuckDBBundleURLs(baseUrl: string, includeCOI: boolean | undefined): DuckDBBundles;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { AsyncDuckDBConnection } from '././@duckdb/duckdb-wasm';
|
|
2
|
-
import { MDConnectionParams } from './MDConnectionParams';
|
|
2
|
+
import { MDConnectionParams } from './MDConnectionParams.js';
|
|
3
3
|
export declare function createDuckDbConnection(params: MDConnectionParams): Promise<AsyncDuckDBConnection>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type MDWasmEnvironmentVariable = 'MDWasmUseCooperativeNetwork';
|
|
2
|
+
export type MDWasmEnvironement = Partial<Record<MDWasmEnvironmentVariable, string>>;
|
|
3
|
+
export declare function createFragmentURLFromEnvironment(environment: MDWasmEnvironement): string;
|
|
4
|
+
export declare function parseFragmentURLToEnvironment(fragment: string): {
|
|
5
|
+
[key: string]: string;
|
|
6
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { AsyncDuckDB } from '././@duckdb/duckdb-wasm';
|
|
2
|
-
import { MDConnectionParams } from './MDConnectionParams';
|
|
2
|
+
import { MDConnectionParams } from './MDConnectionParams.js';
|
|
3
3
|
export { AsyncDuckDB };
|
|
4
4
|
export declare function getAsyncDuckDb(params: MDConnectionParams): Promise<AsyncDuckDB>;
|
package/types/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export * from '././@duckdb/data-reader';
|
|
2
2
|
export * from '././@duckdb/data-types';
|
|
3
3
|
export * from '././@duckdb/data-values';
|
|
4
|
-
export { MotherDuckCatalogChangeEvent, MotherDuckCatalogChangeEventDetail, MotherDuckEvent, MotherDuckEventBase, MotherDuckEventType } from '././@motherduck/wasm-extension';
|
|
5
|
-
export
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './
|
|
4
|
+
export { MotherDuckCatalogChangeEvent, MotherDuckCatalogChangeEventDetail, MotherDuckEvent, MotherDuckEventBase, MotherDuckEventType, } from '././@motherduck/wasm-extension';
|
|
5
|
+
export { terminateDuckDB } from './DuckDBInstance.js';
|
|
6
|
+
export * from './getAsyncDuckDb.js';
|
|
7
|
+
export * from './MDConnection.js';
|
|
8
|
+
export * from './MDConnectionParams.js';
|
|
9
|
+
export * from './QueryTypes.js';
|
|
10
|
+
export * from './readLocalFS.js';
|
|
11
|
+
export * from './registerFiles.js';
|
|
12
|
+
export * from './environment.js';
|
package/types/instantiateDB.d.ts
CHANGED
package/types/readLocalFS.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DuckDBDataProtocol, WebFile } from '././@duckdb/duckdb-wasm';
|
|
2
|
-
import { MDConnectionParams } from './MDConnectionParams';
|
|
2
|
+
import { MDConnectionParams } from './MDConnectionParams.js';
|
|
3
3
|
export { DuckDBDataProtocol, WebFile };
|
|
4
4
|
/**
|
|
5
5
|
* Read local data files from wasm db
|
package/types/registerFiles.d.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getVersionSuffix(version?: string): string;
|