@motherduck/wasm-client 0.6.4 → 0.6.5

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 (54) hide show
  1. package/README.md +1 -3
  2. package/index.js +1 -1
  3. package/index_with_arrow.js +9 -9
  4. package/package.json +2 -2
  5. package/types/MDConnection.d.ts +1 -6
  6. package/types/MDConnectionParams.d.ts +4 -3
  7. package/types/MaterializedQueryTask.d.ts +1 -1
  8. package/types/QueryTypes.d.ts +4 -0
  9. package/types/StreamingQueryTask.d.ts +1 -1
  10. package/types/duckdb-wasm/bindings/config.d.ts +4 -0
  11. package/types/fetchDuckDBBundlesFromDuckDBAssets.d.ts +2 -0
  12. package/types/getAsyncDuckDb.d.ts +1 -0
  13. package/types/index.d.ts +0 -1
  14. package/types/instantiateDB.d.ts +2 -1
  15. package/types/isDuckDBBundles.d.ts +2 -0
  16. package/types/motherduck/duckdb-arrow/duckDBTypeFromArrowType.d.ts +1 -1
  17. package/types/motherduck/duckdb-arrow/duckDBValueFromArrowData.d.ts +2 -2
  18. package/types/motherduck/duckdb-types/DuckDBType.d.ts +7 -1
  19. package/types/motherduck/duckdb-types/DuckDBTypes.d.ts +3 -1
  20. package/types/motherduck/duckdb-types/duckDBTypeToString.d.ts +2 -0
  21. package/types/motherduck/duckdb-types/index.d.ts +1 -0
  22. package/types/motherduck/duckdb-values/DuckDBArray.d.ts +1 -0
  23. package/types/motherduck/duckdb-values/DuckDBBlob.d.ts +1 -0
  24. package/types/motherduck/duckdb-values/DuckDBDate.d.ts +1 -0
  25. package/types/motherduck/duckdb-values/DuckDBDecimal.d.ts +1 -0
  26. package/types/motherduck/duckdb-values/DuckDBInterval.d.ts +1 -0
  27. package/types/motherduck/duckdb-values/DuckDBList.d.ts +1 -0
  28. package/types/motherduck/duckdb-values/DuckDBMap.d.ts +1 -0
  29. package/types/motherduck/duckdb-values/DuckDBStruct.d.ts +1 -0
  30. package/types/motherduck/duckdb-values/DuckDBTime.d.ts +1 -0
  31. package/types/motherduck/duckdb-values/DuckDBTimestampMicroseconds.d.ts +1 -0
  32. package/types/motherduck/duckdb-values/DuckDBTimestampMilliseconds.d.ts +1 -0
  33. package/types/motherduck/duckdb-values/DuckDBTimestampNanoseconds.d.ts +1 -0
  34. package/types/motherduck/duckdb-values/DuckDBTimestampSeconds.d.ts +1 -0
  35. package/types/motherduck/duckdb-values/DuckDBUUID.d.ts +7 -0
  36. package/types/motherduck/duckdb-values/DuckDBValue.d.ts +1 -0
  37. package/types/motherduck/duckdb-values/SpecialDuckDBValue.d.ts +1 -0
  38. package/types/motherduck/duckdb-values/conversion/hexFromBlob.d.ts +1 -0
  39. package/types/motherduck/duckdb-values/index.d.ts +1 -0
  40. package/types/motherduck/wasm-extension/LoadMotherDuckWasmExtensionOptions.d.ts +4 -0
  41. package/types/motherduck/wasm-extension/fetchMotherDuckWasmExtensionVersion.d.ts +1 -0
  42. package/types/motherduck/wasm-extension/index.d.ts +1 -0
  43. package/types/prefixDuckDBBundles.d.ts +2 -0
  44. package/types/readLocalFS.d.ts +1 -1
  45. package/types/LogSink.d.ts +0 -6
  46. package/types/TaskSequencer.d.ts +0 -55
  47. package/types/extractWrappedErrorMessage.d.ts +0 -17
  48. package/types/fetchDuckDBAssets.d.ts +0 -17
  49. package/types/fetchVersion.d.ts +0 -1
  50. package/types/genConnectionId.d.ts +0 -1
  51. package/types/getDuckDBBundlesFromDuckDBAssets.d.ts +0 -2
  52. package/types/getErrorMessage.d.ts +0 -1
  53. package/types/recursivelyPrefix.d.ts +0 -1
  54. package/types/transformQueryError.d.ts +0 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motherduck/wasm-client",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "Client library for MotherDuck-enabled DuckDB powered by WebAssembly (WASM)",
