@motherduck/wasm-client 0.6.1 → 0.6.3

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.
Files changed (76) hide show
  1. package/README.md +38 -22
  2. package/index.js +1 -1
  3. package/index_with_arrow.js +11 -11
  4. package/package.json +2 -2
  5. package/types/DuckDBInstance.d.ts +3 -0
  6. package/types/{api.d.ts → MDConnection.d.ts} +6 -4
  7. package/types/MDConnectionParams.d.ts +11 -0
  8. package/types/QueryTypes.d.ts +17 -5
  9. package/types/TaskSequencer.d.ts +1 -0
  10. package/types/createDuckDbConnection.d.ts +3 -0
  11. package/types/fetchDuckDBAssets.d.ts +17 -0
  12. package/types/fetchVersion.d.ts +1 -0
  13. package/types/genConnectionId.d.ts +1 -0
  14. package/types/getAsyncDuckDb.d.ts +3 -0
  15. package/types/getDuckDBBundlesFromDuckDBAssets.d.ts +2 -0
  16. package/types/getVersionSuffix.d.ts +1 -0
  17. package/types/index.d.ts +10 -10
  18. package/types/instantiateDB.d.ts +2 -0
  19. package/types/{arrow → motherduck/duckdb-arrow}/AsyncDuckDBRecordBatchIterator.d.ts +2 -3
  20. package/types/{arrow → motherduck/duckdb-arrow}/DuckDBRecordBatch.d.ts +3 -3
  21. package/types/{arrow → motherduck/duckdb-arrow}/duckDBTypeFromArrowType.d.ts +1 -1
  22. package/types/{arrow → motherduck/duckdb-arrow}/duckDBValueFromArrowData.d.ts +2 -2
  23. package/types/motherduck/duckdb-arrow/index.d.ts +2 -0
  24. package/types/{duckdb → motherduck/duckdb-data}/AsyncDuckDBDataBatchIterator.d.ts +1 -1
  25. package/types/{duckdb → motherduck/duckdb-data}/DuckDBData.d.ts +2 -2
  26. package/types/{duckdb → motherduck/duckdb-data}/DuckDBDataReader.d.ts +3 -3
  27. package/types/{duckdb → motherduck/duckdb-data}/DuckDBRow.d.ts +1 -1
  28. package/types/motherduck/duckdb-data/MemoryDuckDBData.d.ts +16 -0
  29. package/types/motherduck/duckdb-data/index.d.ts +5 -0
  30. package/types/motherduck/duckdb-types/DuckDBType.d.ts +124 -0
  31. package/types/motherduck/duckdb-types/DuckDBTypes.d.ts +43 -0
  32. package/types/motherduck/duckdb-types/index.d.ts +3 -0
  33. package/types/motherduck/duckdb-types/parseLogicalTypeString.d.ts +2 -0
  34. package/types/motherduck/duckdb-values/DuckDBArray.d.ts +7 -0
  35. package/types/{duckdb/values → motherduck/duckdb-values}/DuckDBBlob.d.ts +1 -1
  36. package/types/{duckdb/values → motherduck/duckdb-values}/DuckDBDate.d.ts +1 -1
  37. package/types/{duckdb/values → motherduck/duckdb-values}/DuckDBDecimal.d.ts +2 -2
  38. package/types/{duckdb/values → motherduck/duckdb-values}/DuckDBInterval.d.ts +1 -1
  39. package/types/{duckdb/values → motherduck/duckdb-values}/DuckDBList.d.ts +2 -2
  40. package/types/{duckdb/values → motherduck/duckdb-values}/DuckDBMap.d.ts +2 -2
  41. package/types/{duckdb/values → motherduck/duckdb-values}/DuckDBMapEntry.d.ts +1 -1
  42. package/types/{duckdb/values → motherduck/duckdb-values}/DuckDBStruct.d.ts +2 -2
  43. package/types/{duckdb/values → motherduck/duckdb-values}/DuckDBStructEntry.d.ts +1 -1
  44. package/types/{duckdb/values → motherduck/duckdb-values}/DuckDBTime.d.ts +1 -1
  45. package/types/{duckdb/values → motherduck/duckdb-values}/DuckDBTimestampMicroseconds.d.ts +1 -1
  46. package/types/{duckdb/values → motherduck/duckdb-values}/DuckDBTimestampMilliseconds.d.ts +1 -1
  47. package/types/{duckdb/values → motherduck/duckdb-values}/DuckDBTimestampNanoseconds.d.ts +1 -1
  48. package/types/{duckdb/values → motherduck/duckdb-values}/DuckDBTimestampSeconds.d.ts +1 -1
  49. package/types/{duckdb/values → motherduck/duckdb-values}/DuckDBValue.d.ts +1 -1
  50. package/types/{duckdb → motherduck/duckdb-values}/conversion/displayStringForDuckDBValue.d.ts +1 -1
  51. package/types/motherduck/duckdb-values/index.d.ts +17 -0
  52. package/types/motherduck/wasm-extension/LoadMotherDuckWasmExtensionOptions.d.ts +38 -0
  53. package/types/motherduck/wasm-extension/MDEvent.d.ts +1 -0
  54. package/types/motherduck/wasm-extension/MotherDuckEvent.d.ts +11 -0
  55. package/types/motherduck/wasm-extension/MotherDuckLogLevel.d.ts +7 -0
  56. package/types/motherduck/wasm-extension/doesBrowserSupportWorkerInWorker.d.ts +1 -0
  57. package/types/motherduck/wasm-extension/fetchVersion.d.ts +1 -0
  58. package/types/motherduck/wasm-extension/getExtensionRepository.d.ts +1 -0
  59. package/types/motherduck/wasm-extension/index.d.ts +4 -0
  60. package/types/motherduck/wasm-extension/loadMotherDuckWasmExtension.d.ts +2 -0
  61. package/types/motherduck/wasm-extension/motherDuckEventFromMessageEvent.d.ts +2 -0
  62. package/types/motherduck/wasm-extension/pathConcat.d.ts +1 -0
  63. package/types/motherduck/wasm-extension/untilWorkerReady.d.ts +2 -0
  64. package/types/{duckdb/files.d.ts → readLocalFS.d.ts} +1 -5
  65. package/types/recursivelyPrefix.d.ts +1 -0
  66. package/types/registerFiles.d.ts +5 -0
  67. package/types/transformQueryError.d.ts +2 -0
  68. package/types/urlPathConcat.d.ts +1 -0
  69. package/types/createDeferred.d.ts +0 -6
  70. package/types/duckdb/values/index.d.ts +0 -16
  71. package/types/duckdb/worker_factory.d.ts +0 -15
  72. /package/types/{arrow → motherduck/duckdb-arrow}/TypedTypeMap.d.ts +0 -0
  73. /package/types/{duckdb/values → motherduck/duckdb-values}/SpecialDuckDBValue.d.ts +0 -0
  74. /package/types/{duckdb → motherduck/duckdb-values}/conversion/dateTimeStringConversion.d.ts +0 -0
  75. /package/types/{duckdb → motherduck/duckdb-values}/conversion/stringFromBlob.d.ts +0 -0
  76. /package/types/{duckdb → motherduck/duckdb-values}/conversion/stringFromDecimal.d.ts +0 -0
