@motherduck/wasm-client 0.6.2 → 0.6.4

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 (112) hide show
  1. package/package.json +1 -1
  2. package/types/DuckDBInstance.d.ts +1 -1
  3. package/types/MDConnection.d.ts +1 -1
  4. package/types/MaterializedQueryTask.d.ts +1 -1
  5. package/types/QueryTypes.d.ts +3 -3
  6. package/types/StreamingQueryTask.d.ts +1 -1
  7. package/types/createDuckDbConnection.d.ts +1 -1
  8. package/types/duckdb-wasm/bindings/bindings_base.d.ts +122 -0
  9. package/types/duckdb-wasm/bindings/bindings_browser_base.d.ts +19 -0
  10. package/types/duckdb-wasm/bindings/bindings_browser_coi.d.ts +12 -0
  11. package/types/duckdb-wasm/bindings/bindings_browser_eh.d.ts +12 -0
  12. package/types/duckdb-wasm/bindings/bindings_browser_mvp.d.ts +11 -0
  13. package/types/duckdb-wasm/bindings/bindings_interface.d.ts +41 -0
  14. package/types/duckdb-wasm/bindings/bindings_node_base.d.ts +23 -0
  15. package/types/duckdb-wasm/bindings/bindings_node_eh.d.ts +12 -0
  16. package/types/duckdb-wasm/bindings/bindings_node_mvp.d.ts +12 -0
  17. package/types/duckdb-wasm/bindings/config.d.ts +62 -0
  18. package/types/duckdb-wasm/bindings/connection.d.ts +74 -0
  19. package/types/duckdb-wasm/bindings/duckdb_module.d.ts +12 -0
  20. package/types/duckdb-wasm/bindings/file_stats.d.ts +36 -0
  21. package/types/duckdb-wasm/bindings/index.d.ts +11 -0
  22. package/types/duckdb-wasm/bindings/insert_options.d.ts +38 -0
  23. package/types/duckdb-wasm/bindings/progress.d.ts +9 -0
  24. package/types/duckdb-wasm/bindings/runtime.d.ts +83 -0
  25. package/types/duckdb-wasm/bindings/runtime_browser.d.ts +9 -0
  26. package/types/duckdb-wasm/bindings/runtime_node.d.ts +8 -0
  27. package/types/duckdb-wasm/bindings/tokens.d.ts +12 -0
  28. package/types/duckdb-wasm/bindings/udf_function.d.ts +14 -0
  29. package/types/duckdb-wasm/bindings/udf_runtime.d.ts +3 -0
  30. package/types/duckdb-wasm/bindings/web_file.d.ts +12 -0
  31. package/types/duckdb-wasm/index.d.ts +7 -0
  32. package/types/duckdb-wasm/index_docs.d.ts +1 -0
  33. package/types/duckdb-wasm/json_typedef.d.ts +17 -0
  34. package/types/duckdb-wasm/log.d.ts +54 -0
  35. package/types/duckdb-wasm/parallel/async_bindings.d.ts +122 -0
  36. package/types/duckdb-wasm/parallel/async_bindings_interface.d.ts +25 -0
  37. package/types/duckdb-wasm/parallel/async_connection.d.ts +75 -0
  38. package/types/duckdb-wasm/parallel/index.d.ts +5 -0
  39. package/types/duckdb-wasm/parallel/worker_dispatcher.d.ts +22 -0
  40. package/types/duckdb-wasm/parallel/worker_request.d.ts +99 -0
  41. package/types/duckdb-wasm/platform.d.ts +39 -0
  42. package/types/duckdb-wasm/status.d.ts +3 -0
  43. package/types/duckdb-wasm/targets/duckdb-browser-blocking.d.ts +12 -0
  44. package/types/duckdb-wasm/targets/duckdb-browser-coi.pthread.worker.d.ts +1 -0
  45. package/types/duckdb-wasm/targets/duckdb-browser-coi.worker.d.ts +2 -0
  46. package/types/duckdb-wasm/targets/duckdb-browser-eh.worker.d.ts +2 -0
  47. package/types/duckdb-wasm/targets/duckdb-browser-mvp.worker.d.ts +2 -0
  48. package/types/duckdb-wasm/targets/duckdb-node-blocking.d.ts +13 -0
  49. package/types/duckdb-wasm/targets/duckdb-node-eh.worker.d.ts +2 -0
  50. package/types/duckdb-wasm/targets/duckdb-node-mvp.worker.d.ts +2 -0
  51. package/types/duckdb-wasm/targets/duckdb.d.ts +9 -0
  52. package/types/duckdb-wasm/utils/binary_dump.d.ts +1 -0
  53. package/types/duckdb-wasm/utils/index.d.ts +2 -0
  54. package/types/duckdb-wasm/utils/s3_helper.d.ts +27 -0
  55. package/types/duckdb-wasm/version.d.ts +5 -0
  56. package/types/duckdb-wasm/worker.d.ts +1 -0
  57. package/types/getAsyncDuckDb.d.ts +1 -1
  58. package/types/getDuckDBBundlesFromDuckDBAssets.d.ts +1 -1
  59. package/types/index.d.ts +5 -5
  60. package/types/instantiateDB.d.ts +1 -1
  61. package/types/motherduck/duckdb-arrow/AsyncDuckDBRecordBatchIterator.d.ts +12 -0
  62. package/types/motherduck/duckdb-arrow/DuckDBRecordBatch.d.ts +14 -0
  63. package/types/motherduck/duckdb-arrow/TypedTypeMap.d.ts +2 -0
  64. package/types/motherduck/duckdb-arrow/duckDBTypeFromArrowType.d.ts +4 -0
  65. package/types/motherduck/duckdb-arrow/duckDBValueFromArrowData.d.ts +8 -0
  66. package/types/motherduck/duckdb-arrow/index.d.ts +2 -0
  67. package/types/motherduck/duckdb-data/AsyncDuckDBDataBatchIterator.d.ts +3 -0
  68. package/types/motherduck/duckdb-data/DuckDBData.d.ts +56 -0
  69. package/types/motherduck/duckdb-data/DuckDBDataReader.d.ts +68 -0
  70. package/types/motherduck/duckdb-data/DuckDBRow.d.ts +4 -0
  71. package/types/motherduck/duckdb-data/MemoryDuckDBData.d.ts +16 -0
  72. package/types/motherduck/duckdb-data/index.d.ts +5 -0
  73. package/types/motherduck/duckdb-types/DuckDBType.d.ts +124 -0
  74. package/types/motherduck/duckdb-types/DuckDBTypes.d.ts +43 -0
  75. package/types/motherduck/duckdb-types/index.d.ts +3 -0
  76. package/types/motherduck/duckdb-types/parseLogicalTypeString.d.ts +2 -0
  77. package/types/motherduck/duckdb-values/DuckDBArray.d.ts +7 -0
  78. package/types/motherduck/duckdb-values/DuckDBBlob.d.ts +6 -0
  79. package/types/motherduck/duckdb-values/DuckDBDate.d.ts +6 -0
  80. package/types/motherduck/duckdb-values/DuckDBDecimal.d.ts +10 -0
  81. package/types/motherduck/duckdb-values/DuckDBInterval.d.ts +8 -0
  82. package/types/motherduck/duckdb-values/DuckDBList.d.ts +7 -0
  83. package/types/motherduck/duckdb-values/DuckDBMap.d.ts +7 -0
  84. package/types/motherduck/duckdb-values/DuckDBMapEntry.d.ts +5 -0
  85. package/types/motherduck/duckdb-values/DuckDBStruct.d.ts +7 -0
  86. package/types/motherduck/duckdb-values/DuckDBStructEntry.d.ts +5 -0
  87. package/types/motherduck/duckdb-values/DuckDBTime.d.ts +6 -0
  88. package/types/motherduck/duckdb-values/DuckDBTimestampMicroseconds.d.ts +8 -0
  89. package/types/motherduck/duckdb-values/DuckDBTimestampMilliseconds.d.ts +6 -0
  90. package/types/motherduck/duckdb-values/DuckDBTimestampNanoseconds.d.ts +6 -0
  91. package/types/motherduck/duckdb-values/DuckDBTimestampSeconds.d.ts +6 -0
  92. package/types/motherduck/duckdb-values/DuckDBValue.d.ts +2 -0
  93. package/types/motherduck/duckdb-values/SpecialDuckDBValue.d.ts +4 -0
  94. package/types/motherduck/duckdb-values/conversion/dateTimeStringConversion.d.ts +12 -0
  95. package/types/motherduck/duckdb-values/conversion/displayStringForDuckDBValue.d.ts +2 -0
  96. package/types/motherduck/duckdb-values/conversion/stringFromBlob.d.ts +2 -0
  97. package/types/motherduck/duckdb-values/conversion/stringFromDecimal.d.ts +18 -0
  98. package/types/motherduck/duckdb-values/index.d.ts +17 -0
  99. package/types/motherduck/wasm-extension/LoadMotherDuckWasmExtensionOptions.d.ts +38 -0
  100. package/types/motherduck/wasm-extension/MDEvent.d.ts +1 -0
  101. package/types/motherduck/wasm-extension/MotherDuckEvent.d.ts +11 -0
  102. package/types/motherduck/wasm-extension/MotherDuckLogLevel.d.ts +7 -0
  103. package/types/motherduck/wasm-extension/doesBrowserSupportWorkerInWorker.d.ts +1 -0
  104. package/types/motherduck/wasm-extension/fetchVersion.d.ts +1 -0
  105. package/types/motherduck/wasm-extension/getExtensionRepository.d.ts +1 -0
  106. package/types/motherduck/wasm-extension/index.d.ts +4 -0
  107. package/types/motherduck/wasm-extension/loadMotherDuckWasmExtension.d.ts +2 -0
  108. package/types/motherduck/wasm-extension/motherDuckEventFromMessageEvent.d.ts +2 -0
  109. package/types/motherduck/wasm-extension/pathConcat.d.ts +1 -0
  110. package/types/motherduck/wasm-extension/untilWorkerReady.d.ts +2 -0
  111. package/types/readLocalFS.d.ts +1 -1
  112. package/index.js.map +0 -7