5
5
  "browser": "index.js",
6
6
  "types": "types/index.d.ts",
@@ -15,7 +15,7 @@
15
15
  }
16
16
  },
17
17
  "peerDependencies": {
18
- "apache-arrow": "^16.0.0"
18
+ "apache-arrow": "^17.0.0"
19
19
  },
20
20
  "scripts": {}
21
21
  }
@@ -1,19 +1,14 @@
1
1
  import { AsyncPreparedStatement, ScriptTokens, TokenType } from './duckdb-wasm';
2
2
  import { MDConnectionParams } from './MDConnectionParams';
3
3
  import { MaterializedQueryResult, SafePrepareResult, SafeQueryResult, StreamingQueryResult } from './QueryTypes';
4
- export { ScriptTokens, TokenType };
4
+ export { AsyncPreparedStatement, ScriptTokens, TokenType };
5
5
  export declare class MDConnection {
6
6
  readonly params: MDConnectionParams;
7
7
  private deferredDdbConnection;
8
8
  private sequencer;
9
- readonly id: string;
10
- static idMap: {
11
- [id: string]: MDConnection;
12
- };
13
9
  private constructor();
14
10
  static create(params: MDConnectionParams): MDConnection;
15
11
  isInitialized(): Promise<boolean>;
16
- static getById(id: string): MDConnection | undefined;
17
12
  tokenize(text: string): Promise<ScriptTokens>;
18
13
  incompleteQueryCount(): number;
19
14
  enqueueQuery(query: string, args?: any[]): string;
@@ -1,11 +1,12 @@
1
- import { LogSink } from './LogSink';
1
+ import { ConsoleLike } from './motherduck/task-sequencer';
2
+ export { ConsoleLike };
2
3
  export interface MDConnectionParams {
3
4
  mdToken: string;
4
5
  mdServerURL?: string;
5
6
  duckDBAssetsURLPrefix?: string;
6
7
  useDuckDBWasmCOI?: boolean;
7
- logSink?: LogSink;
8
- skipWelcomePack?: boolean;
8
+ logger?: ConsoleLike;
9
9
  version?: string;
10
10
  enableDebugLogging?: boolean;
11
+ customUserAgent?: string;
11
12
  }
@@ -1,6 +1,6 @@
1
1
  import { AsyncDuckDBConnection } from './duckdb-wasm';
2
+ import { Task } from './motherduck/task-sequencer';
2
3
  import { MaterializedQueryResult } from './QueryTypes';
3
- import { Task } from './TaskSequencer';
4
4
  export declare class MaterializedQueryTask implements Task<MaterializedQueryResult> {
5
5
  private connection;
6
6
  private deferredConnection;
@@ -2,6 +2,10 @@ import { AsyncPreparedStatement } from './duckdb-wasm';
2
2
  import { TypedTypeMap } from './motherduck/duckdb-arrow';
3
3
  import { AsyncDuckDBDataBatchIterator, DuckDBData, DuckDBDataReader } from './motherduck/duckdb-data';
4
4
  import { AsyncRecordBatchStreamReader, DataType } from 'apache-arrow';
5
+ export { AsyncPreparedStatement };
6
+ export { TypedTypeMap };
7
+ export { AsyncDuckDBDataBatchIterator, DuckDBData, DuckDBDataReader };
8
+ export { AsyncRecordBatchStreamReader, DataType };
5
9
  export interface MaterializedQueryResult {
6
10
  type: 'materialized';
7
11
  startTimeMs: number;
@@ -1,6 +1,6 @@
1
1
  import { AsyncDuckDBConnection } from './duckdb-wasm';
2
+ import { Task } from './motherduck/task-sequencer';
2
3
  import { StreamingQueryResult } from './QueryTypes';
3
- import { Task } from './TaskSequencer';
4
4
  export declare class StreamingQueryTask implements Task<StreamingQueryResult> {
5
5
  private connection;
6
6
  private deferredConnection;
@@ -59,4 +59,8 @@ export interface DuckDBConfig {
59
59
  * Whether to allow unsigned extensions
60
60
  */
61
61
  allowUnsignedExtensions?: boolean;
62
+ /**
63
+ * Custom user agent string
64
+ */
65
+ customUserAgent?: string;
62
66
  }
@@ -0,0 +1,2 @@
1
+ import { DuckDBBundles } from './duckdb-wasm';
2
+ export declare function fetchDuckDBBundlesFromDuckDBAssets(duckDBAssetsURLPrefix: string, version: string | undefined, includeCOI: boolean | undefined): Promise<DuckDBBundles>;
@@ -1,3 +1,4 @@
1
1
  import { AsyncDuckDB } from './duckdb-wasm';
2
2
  import { MDConnectionParams } from './MDConnectionParams';
3
+ export { AsyncDuckDB };
3
4
  export declare function getAsyncDuckDb(params: MDConnectionParams): Promise<AsyncDuckDB>;
package/types/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- export { TypedTypeMap } from './motherduck/duckdb-arrow';
2
1
  export * from './motherduck/duckdb-data';
3
2
  export * from './motherduck/duckdb-types';
4
3
  export * from './motherduck/duckdb-values';
@@ -1,2 +1,3 @@
1
+ import { AsyncDuckDB } from './duckdb-wasm';
1
2
  import { MDConnectionParams } from './MDConnectionParams';
2
- export declare function instantiateDB(params: MDConnectionParams): Promise<import("./duckdb-wasm").AsyncDuckDB>;
3
+ export declare function instantiateDB(params: MDConnectionParams): Promise<AsyncDuckDB>;
@@ -0,0 +1,2 @@
1
+ import { DuckDBBundles } from './duckdb-wasm';
2
+ export declare function isDuckDBBundles(input: unknown): input is DuckDBBundles;
@@ -1,4 +1,4 @@
1
1
  import { DuckDBType } from '../../motherduck/duckdb-types';
2
2
  import { DataType, Type } from 'apache-arrow';
3
3
  import { TypedTypeMap } from './TypedTypeMap.js';
4
- export declare function duckDBTypeFromArrowType(type: DataType<Type, TypedTypeMap>): DuckDBType;
4
+ export declare function duckDBTypeFromArrowType(type: DataType<Type, TypedTypeMap>, metadata?: Map<string, string>): DuckDBType;
@@ -3,6 +3,6 @@ import { Data, DataType, Type } from 'apache-arrow';
3
3
  import { TypedTypeMap } from './TypedTypeMap.js';
4
4
  type ArrowDataType = DataType<Type, TypedTypeMap>;
5
5
  type ArrowData = Data<ArrowDataType>;
6
- export declare function duckDBValueFromArrowData(data: ArrowData, rowIndex: number): DuckDBValue;
7
- export declare function duckDBValuesFromArrowData(data: ArrowData, begin: number, end: number): readonly DuckDBValue[];
6
+ export declare function duckDBValueFromArrowData(data: ArrowData, rowIndex: number, metadata?: Map<string, string>): DuckDBValue;
7
+ export declare function duckDBValuesFromArrowData(data: ArrowData, begin: number, end: number, metadata?: Map<string, string>): readonly DuckDBValue[];
8
8
  export {};
@@ -46,6 +46,9 @@ export type IntegerDuckDBType = {
46
46
  export type IntervalDuckDBType = {
47
47
  readonly name: 'INTERVAL';
48
48
  };
49
+ export type JSONDuckDBType = {
50
+ readonly name: 'JSON';
51
+ };
49
52
  export type ListDuckDBType = {
50
53
  readonly name: 'LIST';
51
54
  readonly valueType: DuckDBType;
@@ -95,6 +98,9 @@ export type TinyIntDuckDBType = {
95
98
  export type UBigIntDuckDBType = {
96
99
  readonly name: 'UBIGINT';
97
100
  };
101
+ export type UHugeIntDuckDBType = {
102
+ readonly name: 'UHUGEINT';
103
+ };
98
104
  export type UIntegerDuckDBType = {
99
105
  readonly name: 'UINTEGER';
100
106
  };
@@ -121,4 +127,4 @@ export type GeometryDuckDBType = {
121
127
  export type WKBBlobDuckDBType = {
122
128
  readonly name: 'WKB_BLOB';
123
129
  };
124
- export type DuckDBType = ArrayDuckDBType | BigIntDuckDBType | BitDuckDBType | BooleanDuckDBType | BlobDuckDBType | DateDuckDBType | DoubleDuckDBType | DecimalDuckDBType | EnumDuckDBType | HugeIntDuckDBType | IntegerDuckDBType | IntervalDuckDBType | ListDuckDBType | MapDuckDBType | RealDuckDBType | SmallIntDuckDBType | SQLNullDuckDBType | StructDuckDBType | TimeDuckDBType | TimeWithTimeZoneDuckDBType | TimestampDuckDBType | TimestampSecondsDuckDBType | TimestampMillisecondsDuckDBType | TimestampNanosecondsDuckDBType | TimestampWithTimeZoneDuckDBType | TinyIntDuckDBType | UBigIntDuckDBType | UIntegerDuckDBType | USmallIntDuckDBType | UTinyIntDuckDBType | UUIDDuckDBType | UnionDuckDBType | VarCharDuckDBType | GeometryDuckDBType | WKBBlobDuckDBType;
130
+ export type DuckDBType = ArrayDuckDBType | BigIntDuckDBType | BitDuckDBType | BooleanDuckDBType | BlobDuckDBType | DateDuckDBType | DoubleDuckDBType | DecimalDuckDBType | EnumDuckDBType | HugeIntDuckDBType | IntegerDuckDBType | IntervalDuckDBType | JSONDuckDBType | ListDuckDBType | MapDuckDBType | RealDuckDBType | SmallIntDuckDBType | SQLNullDuckDBType | StructDuckDBType | TimeDuckDBType | TimeWithTimeZoneDuckDBType | TimestampDuckDBType | TimestampSecondsDuckDBType | TimestampMillisecondsDuckDBType | TimestampNanosecondsDuckDBType | TimestampWithTimeZoneDuckDBType | TinyIntDuckDBType | UBigIntDuckDBType | UHugeIntDuckDBType | UIntegerDuckDBType | USmallIntDuckDBType | UTinyIntDuckDBType | UUIDDuckDBType | UnionDuckDBType | VarCharDuckDBType | GeometryDuckDBType | WKBBlobDuckDBType;
@@ -1,4 +1,4 @@
1
- import { ArrayDuckDBType, BigIntDuckDBType, BitDuckDBType, BlobDuckDBType, BooleanDuckDBType, DateDuckDBType, DecimalDuckDBType, DoubleDuckDBType, DuckDBType, EnumDuckDBType, GeometryDuckDBType, HugeIntDuckDBType, IntegerDuckDBType, IntervalDuckDBType, ListDuckDBType, MapDuckDBType, RealDuckDBType, SQLNullDuckDBType, SmallIntDuckDBType, StructDuckDBType, StructEntry, TimeDuckDBType, TimeWithTimeZoneDuckDBType, TimestampDuckDBType, TimestampMillisecondsDuckDBType, TimestampNanosecondsDuckDBType, TimestampSecondsDuckDBType, TimestampWithTimeZoneDuckDBType, TinyIntDuckDBType, UBigIntDuckDBType, UIntegerDuckDBType, USmallIntDuckDBType, UTinyIntDuckDBType, UUIDDuckDBType, UnionAlternative, UnionDuckDBType, VarCharDuckDBType, WKBBlobDuckDBType } from './DuckDBType.js';
1
+ import { ArrayDuckDBType, BigIntDuckDBType, BitDuckDBType, BlobDuckDBType, BooleanDuckDBType, DateDuckDBType, DecimalDuckDBType, DoubleDuckDBType, DuckDBType, EnumDuckDBType, GeometryDuckDBType, HugeIntDuckDBType, IntegerDuckDBType, IntervalDuckDBType, JSONDuckDBType, ListDuckDBType, MapDuckDBType, RealDuckDBType, SQLNullDuckDBType, SmallIntDuckDBType, StructDuckDBType, StructEntry, TimeDuckDBType, TimeWithTimeZoneDuckDBType, TimestampDuckDBType, TimestampMillisecondsDuckDBType, TimestampNanosecondsDuckDBType, TimestampSecondsDuckDBType, TimestampWithTimeZoneDuckDBType, TinyIntDuckDBType, UBigIntDuckDBType, UHugeIntDuckDBType, UIntegerDuckDBType, USmallIntDuckDBType, UTinyIntDuckDBType, UUIDDuckDBType, UnionAlternative, UnionDuckDBType, VarCharDuckDBType, WKBBlobDuckDBType } from './DuckDBType.js';
2
2
  export declare class DuckDBTypes {
3
3
  private constructor();
4
4
  static ARRAY(valueType: DuckDBType, length: number): ArrayDuckDBType;
@@ -15,6 +15,7 @@ export declare class DuckDBTypes {
15
15
  static HUGEINT: HugeIntDuckDBType;
16
16
  static INTEGER: IntegerDuckDBType;
17
17
  static INTERVAL: IntervalDuckDBType;
18
+ static JSON: JSONDuckDBType;
18
19
  static LIST(valueType: DuckDBType): ListDuckDBType;
19
20
  static MAP(keyType: DuckDBType, valueType: DuckDBType): MapDuckDBType;
20
21
  static REAL: RealDuckDBType;
@@ -31,6 +32,7 @@ export declare class DuckDBTypes {
31
32
  static TIMESTAMP_TZ: TimestampWithTimeZoneDuckDBType;
32
33
  static TINYINT: TinyIntDuckDBType;
33
34
  static UBIGINT: UBigIntDuckDBType;
35
+ static UHUGEINT: UHugeIntDuckDBType;
34
36
  static UINTEGER: UIntegerDuckDBType;
35
37
  static USMALLINT: USmallIntDuckDBType;
36
38
  static UTINYINT: UTinyIntDuckDBType;
@@ -0,0 +1,2 @@
1
+ import { DuckDBType } from './DuckDBType.js';
2
+ export declare function duckDBTypeToString(type: DuckDBType): string;
@@ -1,3 +1,4 @@
1
1
  export * from './DuckDBType.js';
2
2
  export { DuckDBTypes } from './DuckDBTypes.js';
3
+ export { duckDBTypeToString } from './duckDBTypeToString.js';
3
4
  export { parseLogicalTypeString } from './parseLogicalTypeString.js';
@@ -4,4 +4,5 @@ export declare class DuckDBArray extends SpecialDuckDBValue {
4
4
  readonly values: readonly DuckDBValue[];
5
5
  constructor(values: readonly DuckDBValue[]);
6
6
  toDuckDBString(): string;
7
+ toJS(): any[];
7
8
  }
@@ -3,4 +3,5 @@ export declare class DuckDBBlob extends SpecialDuckDBValue {
3
3
  readonly bytes: Uint8Array;
4
4
  constructor(bytes: Uint8Array);
5
5
  toDuckDBString(): string;
6
+ toJS(): Uint8Array;
6
7
  }
@@ -3,4 +3,5 @@ export declare class DuckDBDate extends SpecialDuckDBValue {
3
3
  readonly days: number;
4
4
  constructor(days: number);
5
5
  toDuckDBString(): string;
6
+ toJS(): string;
6
7
  }
@@ -7,4 +7,5 @@ export declare class DuckDBDecimal extends SpecialDuckDBValue {
7
7
  toDuckDBString(): string;
8
8
  /** Returns a string representation appropriate to the host environment's current locale. */
9
9
  toLocaleString(locales?: string | string[], options?: DuckDBDecimalFormatOptions): string;
10
+ toJS(): string;
10
11
  }
@@ -5,4 +5,5 @@ export declare class DuckDBInterval extends SpecialDuckDBValue {
5
5
  readonly microseconds: bigint;
6
6
  constructor(months: number, days: number, microseconds: bigint);
7
7
  toDuckDBString(): string;
8
+ toJS(): string;
8
9
  }
@@ -4,4 +4,5 @@ export declare class DuckDBList extends SpecialDuckDBValue {
4
4
  readonly values: readonly DuckDBValue[];
5
5
  constructor(values: readonly DuckDBValue[]);
6
6
  toDuckDBString(): string;
7
+ toJS(): any[];
7
8
  }
@@ -4,4 +4,5 @@ export declare class DuckDBMap extends SpecialDuckDBValue {
4
4
  readonly entries: readonly DuckDBMapEntry[];
5
5
  constructor(entries: readonly DuckDBMapEntry[]);
6
6
  toDuckDBString(): string;
7
+ toJS(): Record<string, any>;
7
8
  }
@@ -4,4 +4,5 @@ export declare class DuckDBStruct extends SpecialDuckDBValue {
4
4
  readonly entries: readonly DuckDBStructEntry[];
5
5
  constructor(entries: readonly DuckDBStructEntry[]);
6
6
  toDuckDBString(): string;
7
+ toJS(): Record<string, any>;
7
8
  }
@@ -3,4 +3,5 @@ export declare class DuckDBTime extends SpecialDuckDBValue {
3
3
  readonly microseconds: bigint;
4
4
  constructor(microseconds: bigint);
5
5
  toDuckDBString(): string;
6
+ toJS(): string;
6
7
  }
@@ -4,5 +4,6 @@ export declare class DuckDBTimestampMicroseconds extends SpecialDuckDBValue {
4
4
  readonly timezone: string | null | undefined;
5
5
  constructor(microseconds: bigint, timezone?: string | null);
6
6
  toDuckDBString(): string;
7
+ toJS(): string;
7
8
  }
8
9
  export type DuckDBTimestamp = DuckDBTimestampMicroseconds;
@@ -3,4 +3,5 @@ export declare class DuckDBTimestampMilliseconds extends SpecialDuckDBValue {
3
3
  readonly milliseconds: bigint;
4
4
  constructor(milliseconds: bigint);
5
5
  toDuckDBString(): string;
6
+ toJS(): string;
6
7
  }
@@ -3,4 +3,5 @@ export declare class DuckDBTimestampNanoseconds extends SpecialDuckDBValue {
3
3
  readonly nanoseconds: bigint;
4
4
  constructor(nanoseconds: bigint);
5
5
  toDuckDBString(): string;
6
+ toJS(): string;
6
7
  }
@@ -3,4 +3,5 @@ export declare class DuckDBTimestampSeconds extends SpecialDuckDBValue {
3
3
  readonly seconds: bigint;
4
4
  constructor(seconds: bigint);
5
5
  toDuckDBString(): string;
6
+ toJS(): string;
6
7
  }
@@ -0,0 +1,7 @@
1
+ import { SpecialDuckDBValue } from './SpecialDuckDBValue.js';
2
+ export declare class DuckDBUUID extends SpecialDuckDBValue {
3
+ readonly bytes: Uint8Array;
4
+ constructor(bytes: Uint8Array);
5
+ toDuckDBString(): string;
6
+ toJS(): string;
7
+ }
@@ -1,2 +1,3 @@
1
1
  import { SpecialDuckDBValue } from './SpecialDuckDBValue.js';
2
2
  export type DuckDBValue = null | boolean | number | string | bigint | SpecialDuckDBValue;
3
+ export declare function duckDBValueToJS(value: DuckDBValue): any;
@@ -1,4 +1,5 @@
1
1
  export declare abstract class SpecialDuckDBValue {
2
2
  abstract toDuckDBString(): string;
3
3
  toString(): string;
4
+ abstract toJS(): any;
4
5
  }
@@ -0,0 +1 @@
1
+ export declare function hexFromBlob(blob: Uint8Array, start: number | undefined, end: number | undefined): string;
@@ -14,4 +14,5 @@ export { DuckDBTimestampMilliseconds } from './DuckDBTimestampMilliseconds.js';
14
14
  export { DuckDBTimestampNanoseconds } from './DuckDBTimestampNanoseconds.js';
15
15
  export { DuckDBTimestampSeconds } from './DuckDBTimestampSeconds.js';
16
16
  export { DuckDBValue } from './DuckDBValue.js';
17
+ export { DuckDBUUID } from './DuckDBUUID.js';
17
18
  export { SpecialDuckDBValue } from './SpecialDuckDBValue.js';
@@ -35,4 +35,8 @@ export interface LoadMotherDuckWasmExtensionOptions {
35
35
  * Defaults to MotherDuckLogLevel.INFO.
36
36
  */
37
37
  logLevel?: MotherDuckLogLevel;
38
+ /**
39
+ * Skip the "welcome pack", the first message exchange between the MotherDuck client and server.
40
+ */
41
+ skipWelcomePack?: boolean;
38
42
  }
@@ -0,0 +1 @@
1
+ export declare function fetchMotherDuckWasmExtensionVersion(extensionRepositoryUrlPrefix: URL): Promise<string>;
@@ -1,3 +1,4 @@
1
+ export * from './fetchMotherDuckWasmExtensionVersion.js';
1
2
  export * from './loadMotherDuckWasmExtension.js';
2
3
  export * from './LoadMotherDuckWasmExtensionOptions.js';
3
4
  export * from './MotherDuckEvent.js';
@@ -0,0 +1,2 @@
1
+ import { DuckDBBundles } from './duckdb-wasm';
2
+ export declare function prefixDuckDBBundles(prefix: string, bundles: DuckDBBundles, includeCOI: boolean | undefined): DuckDBBundles;
@@ -1,9 +1,9 @@
1
1
  import { WebFile } from './duckdb-wasm';
2
2
  import { MDConnectionParams } from './MDConnectionParams';
3
+ export { WebFile };
3
4
  /**
4
5
  * Read local data files from wasm db
5
6
  *
6
7
  * @returns Local data files list.
7
8
  */
8
9
  export declare function readLocalFS(params: MDConnectionParams): Promise<WebFile[]>;
9
- export { WebFile };
@@ -1,6 +0,0 @@
1
- export interface LogSink {
2
- debug(message?: any, ...optionalParams: any[]): void;
3
- log(message?: any, ...optionalParams: any[]): void;
4
- warn(message?: any, ...optionalParams: any[]): void;
5
- error(message?: any, ...optionalParams: any[]): void;
6
- }
@@ -1,55 +0,0 @@
1
- import 'core-js/actual/promise/with-resolvers';
2
- import { LogSink } from './LogSink';
3
- /**
4
- * Represents a task that can be sequenced by TaskSequencer.
5
- *
6
- * Implemented by users of TaskSequencer.
7
- */
8
- export interface Task<T> {
9
- /**
10
- * Run the task and return a promise for the results.
11
- */
12
- run: () => Promise<T>;
13
- /**
14
- * Attempt to cancel a running task, and return a boolean promise indicating whether the attempt was successful.
15
- */
16
- cancel: () => Promise<boolean>;
17
- }
18
- /**
19
- * Sequences user-defined Tasks, ensuring only one is running at a given time.
20
- * Supports cancellation.
21
- */
22
- export declare class TaskSequencer<T> {
23
- private nextTaskId;
24
- private queuedTaskIds;
25
- private queuedTasksById;
26
- private processingQueue;
27
- private logSink?;
28
- constructor(logSink?: LogSink);
29
- incompleteTaskCount(): number;
30
- /**
31
- * Append a task to the queue, and return its unique id.
32
- *
33
- * The id can be used to get the result (using `taskResult`) or cancel (using `cancelTask`).
34
- */
35
- enqueueTask(task: Task<T>): string;
36
- /**
37
- * Attempt to cancel a previously enqueued task.
38
- * Returns a boolean promise indicating whether the attempt succeeded.
39
- *
40
- * In addition to the `taskId` to cancel, takes an optional `errorMessage` to supply to the rejected task promise, if a pending task is cancelled.
41
- * If a running task is cancelled, then the task implementation controls the error message in the rejected task promise.
42
- */
43
- cancelTask(taskId: string, errorMessage?: string): Promise<boolean>;
44
- /**
45
- * Returns a promise for the result of previously-enqueue task.
46
- */
47
- taskResult(taskId: string): Promise<T>;
48
- private logDebug;
49
- private logWarn;
50
- private createTaskId;
51
- private addQueuedTask;
52
- private scheduleProcessQueueIfNeeded;
53
- private processQueue;
54
- private processFirstQueuedTask;
55
- }
@@ -1,17 +0,0 @@
1
- /**
2
- * Given an error message string containing a wrapped, JSON-stringified error object
3
- * after some prefix, attempt to extract and return the message from that inner object.
4
- *
5
- * Useful for getting display strings from error messages received through the DuckDB WASM client,
6
- * which are often wrapped in this way and contain one or more prefixes. The inner message
7
- * is typically more useful to the end user.
8
- *
9
- * Any sequence of characters not containing an opening '{' is treated as a prefix.
10
- * In practice, the prefix will typically contain one or more error types each
11
- * followed by " Error: ", such as "Invalid Error: ", but a wider set of prefixes
12
- * is accepted to protect against future change.
13
- *
14
- * If the input does not match the expected pattern, or the JSON parsing fails,
15
- * the input string is returned unchanged.
16
- */
17
- export declare function extractWrappedErrorMessage(message: string): string;
@@ -1,17 +0,0 @@
1
- export declare function fetchDuckDBAssets(duckDBAssetsURLPrefix: string, version?: string): Promise<{
2
- coi?: {
3
- mainModule: string;
4
- mainWorker: string;
5
- pthreadWorker: string;
6
- };
7
- mvp?: {
8
- mainModule: string;
9
- mainWorker: string;
10
- pthreadWorker: undefined;
11
- };
12
- eh?: {
13
- mainModule: string;
14
- mainWorker: string;
15
- pthreadWorker: undefined;
16
- };
17
- }>;
@@ -1 +0,0 @@
1
- export declare function fetchVersion(duckDBAssetsURLPrefix: string): Promise<string | undefined>;
@@ -1 +0,0 @@
1
- export declare function genConnectionId(): string;
@@ -1,2 +0,0 @@
1
- import { DuckDBBundles } from './duckdb-wasm';
2
- export declare function getDuckDBBundlesFromDuckDBAssets(duckDBAssetsURLPrefix: string, version: string | undefined, includeCOI: boolean | undefined): Promise<DuckDBBundles>;
@@ -1 +0,0 @@
1
- export declare function getErrorMessage(maybeError: unknown): string;
@@ -1 +0,0 @@
1
- export declare function recursivelyPrefix(prefix: string, json: any): any;
@@ -1,2 +0,0 @@
1
- import { QueryResult } from './QueryTypes';
2
- export declare function transformQueryError(reason: any): QueryResult;