@@ -0,0 +1,38 @@
1
+ import { AsyncDuckDB } from '@duckdb/duckdb-wasm';
2
+ import { MotherDuckLogLevel } from './MotherDuckLogLevel.js';
3
+ export interface LoadMotherDuckWasmExtensionOptions {
4
+ /**
5
+ * DuckDB instance.
6
+ */
7
+ instance: AsyncDuckDB;
8
+ /**
9
+ * MotherDuck authentication token.
10
+ */
11
+ token: string;
12
+ /**
13
+ * URL prefix of a custom extension repository where the MotherDuck Wasm client extension can be found.
14
+ *
15
+ * Note that this should not contain either the extension version or the `/duckdb-wasm` suffix.
16
+ *
17
+ * Defaults to https://app.motherduck.com.
18
+ */
19
+ extensionRepositoryUrlPrefix?: URL;
20
+ /**
21
+ * Version of the MotherDuck Wasm client extension, in the form `{branch}@{SHA}`.
22
+ *
23
+ * If not given, the latest version will be fetched from `{extensionRepositoryUrlPrefix}/version`.
24
+ */
25
+ extensionVersion?: string;
26
+ /**
27
+ * MotherDuck API URL.
28
+ *
29
+ * Defaults to https://api.motherduck.com.
30
+ */
31
+ apiUrl?: URL;
32
+ /**
33
+ * MotherDuck log level.
34
+ *
35
+ * Defaults to MotherDuckLogLevel.INFO.
36
+ */
37
+ logLevel?: MotherDuckLogLevel;
38
+ }
@@ -0,0 +1 @@
1
+ export declare const MD_EVENT = "MD_EVENT";
@@ -0,0 +1,11 @@
1
+ export declare enum MotherDuckEventType {
2
+ CATALOG_CHANGE_EVENT = "CatalogChangeEvent"
3
+ }
4
+ export declare class MotherDuckEventBase<T> extends CustomEvent<T> {
5
+ constructor(type: MotherDuckEventType, detail: T);
6
+ }
7
+ export type MotherDuckCatalogChangeEventDetail = unknown;
8
+ export declare class MotherDuckCatalogChangeEvent extends MotherDuckEventBase<MotherDuckCatalogChangeEventDetail> {
9
+ constructor(detail: MotherDuckCatalogChangeEventDetail);
10
+ }
11
+ export type MotherDuckEvent = MotherDuckCatalogChangeEvent;
@@ -0,0 +1,7 @@
1
+ export declare enum MotherDuckLogLevel {
2
+ NONE = "none",
3
+ ERROR = "error",
4
+ INFO = "info",
5
+ DEBUG = "debug",
6
+ TRACE = "trace"
7
+ }
@@ -0,0 +1 @@
1
+ export declare function doesBrowserSupportWorkerInWorker(): Promise<boolean>;
@@ -0,0 +1 @@
1
+ export declare function fetchVersion(extensionRepositoryUrlPrefix: URL): Promise<string>;
@@ -0,0 +1 @@
1
+ export declare function getExtensionRepository(extensionRepositoryUrlPrefix: URL, extensionVersion: string): string;
@@ -0,0 +1,4 @@
1
+ export * from './loadMotherDuckWasmExtension.js';
2
+ export * from './LoadMotherDuckWasmExtensionOptions.js';
3
+ export * from './MotherDuckEvent.js';
4
+ export * from './MotherDuckLogLevel.js';
@@ -0,0 +1,2 @@
1
+ import { LoadMotherDuckWasmExtensionOptions } from './LoadMotherDuckWasmExtensionOptions.js';
2
+ export declare function loadMotherDuckWasmExtension(options: LoadMotherDuckWasmExtensionOptions): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import { MotherDuckEvent } from './MotherDuckEvent.js';
2
+ export declare function motherDuckEventFromMessageEvent(event: MessageEvent): MotherDuckEvent | null;
@@ -0,0 +1 @@
1
+ export declare function pathConcat(prefix: string, suffix: string): string;
@@ -0,0 +1,2 @@
1
+ import { AsyncDuckDBConnection } from '@duckdb/duckdb-wasm';
2
+ export declare function untilWorkerReady(connection: AsyncDuckDBConnection): Promise<void>;
@@ -1,9 +1,5 @@
1
1
  import { WebFile } from '@duckdb/duckdb-wasm';