@@ -0,0 +1,6 @@
1
+ import { SpecialDuckDBValue } from './SpecialDuckDBValue.js';
2
+ export declare class DuckDBTimestampSeconds extends SpecialDuckDBValue {
3
+ readonly seconds: bigint;
4
+ constructor(seconds: bigint);
5
+ toDuckDBString(): string;
6
+ }
@@ -0,0 +1,2 @@
1
+ import { SpecialDuckDBValue } from './SpecialDuckDBValue.js';
2
+ export type DuckDBValue = null | boolean | number | string | bigint | SpecialDuckDBValue;
@@ -0,0 +1,4 @@
1
+ export declare abstract class SpecialDuckDBValue {
2
+ abstract toDuckDBString(): string;
3
+ toString(): string;
4
+ }
@@ -0,0 +1,12 @@
1
+ export declare function getDuckDBDateStringFromYearMonthDay(year: number, month: number, dayOfMonth: number): string;
2
+ export declare function getDuckDBDateStringFromDays(days: number): string;
3
+ export declare function getDuckDBTimeStringFromParts(hoursPart: bigint, minutesPart: bigint, secondsPart: bigint, microsecondsPart: bigint): string;
4
+ export declare function getDuckDBTimeStringFromPositiveMicroseconds(positiveMicroseconds: bigint): string;
5
+ export declare function getDuckDBTimeStringFromMicrosecondsInDay(microsecondsInDay: bigint): string;
6
+ export declare function getDuckDBTimeStringFromMicroseconds(microseconds: bigint): string;
7
+ export declare function getDuckDBTimestampStringFromDaysAndMicroseconds(days: bigint, microsecondsInDay: bigint, timezone?: string | null): string;
8
+ export declare function getDuckDBTimestampStringFromMicroseconds(microseconds: bigint, timezone?: string | null): string;
9
+ export declare function getDuckDBTimestampStringFromSeconds(seconds: bigint, timezone?: string | null): string;
10
+ export declare function getDuckDBTimestampStringFromMilliseconds(milliseconds: bigint, timezone?: string | null): string;
11
+ export declare function getDuckDBTimestampStringFromNanoseconds(nanoseconds: bigint, timezone?: string | null): string;
12
+ export declare function getDuckDBIntervalString(months: number, days: number, microseconds: bigint): string;
@@ -0,0 +1,2 @@
1
+ import { DuckDBValue } from '../DuckDBValue.js';
2
+ export declare function displayStringForDuckDBValue(value: DuckDBValue): string;
@@ -0,0 +1,2 @@
1
+ /** Matches BLOB-to-VARCHAR conversion behavior of DuckDB. */
2
+ export declare function stringFromBlob(bytes: Uint8Array): string;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Decimal string formatting.
3
+ *
4
+ * Supports a subset of the functionality of `BigInt.prototype.toLocaleString` for locale-specific formatting.
5
+ */
6
+ export interface DuckDBDecimalFormatOptions {
7
+ useGrouping?: boolean;
8
+ minimumFractionDigits?: number;
9
+ maximumFractionDigits?: number;
10
+ }
11
+ export interface LocaleOptions {
12
+ locales?: string | string[];
13
+ options?: DuckDBDecimalFormatOptions;
14
+ }
15
+ /**
16
+ * Convert a scaled decimal value to a string, possibly using locale-specific formatting.
17
+ */
18
+ export declare function stringFromDecimal(scaledValue: bigint, scale: number, localeOptions?: LocaleOptions): string;
@@ -0,0 +1,17 @@
1
+ export { DuckDBArray } from './DuckDBArray.js';
2
+ export { DuckDBBlob } from './DuckDBBlob.js';
3
+ export { DuckDBDate } from './DuckDBDate.js';
4
+ export { DuckDBDecimal } from './DuckDBDecimal.js';
5
+ export { DuckDBInterval } from './DuckDBInterval.js';
6
+ export { DuckDBList } from './DuckDBList.js';
7
+ export { DuckDBMap } from './DuckDBMap.js';
8
+ export { DuckDBMapEntry } from './DuckDBMapEntry.js';
9
+ export { DuckDBStruct } from './DuckDBStruct.js';
10
+ export { DuckDBStructEntry } from './DuckDBStructEntry.js';
11
+ export { DuckDBTime } from './DuckDBTime.js';
12
+ export { DuckDBTimestampMicroseconds } from './DuckDBTimestampMicroseconds.js';
13
+ export { DuckDBTimestampMilliseconds } from './DuckDBTimestampMilliseconds.js';
14
+ export { DuckDBTimestampNanoseconds } from './DuckDBTimestampNanoseconds.js';
15
+ export { DuckDBTimestampSeconds } from './DuckDBTimestampSeconds.js';
16
+ export { DuckDBValue } from './DuckDBValue.js';
17
+ export { SpecialDuckDBValue } from './SpecialDuckDBValue.js';
@@ -0,0 +1,38 @@
1
+ import { AsyncDuckDB } from '../../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-wasm';
2
+ export declare function untilWorkerReady(connection: AsyncDuckDBConnection): Promise<void>;
@@ -1,4 +1,4 @@
1
- import { WebFile } from '@duckdb/duckdb-wasm';
1
+ import { WebFile } from './duckdb-wasm';
2
2
  import { MDConnectionParams } from './MDConnectionParams';
3
3
  /**
4
4
  * Read local data files from wasm db