@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motherduck/wasm-client",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
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": "^15.0.0"
18
+ "apache-arrow": "^16.0.0"
19
19
  },
20
20
  "scripts": {}
21
21
  }
@@ -0,0 +1,3 @@
1
+ import { AsyncDuckDB } from '@duckdb/duckdb-wasm';
2
+ export declare function getDuckDBInstance(): Promise<AsyncDuckDB> | AsyncDuckDB | null;
3
+ export declare function setDuckDBInstance(instance: Promise<AsyncDuckDB> | AsyncDuckDB): void;
@@ -1,7 +1,7 @@
1
- import { ScriptTokens, /*StreamToTableOptions,*/ TokenType } from '@duckdb/duckdb-wasm';
2
- import { MaterializedQueryResult, SafeQueryResult, StreamingQueryResult } from './QueryTypes';
3
- import { MDConnectionParams } from './duckdb/worker_factory';
4
- export { ScriptTokens, /*StreamToTableOptions,*/ TokenType };
1
+ import { AsyncPreparedStatement, ScriptTokens, TokenType } from '@duckdb/duckdb-wasm';
2
+ import { MDConnectionParams } from './MDConnectionParams';
3
+ import { MaterializedQueryResult, SafePrepareResult, SafeQueryResult, StreamingQueryResult } from './QueryTypes';
4
+ export { ScriptTokens, TokenType };
5
5
  export declare class MDConnection {
6
6
  readonly params: MDConnectionParams;
7
7
  private deferredDdbConnection;
@@ -17,11 +17,13 @@ export declare class MDConnection {
17
17
  tokenize(text: string): Promise<ScriptTokens>;
18
18
  incompleteQueryCount(): number;
19
19
  enqueueQuery(query: string, args?: any[]): string;
20
+ safePrepareQuery(query: string): Promise<SafePrepareResult>;
20
21
  safeEvaluateQuery(query: string): Promise<SafeQueryResult<MaterializedQueryResult>>;
21
22
  safeEvaluatePreparedStatement(query: string, ...args: any[]): Promise<SafeQueryResult<MaterializedQueryResult>>;
22
23
  safeEvaluateStreamingQuery(query: string): Promise<SafeQueryResult<StreamingQueryResult>>;
23
24
  safeEvaluateStreamingPreparedStatement(query: string, args: any[]): Promise<SafeQueryResult<StreamingQueryResult>>;
24
25
  safeEvaluateQueuedQuery(queryId: string): Promise<SafeQueryResult<MaterializedQueryResult>>;
26
+ prepareQuery(query: string): Promise<AsyncPreparedStatement>;
25
27
  evaluateQuery(query: string): Promise<MaterializedQueryResult>;
26
28
  evaluatePreparedStatement(query: string, args: any[]): Promise<MaterializedQueryResult>;
27
29
  evaluateStreamingQuery(query: string): Promise<StreamingQueryResult>;
@@ -0,0 +1,11 @@
1
+ import { LogSink } from './LogSink';
2
+ export interface MDConnectionParams {
3
+ mdToken: string;
4
+ mdServerURL?: string;
5
+ duckDBAssetsURLPrefix?: string;
6
+ useDuckDBWasmCOI?: boolean;
7
+ logSink?: LogSink;
8
+ skipWelcomePack?: boolean;
9
+ version?: string;
10
+ enableDebugLogging?: boolean;
11
+ }
@@ -1,8 +1,7 @@
1
- import { AsyncRecordBatchStreamReader } from 'apache-arrow';
2
- import { TypedTypeMap } from './arrow/TypedTypeMap';
3
- import { AsyncDuckDBDataBatchIterator } from './duckdb/AsyncDuckDBDataBatchIterator';
4
- import { DuckDBData } from './duckdb/DuckDBData';
5
- import { DuckDBDataReader } from './duckdb/DuckDBDataReader';
1
+ import { AsyncPreparedStatement } from '@duckdb/duckdb-wasm';
2
+ import { TypedTypeMap } from './motherduck/duckdb-arrow';
3
+ import { AsyncDuckDBDataBatchIterator, DuckDBData, DuckDBDataReader } from './motherduck/duckdb-data';
4
+ import { AsyncRecordBatchStreamReader, DataType } from 'apache-arrow';
6
5
  export interface MaterializedQueryResult {
7
6
  type: 'materialized';
8
7
  startTimeMs: number;
@@ -45,3 +44,16 @@ export interface QueryError {
45
44
  err: Error;
46
45
  }
47
46
  export type SafeQueryResult<T extends QueryResult> = QuerySuccess<T> | QueryError;
47
+ export type PrepareSuccess<T extends {
48
+ [key: string]: DataType;
49
+ } = any> = {
50
+ status: 'success';
51
+ preparedStatement: AsyncPreparedStatement<T>;
52
+ };
53
+ export type PrepareError = {
54
+ status: 'error';
55
+ err: Error;
56
+ };
57
+ export type SafePrepareResult<T extends {
58
+ [key: string]: DataType;
59
+ } = any> = PrepareSuccess<T> | PrepareError;
@@ -1,3 +1,4 @@
1
+ import 'core-js/actual/promise/with-resolvers';
1
2
  import { LogSink } from './LogSink';
2
3
  /**
3
4
  * Represents a task that can be sequenced by TaskSequencer.
@@ -0,0 +1,3 @@
1
+ import { AsyncDuckDBConnection } from '@duckdb/duckdb-wasm';
2
+ import { MDConnectionParams } from './MDConnectionParams';
3
+ export declare function createDuckDbConnection(params: MDConnectionParams): Promise<AsyncDuckDBConnection>;
@@ -0,0 +1,17 @@
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
+ }>;
@@ -0,0 +1 @@
1
+ export declare function fetchVersion(duckDBAssetsURLPrefix: string): Promise<string | undefined>;
@@ -0,0 +1 @@
1
+ export declare function genConnectionId(): string;
@@ -0,0 +1,3 @@
1
+ import { AsyncDuckDB } from '@duckdb/duckdb-wasm';
2
+ import { MDConnectionParams } from './MDConnectionParams';
3
+ export declare function getAsyncDuckDb(params: MDConnectionParams): Promise<AsyncDuckDB>;
@@ -0,0 +1,2 @@
1
+ import { DuckDBBundles } from '@duckdb/duckdb-wasm';
2
+ export declare function getDuckDBBundlesFromDuckDBAssets(duckDBAssetsURLPrefix: string, version: string | undefined, includeCOI: boolean | undefined): Promise<DuckDBBundles>;
@@ -0,0 +1 @@
1
+ export declare function getVersionSuffix(version?: string): string;
package/types/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- export * from '@motherduck/duckdb-types';
1
+ export { TypedTypeMap } from './motherduck/duckdb-arrow';
2
+ export * from './motherduck/duckdb-data';
3
+ export * from './motherduck/duckdb-types';
4
+ export * from './motherduck/duckdb-values';
5
+ export { MotherDuckCatalogChangeEvent, MotherDuckCatalogChangeEventDetail, MotherDuckEvent, MotherDuckEventBase, MotherDuckEventType } from './motherduck/wasm-extension';
6
+ export * from './getAsyncDuckDb';
7
+ export * from './MDConnection';
8
+ export * from './MDConnectionParams';
2
9
  export * from './QueryTypes';
3
- export * from './api';
4
- export * from './arrow/TypedTypeMap';
5
- export * from './duckdb/AsyncDuckDBDataBatchIterator';
6
- export * from './duckdb/DuckDBData';
7
- export * from './duckdb/DuckDBDataReader';
8
- export * from './duckdb/DuckDBRow';
9
- export * from './duckdb/files';
10
- export * from './duckdb/values';
11
- export { CATALOG_CHANGE_EVENT, MDConnectionParams, getAsyncDuckDb } from './duckdb/worker_factory';
10
+ export * from './readLocalFS';
11
+ export * from './registerFiles';
@@ -0,0 +1,2 @@
1
+ import { MDConnectionParams } from './MDConnectionParams';
2
+ export declare function instantiateDB(params: MDConnectionParams): Promise<import("@duckdb/duckdb-wasm").AsyncDuckDB>;
@@ -1,7 +1,6 @@
1
1
  import { RecordBatch } from 'apache-arrow';
2
- import { AsyncDuckDBDataBatchIterator, DuckDBDataBatchIteratorResult } from '../duckdb/AsyncDuckDBDataBatchIterator';
3
- import { DuckDBData } from '../duckdb/DuckDBData';
4
- import { TypedTypeMap } from './TypedTypeMap';
2
+ import { AsyncDuckDBDataBatchIterator, DuckDBData, DuckDBDataBatchIteratorResult } from '@motherduck/duckdb-data';
3
+ import { TypedTypeMap } from './TypedTypeMap.js';
5
4
  export type AsyncRecordBatchIterator = AsyncIterator<RecordBatch<TypedTypeMap>, RecordBatch<TypedTypeMap> | undefined>;
6
5
  export declare class AsyncDuckDBRecordBatchIterator implements AsyncDuckDBDataBatchIterator {
7
6
  private recordBatchIterator;
@@ -1,8 +1,8 @@
1
+ import { DuckDBData } from '@motherduck/duckdb-data';
1
2
  import { DuckDBType } from '@motherduck/duckdb-types';
3
+ import { DuckDBValue } from '@motherduck/duckdb-values';
2
4
  import { RecordBatch } from 'apache-arrow';
3
- import { DuckDBData } from '../duckdb/DuckDBData';
4
- import { DuckDBValue } from '../duckdb/values';
5
- import { TypedTypeMap } from './TypedTypeMap';
5
+ import { TypedTypeMap } from './TypedTypeMap.js';
6
6
  export declare class DuckDBRecordBatch extends DuckDBData {
7
7
  private recordBatch;
8
8
  constructor(recordBatch: RecordBatch<TypedTypeMap>);
@@ -1,4 +1,4 @@
1
1
  import { DuckDBType } from '@motherduck/duckdb-types';
2
2
  import { DataType, Type } from 'apache-arrow';
3
- import { TypedTypeMap } from './TypedTypeMap';
3
+ import { TypedTypeMap } from './TypedTypeMap.js';
4
4
  export declare function duckDBTypeFromArrowType(type: DataType<Type, TypedTypeMap>): DuckDBType;
@@ -1,6 +1,6 @@
1
+ import { DuckDBValue } from '@motherduck/duckdb-values';
1
2
  import { Data, DataType, Type } from 'apache-arrow';
2
- import { DuckDBValue } from '../duckdb/values';
3
- import { TypedTypeMap } from './TypedTypeMap';
3
+ import { TypedTypeMap } from './TypedTypeMap.js';
4
4
  type ArrowDataType = DataType<Type, TypedTypeMap>;
5
5
  type ArrowData = Data<ArrowDataType>;
6
6
  export declare function duckDBValueFromArrowData(data: ArrowData, rowIndex: number): DuckDBValue;
@@ -0,0 +1,2 @@
1
+ export * from './AsyncDuckDBRecordBatchIterator.js';
2
+ export * from './TypedTypeMap.js';
@@ -1,3 +1,3 @@
1
- import { DuckDBData } from './DuckDBData';
1
+ import { DuckDBData } from './DuckDBData.js';
2
2
  export type DuckDBDataBatchIteratorResult = IteratorResult<DuckDBData, DuckDBData | undefined>;
3
3
  export type AsyncDuckDBDataBatchIterator = AsyncIterator<DuckDBData, DuckDBData | undefined>;
@@ -1,6 +1,6 @@
1
1
  import { DuckDBType } from '@motherduck/duckdb-types';
2
- import { DuckDBRow } from './DuckDBRow';
3
- import { DuckDBValue } from './values';
2
+ import { DuckDBValue } from '@motherduck/duckdb-values';
3
+ import { DuckDBRow } from './DuckDBRow.js';
4
4
  /**
5
5
  * A two-dimensional table of data along with column metadata.
6
6
  *
@@ -1,7 +1,7 @@
1
1
  import { DuckDBType } from '@motherduck/duckdb-types';
2
- import { AsyncDuckDBDataBatchIterator } from './AsyncDuckDBDataBatchIterator';
3
- import { DuckDBData } from './DuckDBData';
4
- import { DuckDBValue } from './values';
2
+ import { DuckDBValue } from '@motherduck/duckdb-values';
3
+ import { AsyncDuckDBDataBatchIterator } from './AsyncDuckDBDataBatchIterator.js';
4
+ import { DuckDBData } from './DuckDBData.js';
5
5
  /**
6
6
  * A result set that can be read incrementally.
7
7
  *
@@ -1,4 +1,4 @@
1
- import { DuckDBValue } from './values/DuckDBValue';
1
+ import { DuckDBValue } from '@motherduck/duckdb-values';
2
2
  export interface DuckDBRow {
3
3
  readonly [columnName: string]: DuckDBValue;
4
4
  }
@@ -0,0 +1,16 @@
1
+ import { DuckDBType } from '@motherduck/duckdb-types';
2
+ import { DuckDBValue } from '@motherduck/duckdb-values';
3
+ import { DuckDBData } from './DuckDBData.js';
4
+ export declare class MemoryDuckDBData extends DuckDBData {
5
+ private columns;
6
+ private values;
7
+ constructor(columns: {
8
+ name: string;
9
+ type: DuckDBType;
10
+ }[], values: DuckDBValue[][]);
11
+ get columnCount(): number;
12
+ get rowCount(): number;
13
+ columnName(columnIndex: number): string;
14
+ columnType(columnIndex: number): DuckDBType;
15
+ value(columnIndex: number, rowIndex: number): DuckDBValue;
16
+ }
@@ -0,0 +1,5 @@
1
+ export * from './AsyncDuckDBDataBatchIterator.js';
2
+ export * from './DuckDBData.js';
3
+ export * from './DuckDBDataReader.js';
4
+ export * from './DuckDBRow.js';
5
+ export * from './MemoryDuckDBData.js';
@@ -0,0 +1,124 @@
1
+ export type StructEntry = {
2
+ readonly key: string;
3
+ readonly valueType: DuckDBType;
4
+ };
5
+ export type UnionAlternative = {
6
+ readonly tag: string;
7
+ readonly valueType: DuckDBType;
8
+ };
9
+ export type ArrayDuckDBType = {
10
+ readonly name: 'ARRAY';
11
+ readonly valueType: DuckDBType;
12
+ readonly length: number;
13
+ };
14
+ export type BigIntDuckDBType = {
15
+ readonly name: 'BIGINT';
16
+ };
17
+ export type BitDuckDBType = {
18
+ readonly name: 'BIT';
19
+ };
20
+ export type BooleanDuckDBType = {
21
+ readonly name: 'BOOLEAN';
22
+ };
23
+ export type BlobDuckDBType = {
24
+ readonly name: 'BLOB';
25
+ };
26
+ export type DateDuckDBType = {
27
+ readonly name: 'DATE';
28
+ };
29
+ export type DoubleDuckDBType = {
30
+ readonly name: 'DOUBLE';
31
+ };
32
+ export type DecimalDuckDBType = {
33
+ readonly name: 'DECIMAL';
34
+ readonly width?: number;
35
+ readonly scale?: number;
36
+ };
37
+ export type EnumDuckDBType = {
38
+ readonly name: 'ENUM';
39
+ };
40
+ export type HugeIntDuckDBType = {
41
+ readonly name: 'HUGEINT';
42
+ };
43
+ export type IntegerDuckDBType = {
44
+ readonly name: 'INTEGER';
45
+ };
46
+ export type IntervalDuckDBType = {
47
+ readonly name: 'INTERVAL';
48
+ };
49
+ export type ListDuckDBType = {
50
+ readonly name: 'LIST';
51
+ readonly valueType: DuckDBType;
52
+ };
53
+ export type MapDuckDBType = {
54
+ readonly name: 'MAP';
55
+ readonly keyType: DuckDBType;
56
+ readonly valueType: DuckDBType;
57
+ };
58
+ export type RealDuckDBType = {
59
+ readonly name: 'REAL';
60
+ };
61
+ export type SmallIntDuckDBType = {
62
+ readonly name: 'SMALLINT';
63
+ };
64
+ export type SQLNullDuckDBType = {
65
+ readonly name: 'SQLNULL';
66
+ };
67
+ export type StructDuckDBType = {
68
+ readonly name: 'STRUCT';
69
+ readonly entries: readonly StructEntry[];
70
+ };
71
+ export type TimeDuckDBType = {
72
+ readonly name: 'TIME';
73
+ };
74
+ export type TimeWithTimeZoneDuckDBType = {
75
+ readonly name: 'TIME_TZ';
76
+ };
77
+ export type TimestampDuckDBType = {
78
+ readonly name: 'TIMESTAMP';
79
+ };
80
+ export type TimestampSecondsDuckDBType = {
81
+ readonly name: 'TIMESTAMP_S';
82
+ };
83
+ export type TimestampMillisecondsDuckDBType = {
84
+ readonly name: 'TIMESTAMP_MS';
85
+ };
86
+ export type TimestampNanosecondsDuckDBType = {
87
+ readonly name: 'TIMESTAMP_NS';
88
+ };
89
+ export type TimestampWithTimeZoneDuckDBType = {
90
+ readonly name: 'TIMESTAMP_TZ';
91
+ };
92
+ export type TinyIntDuckDBType = {
93
+ readonly name: 'TINYINT';
94
+ };
95
+ export type UBigIntDuckDBType = {
96
+ readonly name: 'UBIGINT';
97
+ };
98
+ export type UIntegerDuckDBType = {
99
+ readonly name: 'UINTEGER';
100
+ };
101
+ export type USmallIntDuckDBType = {
102
+ readonly name: 'USMALLINT';
103
+ };
104
+ export type UTinyIntDuckDBType = {
105
+ readonly name: 'UTINYINT';
106
+ };
107
+ export type UUIDDuckDBType = {
108
+ readonly name: 'UUID';
109
+ };
110
+ export type UnionDuckDBType = {
111
+ readonly name: 'UNION';
112
+ readonly alternatives: readonly UnionAlternative[];
113
+ };
114
+ export type VarCharDuckDBType = {
115
+ readonly name: 'VARCHAR';
116
+ readonly length?: number;
117
+ };
118
+ export type GeometryDuckDBType = {
119
+ readonly name: 'GEOMETRY';
120
+ };
121
+ export type WKBBlobDuckDBType = {
122
+ readonly name: 'WKB_BLOB';
123
+ };
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;
@@ -0,0 +1,43 @@
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';
2
+ export declare class DuckDBTypes {
3
+ private constructor();
4
+ static ARRAY(valueType: DuckDBType, length: number): ArrayDuckDBType;
5
+ static BIGINT: BigIntDuckDBType;
6
+ static BIT: BitDuckDBType;
7
+ static BOOLEAN: BooleanDuckDBType;
8
+ static BLOB: BlobDuckDBType;
9
+ static DATE: DateDuckDBType;
10
+ static DOUBLE: DoubleDuckDBType;
11
+ private static default_DECIMAL;
12
+ static DECIMAL(width?: number, scale?: number): DecimalDuckDBType;
13
+ static ENUM: EnumDuckDBType;
14
+ static GEOMETRY: GeometryDuckDBType;
15
+ static HUGEINT: HugeIntDuckDBType;
16
+ static INTEGER: IntegerDuckDBType;
17
+ static INTERVAL: IntervalDuckDBType;
18
+ static LIST(valueType: DuckDBType): ListDuckDBType;
19
+ static MAP(keyType: DuckDBType, valueType: DuckDBType): MapDuckDBType;
20
+ static REAL: RealDuckDBType;
21
+ static SMALLINT: SmallIntDuckDBType;
22
+ static SQLNULL: SQLNullDuckDBType;
23
+ static STRUCT(entries: readonly StructEntry[]): StructDuckDBType;
24
+ static STRUCT_entry(key: string, valueType: DuckDBType): StructEntry;
25
+ static TIME: TimeDuckDBType;
26
+ static TIME_TZ: TimeWithTimeZoneDuckDBType;
27
+ static TIMESTAMP: TimestampDuckDBType;
28
+ static TIMESTAMP_S: TimestampSecondsDuckDBType;
29
+ static TIMESTAMP_MS: TimestampMillisecondsDuckDBType;
30
+ static TIMESTAMP_NS: TimestampNanosecondsDuckDBType;
31
+ static TIMESTAMP_TZ: TimestampWithTimeZoneDuckDBType;
32
+ static TINYINT: TinyIntDuckDBType;
33
+ static UBIGINT: UBigIntDuckDBType;
34
+ static UINTEGER: UIntegerDuckDBType;
35
+ static USMALLINT: USmallIntDuckDBType;
36
+ static UTINYINT: UTinyIntDuckDBType;
37
+ static UUID: UUIDDuckDBType;
38
+ static UNION(alternatives: readonly UnionAlternative[]): UnionDuckDBType;
39
+ static UNION_alternative(tag: string, valueType: DuckDBType): UnionAlternative;
40
+ static VARCHAR: VarCharDuckDBType;
41
+ static VARCHAR_withLength(length: number): VarCharDuckDBType;
42
+ static WKB_BLOB: WKBBlobDuckDBType;
43
+ }
@@ -0,0 +1,3 @@
1
+ export * from './DuckDBType.js';
2
+ export { DuckDBTypes } from './DuckDBTypes.js';
3
+ export { parseLogicalTypeString } from './parseLogicalTypeString.js';
@@ -0,0 +1,2 @@
1
+ import { DuckDBType } from './DuckDBType.js';
2
+ export declare function parseLogicalTypeString(typeString: string): DuckDBType;
@@ -0,0 +1,7 @@
1
+ import { DuckDBValue } from './DuckDBValue.js';
2
+ import { SpecialDuckDBValue } from './SpecialDuckDBValue.js';
3
+ export declare class DuckDBArray extends SpecialDuckDBValue {
4
+ readonly values: readonly DuckDBValue[];
5
+ constructor(values: readonly DuckDBValue[]);
6
+ toDuckDBString(): string;
7
+ }
@@ -1,4 +1,4 @@
1
- import { SpecialDuckDBValue } from './SpecialDuckDBValue';
1
+ import { SpecialDuckDBValue } from './SpecialDuckDBValue.js';
2
2
  export declare class DuckDBBlob extends SpecialDuckDBValue {
3
3
  readonly bytes: Uint8Array;
4
4
  constructor(bytes: Uint8Array);
@@ -1,4 +1,4 @@
1
- import { SpecialDuckDBValue } from './SpecialDuckDBValue';
1
+ import { SpecialDuckDBValue } from './SpecialDuckDBValue.js';
2
2
  export declare class DuckDBDate extends SpecialDuckDBValue {
3
3
  readonly days: number;
4
4
  constructor(days: number);
@@ -1,5 +1,5 @@
1
- import { DuckDBDecimalFormatOptions } from '../conversion/stringFromDecimal';
2
- import { SpecialDuckDBValue } from './SpecialDuckDBValue';
1
+ import { DuckDBDecimalFormatOptions } from './conversion/stringFromDecimal.js';
2
+ import { SpecialDuckDBValue } from './SpecialDuckDBValue.js';
3
3
  export declare class DuckDBDecimal extends SpecialDuckDBValue {
4
4
  readonly scaledValue: bigint;
5
5
  readonly scale: number;
@@ -1,4 +1,4 @@
1
- import { SpecialDuckDBValue } from './SpecialDuckDBValue';
1
+ import { SpecialDuckDBValue } from './SpecialDuckDBValue.js';
2
2
  export declare class DuckDBInterval extends SpecialDuckDBValue {
3
3
  readonly months: number;
4
4
  readonly days: number;
@@ -1,5 +1,5 @@
1
- import { DuckDBValue } from './DuckDBValue';
2
- import { SpecialDuckDBValue } from './SpecialDuckDBValue';
1
+ import { DuckDBValue } from './DuckDBValue.js';
2
+ import { SpecialDuckDBValue } from './SpecialDuckDBValue.js';
3
3
  export declare class DuckDBList extends SpecialDuckDBValue {
4
4
  readonly values: readonly DuckDBValue[];
5
5
  constructor(values: readonly DuckDBValue[]);
@@ -1,5 +1,5 @@
1
- import { DuckDBMapEntry } from './DuckDBMapEntry';
2
- import { SpecialDuckDBValue } from './SpecialDuckDBValue';
1
+ import { DuckDBMapEntry } from './DuckDBMapEntry.js';
2
+ import { SpecialDuckDBValue } from './SpecialDuckDBValue.js';
3
3
  export declare class DuckDBMap extends SpecialDuckDBValue {
4
4
  readonly entries: readonly DuckDBMapEntry[];
5
5
  constructor(entries: readonly DuckDBMapEntry[]);
@@ -1,4 +1,4 @@
1
- import { DuckDBValue } from './DuckDBValue';
1
+ import { DuckDBValue } from './DuckDBValue.js';
2
2
  export interface DuckDBMapEntry {
3
3
  readonly key: DuckDBValue;
4
4
  readonly value: DuckDBValue;
@@ -1,5 +1,5 @@
1
- import { DuckDBStructEntry } from './DuckDBStructEntry';
2
- import { SpecialDuckDBValue } from './SpecialDuckDBValue';
1
+ import { DuckDBStructEntry } from './DuckDBStructEntry.js';
2
+ import { SpecialDuckDBValue } from './SpecialDuckDBValue.js';
3
3
  export declare class DuckDBStruct extends SpecialDuckDBValue {
4
4
  readonly entries: readonly DuckDBStructEntry[];
5
5
  constructor(entries: readonly DuckDBStructEntry[]);
@@ -1,4 +1,4 @@
1
- import { DuckDBValue } from './DuckDBValue';
1
+ import { DuckDBValue } from './DuckDBValue.js';
2
2
  export interface DuckDBStructEntry {
3
3
  readonly key: string;
4
4
  readonly value: DuckDBValue;
@@ -1,4 +1,4 @@
1
- import { SpecialDuckDBValue } from './SpecialDuckDBValue';
1
+ import { SpecialDuckDBValue } from './SpecialDuckDBValue.js';
2
2
  export declare class DuckDBTime extends SpecialDuckDBValue {
3
3
  readonly microseconds: bigint;
4
4
  constructor(microseconds: bigint);
@@ -1,4 +1,4 @@
1
- import { SpecialDuckDBValue } from './SpecialDuckDBValue';
1
+ import { SpecialDuckDBValue } from './SpecialDuckDBValue.js';
2
2
  export declare class DuckDBTimestampMicroseconds extends SpecialDuckDBValue {
3
3
  readonly microseconds: bigint;
4
4
  readonly timezone: string | null | undefined;
@@ -1,4 +1,4 @@
1
- import { SpecialDuckDBValue } from './SpecialDuckDBValue';
1
+ import { SpecialDuckDBValue } from './SpecialDuckDBValue.js';
2
2
  export declare class DuckDBTimestampMilliseconds extends SpecialDuckDBValue {
3
3
  readonly milliseconds: bigint;
4
4
  constructor(milliseconds: bigint);
@@ -1,4 +1,4 @@
1
- import { SpecialDuckDBValue } from './SpecialDuckDBValue';
1
+ import { SpecialDuckDBValue } from './SpecialDuckDBValue.js';
2
2
  export declare class DuckDBTimestampNanoseconds extends SpecialDuckDBValue {
3
3
  readonly nanoseconds: bigint;
4
4
  constructor(nanoseconds: bigint);
@@ -1,4 +1,4 @@
1
- import { SpecialDuckDBValue } from './SpecialDuckDBValue';
1
+ import { SpecialDuckDBValue } from './SpecialDuckDBValue.js';
2
2
  export declare class DuckDBTimestampSeconds extends SpecialDuckDBValue {
3
3
  readonly seconds: bigint;
4
4
  constructor(seconds: bigint);
@@ -1,2 +1,2 @@
1
- import { SpecialDuckDBValue } from './SpecialDuckDBValue';
1
+ import { SpecialDuckDBValue } from './SpecialDuckDBValue.js';
2
2
  export type DuckDBValue = null | boolean | number | string | bigint | SpecialDuckDBValue;
@@ -1,2 +1,2 @@
1
- import { DuckDBValue } from '../values/DuckDBValue';
1
+ import { DuckDBValue } from '../DuckDBValue.js';
2
2
  export declare function displayStringForDuckDBValue(value: DuckDBValue): 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';