2
- import { MDConnectionParams } from './worker_factory';
3
- /**
4
- * Register the files within DuckDB WASM
5
- */
6
- export declare function registerFiles(params: MDConnectionParams, files: FileList): Promise<void>;
2
+ import { MDConnectionParams } from './MDConnectionParams';
7
3
  /**
8
4
  * Read local data files from wasm db
9
5
  *
@@ -0,0 +1 @@
1
+ export declare function recursivelyPrefix(prefix: string, json: any): any;
@@ -0,0 +1,5 @@
1
+ import { MDConnectionParams } from './MDConnectionParams';
2
+ /**
3
+ * Register the files within DuckDB WASM
4
+ */
5
+ export declare function registerFiles(params: MDConnectionParams, files: FileList): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import { QueryResult } from './QueryTypes';
2
+ export declare function transformQueryError(reason: any): QueryResult;
@@ -0,0 +1 @@
1
+ export declare function urlPathConcat(url: string, path: string): string;
@@ -1,6 +0,0 @@
1
- export interface Deferred<T> {
2
- readonly promise: Promise<T>;
3
- readonly resolve: (value: T | PromiseLike<T>) => void;
4
- readonly reject: (reason?: any) => void;
5
- }
6
- export declare function createDeferred<T = unknown>(): Deferred<T>;
@@ -1,16 +0,0 @@
1
- export { DuckDBBlob } from './DuckDBBlob';
2
- export { DuckDBDate } from './DuckDBDate';
3
- export { DuckDBDecimal } from './DuckDBDecimal';
4
- export { DuckDBInterval } from './DuckDBInterval';
5
- export { DuckDBList } from './DuckDBList';
6
- export { DuckDBMap } from './DuckDBMap';
7
- export { DuckDBMapEntry } from './DuckDBMapEntry';
8
- export { DuckDBStruct } from './DuckDBStruct';
9
- export { DuckDBStructEntry } from './DuckDBStructEntry';
10
- export { DuckDBTime } from './DuckDBTime';
11
- export { DuckDBTimestampMicroseconds } from './DuckDBTimestampMicroseconds';
12
- export { DuckDBTimestampMilliseconds } from './DuckDBTimestampMilliseconds';
13
- export { DuckDBTimestampNanoseconds } from './DuckDBTimestampNanoseconds';
14
- export { DuckDBTimestampSeconds } from './DuckDBTimestampSeconds';
15
- export { DuckDBValue } from './DuckDBValue';
16
- export { SpecialDuckDBValue } from './SpecialDuckDBValue';
@@ -1,15 +0,0 @@
1
- import { AsyncDuckDB, AsyncDuckDBConnection } from '@duckdb/duckdb-wasm';
2
- import { LogSink } from '../LogSink';
3
- export interface MDConnectionParams {
4
- mdToken: string;
5
- mdServerURL?: string;
6
- duckDBAssetsURLPrefix?: string;
7
- useDuckDBWasmCOI?: boolean;
8
- logSink?: LogSink;
9
- skipWelcomePack?: boolean;
10
- version?: string;
11
- enableDebugLogging?: boolean;
12
- }
13
- export declare const CATALOG_CHANGE_EVENT = "CatalogChangeEvent";
14
- export declare function createDuckDbConnection(params: MDConnectionParams): Promise<AsyncDuckDBConnection>;
15
- export declare function getAsyncDuckDb(params: MDConnectionParams): Promise<AsyncDuckDB>;