@motherduck/wasm-client 0.6.0 → 0.6.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 +38 -22
- package/index.js +1 -1
- package/index_with_arrow.js +11 -11
- package/package.json +2 -2
- package/types/DuckDBInstance.d.ts +3 -0
- package/types/{api.d.ts → MDConnection.d.ts} +6 -4
- package/types/MDConnectionParams.d.ts +11 -0
- package/types/QueryTypes.d.ts +17 -5
- package/types/TaskSequencer.d.ts +1 -0
- package/types/createDuckDbConnection.d.ts +3 -0
- package/types/fetchDuckDBAssets.d.ts +17 -0
- package/types/fetchVersion.d.ts +1 -0
- package/types/genConnectionId.d.ts +1 -0
- package/types/getAsyncDuckDb.d.ts +3 -0
- package/types/getDuckDBBundlesFromDuckDBAssets.d.ts +2 -0
- package/types/getVersionSuffix.d.ts +1 -0
- package/types/index.d.ts +9 -9
- package/types/instantiateDB.d.ts +2 -0
- package/types/{duckdb/files.d.ts → readLocalFS.d.ts} +1 -5
- package/types/recursivelyPrefix.d.ts +1 -0
- package/types/registerFiles.d.ts +5 -0
- package/types/transformQueryError.d.ts +2 -0
- package/types/urlPathConcat.d.ts +1 -0
- package/types/arrow/AsyncDuckDBRecordBatchIterator.d.ts +0 -13
- package/types/arrow/DuckDBRecordBatch.d.ts +0 -14
- package/types/arrow/TypedTypeMap.d.ts +0 -2
- package/types/arrow/duckDBTypeFromArrowType.d.ts +0 -4
- package/types/arrow/duckDBValueFromArrowData.d.ts +0 -8
- package/types/createDeferred.d.ts +0 -6
- package/types/duckdb/AsyncDuckDBDataBatchIterator.d.ts +0 -3
- package/types/duckdb/DuckDBData.d.ts +0 -56
- package/types/duckdb/DuckDBDataReader.d.ts +0 -68
- package/types/duckdb/DuckDBRow.d.ts +0 -4
- package/types/duckdb/conversion/dateTimeStringConversion.d.ts +0 -12
- package/types/duckdb/conversion/displayStringForDuckDBValue.d.ts +0 -2
- package/types/duckdb/conversion/stringFromBlob.d.ts +0 -2
- package/types/duckdb/conversion/stringFromDecimal.d.ts +0 -18
- package/types/duckdb/types/DuckDBType.d.ts +0 -110
- package/types/duckdb/types/DuckDBTypes.d.ts +0 -39
- package/types/duckdb/types/index.d.ts +0 -2
- package/types/duckdb/values/DuckDBBlob.d.ts +0 -6
- package/types/duckdb/values/DuckDBDate.d.ts +0 -6
- package/types/duckdb/values/DuckDBDecimal.d.ts +0 -10
- package/types/duckdb/values/DuckDBInterval.d.ts +0 -8
- package/types/duckdb/values/DuckDBList.d.ts +0 -7
- package/types/duckdb/values/DuckDBMap.d.ts +0 -7
- package/types/duckdb/values/DuckDBMapEntry.d.ts +0 -5
- package/types/duckdb/values/DuckDBStruct.d.ts +0 -7
- package/types/duckdb/values/DuckDBStructEntry.d.ts +0 -5
- package/types/duckdb/values/DuckDBTime.d.ts +0 -6
- package/types/duckdb/values/DuckDBTimestampMicroseconds.d.ts +0 -8
- package/types/duckdb/values/DuckDBTimestampMilliseconds.d.ts +0 -6
- package/types/duckdb/values/DuckDBTimestampNanoseconds.d.ts +0 -6
- package/types/duckdb/values/DuckDBTimestampSeconds.d.ts +0 -6
- package/types/duckdb/values/DuckDBValue.d.ts +0 -2
- package/types/duckdb/values/SpecialDuckDBValue.d.ts +0 -4
- package/types/duckdb/values/index.d.ts +0 -16
- package/types/duckdb/worker_factory.d.ts +0 -15
- package/types/observability.d.ts +0 -26
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@motherduck/wasm-client",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
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": "^
|
|
18
|
+
"apache-arrow": "^16.0.0"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {}
|
|
21
21
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ScriptTokens,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
export { ScriptTokens,
|
|
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
|
+
}
|
package/types/QueryTypes.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TypedTypeMap } from '
|
|
3
|
-
import { AsyncDuckDBDataBatchIterator } from '
|
|
4
|
-
import {
|
|
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;
|
package/types/TaskSequencer.d.ts
CHANGED
|
@@ -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 @@
|
|
|
1
|
+
export declare function getVersionSuffix(version?: string): string;
|
package/types/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
export { TypedTypeMap } from '@motherduck/duckdb-arrow';
|
|
2
|
+
export * from '@motherduck/duckdb-data';
|
|
1
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 './
|
|
4
|
-
export * from './
|
|
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';
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { WebFile } from '@duckdb/duckdb-wasm';
|
|
2
|
-
import { MDConnectionParams } from './
|
|
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 @@
|
|
|
1
|
+
export declare function urlPathConcat(url: string, path: string): string;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { RecordBatch } from 'apache-arrow';
|
|
2
|
-
import { AsyncDuckDBDataBatchIterator, DuckDBDataBatchIteratorResult } from '../duckdb/AsyncDuckDBDataBatchIterator';
|
|
3
|
-
import { DuckDBData } from '../duckdb/DuckDBData';
|
|
4
|
-
import { TypedTypeMap } from './TypedTypeMap';
|
|
5
|
-
export type AsyncRecordBatchIterator = AsyncIterator<RecordBatch<TypedTypeMap>, RecordBatch<TypedTypeMap> | undefined>;
|
|
6
|
-
export declare class AsyncDuckDBRecordBatchIterator implements AsyncDuckDBDataBatchIterator {
|
|
7
|
-
private recordBatchIterator;
|
|
8
|
-
constructor(recordBatchIterator: AsyncRecordBatchIterator);
|
|
9
|
-
next(): Promise<DuckDBDataBatchIteratorResult>;
|
|
10
|
-
return(value?: DuckDBData): Promise<DuckDBDataBatchIteratorResult>;
|
|
11
|
-
throw(e?: any): Promise<DuckDBDataBatchIteratorResult>;
|
|
12
|
-
[Symbol.asyncIterator](): AsyncDuckDBDataBatchIterator;
|
|
13
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { DuckDBType } from '@motherduck/duckdb-types';
|
|
2
|
-
import { RecordBatch } from 'apache-arrow';
|
|
3
|
-
import { DuckDBData } from '../duckdb/DuckDBData';
|
|
4
|
-
import { DuckDBValue } from '../duckdb/values';
|
|
5
|
-
import { TypedTypeMap } from './TypedTypeMap';
|
|
6
|
-
export declare class DuckDBRecordBatch extends DuckDBData {
|
|
7
|
-
private recordBatch;
|
|
8
|
-
constructor(recordBatch: RecordBatch<TypedTypeMap>);
|
|
9
|
-
get columnCount(): number;
|
|
10
|
-
get rowCount(): number;
|
|
11
|
-
columnName(columnIndex: number): string;
|
|
12
|
-
columnType(columnIndex: number): DuckDBType;
|
|
13
|
-
value(columnIndex: number, rowIndex: number): DuckDBValue;
|
|
14
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Data, DataType, Type } from 'apache-arrow';
|
|
2
|
-
import { DuckDBValue } from '../duckdb/values';
|
|
3
|
-
import { TypedTypeMap } from './TypedTypeMap';
|
|
4
|
-
type ArrowDataType = DataType<Type, TypedTypeMap>;
|
|
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[];
|
|
8
|
-
export {};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { DuckDBType } from '@motherduck/duckdb-types';
|
|
2
|
-
import { DuckDBRow } from './DuckDBRow';
|
|
3
|
-
import { DuckDBValue } from './values';
|
|
4
|
-
/**
|
|
5
|
-
* A two-dimensional table of data along with column metadata.
|
|
6
|
-
*
|
|
7
|
-
* May represent either a partial or full result set, or a batch of rows read from a result stream.
|
|
8
|
-
* */
|
|
9
|
-
export declare abstract class DuckDBData {
|
|
10
|
-
/**
|
|
11
|
-
* Number of columns.
|
|
12
|
-
*
|
|
13
|
-
* May be zero until the first part of the result is read. Will not change after the initial read.
|
|
14
|
-
*/
|
|
15
|
-
abstract get columnCount(): number;
|
|
16
|
-
/**
|
|
17
|
-
* Current number of rows.
|
|
18
|
-
*
|
|
19
|
-
* For a partial result set, this may change as more rows are read.
|
|
20
|
-
* For a full result, or a batch, this will not change.
|
|
21
|
-
*/
|
|
22
|
-
abstract get rowCount(): number;
|
|
23
|
-
/**
|
|
24
|
-
* Returns the name of column at the given index (starting at zero).
|
|
25
|
-
*
|
|
26
|
-
* Note that duplicate column names are possible.
|
|
27
|
-
*/
|
|
28
|
-
abstract columnName(columnIndex: number): string;
|
|
29
|
-
/**
|
|
30
|
-
* Returns the type of the column at the given index (starting at zero).
|
|
31
|
-
*/
|
|
32
|
-
abstract columnType(columnIndex: number): DuckDBType;
|
|
33
|
-
/**
|
|
34
|
-
* Returns the value for the given column and row. Both are zero-indexed.
|
|
35
|
-
*/
|
|
36
|
-
abstract value(columnIndex: number, rowIndex: number): DuckDBValue;
|
|
37
|
-
/**
|
|
38
|
-
* Returns the single value, assuming exactly one column and row. Throws otherwise.
|
|
39
|
-
*/
|
|
40
|
-
singleValue(): DuckDBValue;
|
|
41
|
-
/**
|
|
42
|
-
* Returns the column names as an array.
|
|
43
|
-
*/
|
|
44
|
-
columnNames(): readonly string[];
|
|
45
|
-
/**
|
|
46
|
-
* Returns the column names as an array, deduplicated following DuckDB's "Auto-Increment Duplicate Column Names"
|
|
47
|
-
* behavior.
|
|
48
|
-
*/
|
|
49
|
-
deduplicatedColumnNames(): readonly string[];
|
|
50
|
-
/**
|
|
51
|
-
* Returns the data as an array of row objects, keyed by column names.
|
|
52
|
-
*
|
|
53
|
-
* The column names are deduplicated following DuckDB's "Auto-Increment Duplicate Column Names" behavior.
|
|
54
|
-
*/
|
|
55
|
-
toRows(): readonly DuckDBRow[];
|
|
56
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { DuckDBType } from '@motherduck/duckdb-types';
|
|
2
|
-
import { AsyncDuckDBDataBatchIterator } from './AsyncDuckDBDataBatchIterator';
|
|
3
|
-
import { DuckDBData } from './DuckDBData';
|
|
4
|
-
import { DuckDBValue } from './values';
|
|
5
|
-
/**
|
|
6
|
-
* A result set that can be read incrementally.
|
|
7
|
-
*
|
|
8
|
-
* Represents either a partial or full result.
|
|
9
|
-
* For full results, the `done` property will be true.
|
|
10
|
-
* To read more rows into a partial result, use the `readUntil` or `readAll` methods.
|
|
11
|
-
*/
|
|
12
|
-
export declare class DuckDBDataReader extends DuckDBData {
|
|
13
|
-
private readonly iterator;
|
|
14
|
-
private iteratorDone;
|
|
15
|
-
private totalRowsRead;
|
|
16
|
-
private readonly batches;
|
|
17
|
-
private readonly batchSizeRuns;
|
|
18
|
-
constructor(iterator: AsyncDuckDBDataBatchIterator);
|
|
19
|
-
/**
|
|
20
|
-
* Number of columns.
|
|
21
|
-
*
|
|
22
|
-
* Will be zero until the first part of the result is read. Will not change after the initial read.
|
|
23
|
-
*/
|
|
24
|
-
get columnCount(): number;
|
|
25
|
-
/**
|
|
26
|
-
* Current number of rows.
|
|
27
|
-
*
|
|
28
|
-
* For a partial result set, with `done` false, this may change as more rows are read.
|
|
29
|
-
* For a full result, with `done` true, this will not change.
|
|
30
|
-
*/
|
|
31
|
-
get rowCount(): number;
|
|
32
|
-
/**
|
|
33
|
-
* Returns the name of column at the given index (starting at zero).
|
|
34
|
-
*
|
|
35
|
-
* Note that duplicate column names are possible.
|
|
36
|
-
*
|
|
37
|
-
* Will return an error if no part of the result has been read yet.
|
|
38
|
-
*/
|
|
39
|
-
columnName(columnIndex: number): string;
|
|
40
|
-
/**
|
|
41
|
-
* Returns the type of the column at the given index (starting at zero).
|
|
42
|
-
*
|
|
43
|
-
* Will return an error if no part of the result has been read yet.
|
|
44
|
-
*/
|
|
45
|
-
columnType(columnIndex: number): DuckDBType;
|
|
46
|
-
/**
|
|
47
|
-
* Returns the value for the given column and row. Both are zero-indexed.
|
|
48
|
-
*
|
|
49
|
-
* Will return an error if `rowIndex` is not less than the current `rowCount`.
|
|
50
|
-
*/
|
|
51
|
-
value(columnIndex: number, rowIndex: number): DuckDBValue;
|
|
52
|
-
/**
|
|
53
|
-
* Returns true if all rows have been read.
|
|
54
|
-
*/
|
|
55
|
-
get done(): boolean;
|
|
56
|
-
/**
|
|
57
|
-
* Read all rows.
|
|
58
|
-
*/
|
|
59
|
-
readAll(): Promise<void>;
|
|
60
|
-
/**
|
|
61
|
-
* Read rows until at least the given target row count has been met.
|
|
62
|
-
*
|
|
63
|
-
* Note that the resulting row count could be greater than the target, since rows are read in batches, typically of 2048 rows each.
|
|
64
|
-
*/
|
|
65
|
-
readUntil(targetRowCount: number): Promise<void>;
|
|
66
|
-
private read;
|
|
67
|
-
private updateBatchSizeRuns;
|
|
68
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
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;
|
|
@@ -1,18 +0,0 @@
|
|
|
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;
|
|
@@ -1,110 +0,0 @@
|
|
|
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 BigIntDuckDBType = {
|
|
10
|
-
readonly name: 'BIGINT';
|
|
11
|
-
};
|
|
12
|
-
export type BitDuckDBType = {
|
|
13
|
-
readonly name: 'BIT';
|
|
14
|
-
};
|
|
15
|
-
export type BooleanDuckDBType = {
|
|
16
|
-
readonly name: 'BOOLEAN';
|
|
17
|
-
};
|
|
18
|
-
export type BlobDuckDBType = {
|
|
19
|
-
readonly name: 'BLOB';
|
|
20
|
-
};
|
|
21
|
-
export type DateDuckDBType = {
|
|
22
|
-
readonly name: 'DATE';
|
|
23
|
-
};
|
|
24
|
-
export type DoubleDuckDBType = {
|
|
25
|
-
readonly name: 'DOUBLE';
|
|
26
|
-
};
|
|
27
|
-
export type DecimalDuckDBType = {
|
|
28
|
-
readonly name: 'DECIMAL';
|
|
29
|
-
readonly width?: number;
|
|
30
|
-
readonly scale?: number;
|
|
31
|
-
};
|
|
32
|
-
export type EnumDuckDBType = {
|
|
33
|
-
readonly name: 'ENUM';
|
|
34
|
-
};
|
|
35
|
-
export type HugeIntDuckDBType = {
|
|
36
|
-
readonly name: 'HUGEINT';
|
|
37
|
-
};
|
|
38
|
-
export type IntegerDuckDBType = {
|
|
39
|
-
readonly name: 'INTEGER';
|
|
40
|
-
};
|
|
41
|
-
export type IntervalDuckDBType = {
|
|
42
|
-
readonly name: 'INTERVAL';
|
|
43
|
-
};
|
|
44
|
-
export type ListDuckDBType = {
|
|
45
|
-
readonly name: 'LIST';
|
|
46
|
-
readonly valueType: DuckDBType;
|
|
47
|
-
};
|
|
48
|
-
export type MapDuckDBType = {
|
|
49
|
-
readonly name: 'MAP';
|
|
50
|
-
readonly keyType: DuckDBType;
|
|
51
|
-
readonly valueType: DuckDBType;
|
|
52
|
-
};
|
|
53
|
-
export type RealDuckDBType = {
|
|
54
|
-
readonly name: 'REAL';
|
|
55
|
-
};
|
|
56
|
-
export type SmallIntDuckDBType = {
|
|
57
|
-
readonly name: 'SMALLINT';
|
|
58
|
-
};
|
|
59
|
-
export type SQLNullDuckDBType = {
|
|
60
|
-
readonly name: 'SQLNULL';
|
|
61
|
-
};
|
|
62
|
-
export type StructDuckDBType = {
|
|
63
|
-
readonly name: 'STRUCT';
|
|
64
|
-
readonly entries: readonly StructEntry[];
|
|
65
|
-
};
|
|
66
|
-
export type TimeDuckDBType = {
|
|
67
|
-
readonly name: 'TIME';
|
|
68
|
-
};
|
|
69
|
-
export type TimestampDuckDBType = {
|
|
70
|
-
readonly name: 'TIMESTAMP';
|
|
71
|
-
};
|
|
72
|
-
export type TimestampSecondsDuckDBType = {
|
|
73
|
-
readonly name: 'TIMESTAMP_S';
|
|
74
|
-
};
|
|
75
|
-
export type TimestampMillisecondsDuckDBType = {
|
|
76
|
-
readonly name: 'TIMESTAMP_MS';
|
|
77
|
-
};
|
|
78
|
-
export type TimestampNanosecondsDuckDBType = {
|
|
79
|
-
readonly name: 'TIMESTAMP_NS';
|
|
80
|
-
};
|
|
81
|
-
export type TimestampWithTimeZoneDuckDBType = {
|
|
82
|
-
readonly name: 'TIMESTAMP_TZ';
|
|
83
|
-
};
|
|
84
|
-
export type TinyIntDuckDBType = {
|
|
85
|
-
readonly name: 'TINYINT';
|
|
86
|
-
};
|
|
87
|
-
export type UBigIntDuckDBType = {
|
|
88
|
-
readonly name: 'UBIGINT';
|
|
89
|
-
};
|
|
90
|
-
export type UIntegerDuckDBType = {
|
|
91
|
-
readonly name: 'UINTEGER';
|
|
92
|
-
};
|
|
93
|
-
export type USmallIntDuckDBType = {
|
|
94
|
-
readonly name: 'USMALLINT';
|
|
95
|
-
};
|
|
96
|
-
export type UTinyIntDuckDBType = {
|
|
97
|
-
readonly name: 'UTINYINT';
|
|
98
|
-
};
|
|
99
|
-
export type UUIDDuckDBType = {
|
|
100
|
-
readonly name: 'UUID';
|
|
101
|
-
};
|
|
102
|
-
export type UnionDuckDBType = {
|
|
103
|
-
readonly name: 'UNION';
|
|
104
|
-
readonly alternatives: readonly UnionAlternative[];
|
|
105
|
-
};
|
|
106
|
-
export type VarCharDuckDBType = {
|
|
107
|
-
readonly name: 'VARCHAR';
|
|
108
|
-
readonly length?: number;
|
|
109
|
-
};
|
|
110
|
-
export type DuckDBType = BigIntDuckDBType | BitDuckDBType | BooleanDuckDBType | BlobDuckDBType | DateDuckDBType | DoubleDuckDBType | DecimalDuckDBType | EnumDuckDBType | HugeIntDuckDBType | IntegerDuckDBType | IntervalDuckDBType | ListDuckDBType | MapDuckDBType | RealDuckDBType | SmallIntDuckDBType | SQLNullDuckDBType | StructDuckDBType | TimeDuckDBType | TimestampDuckDBType | TimestampSecondsDuckDBType | TimestampMillisecondsDuckDBType | TimestampNanosecondsDuckDBType | TimestampWithTimeZoneDuckDBType | TinyIntDuckDBType | UBigIntDuckDBType | UIntegerDuckDBType | USmallIntDuckDBType | UTinyIntDuckDBType | UUIDDuckDBType | UnionDuckDBType | VarCharDuckDBType;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { BigIntDuckDBType, BitDuckDBType, BlobDuckDBType, BooleanDuckDBType, DateDuckDBType, DecimalDuckDBType, DoubleDuckDBType, DuckDBType, EnumDuckDBType, HugeIntDuckDBType, IntegerDuckDBType, IntervalDuckDBType, ListDuckDBType, MapDuckDBType, RealDuckDBType, SQLNullDuckDBType, SmallIntDuckDBType, StructDuckDBType, StructEntry, TimeDuckDBType, TimestampDuckDBType, TimestampMillisecondsDuckDBType, TimestampNanosecondsDuckDBType, TimestampSecondsDuckDBType, TimestampWithTimeZoneDuckDBType, TinyIntDuckDBType, UBigIntDuckDBType, UIntegerDuckDBType, USmallIntDuckDBType, UTinyIntDuckDBType, UUIDDuckDBType, UnionAlternative, UnionDuckDBType, VarCharDuckDBType } from './DuckDBType';
|
|
2
|
-
export declare class DuckDBTypes {
|
|
3
|
-
private constructor();
|
|
4
|
-
static BIGINT: BigIntDuckDBType;
|
|
5
|
-
static BIT: BitDuckDBType;
|
|
6
|
-
static BOOLEAN: BooleanDuckDBType;
|
|
7
|
-
static BLOB: BlobDuckDBType;
|
|
8
|
-
static DATE: DateDuckDBType;
|
|
9
|
-
static DOUBLE: DoubleDuckDBType;
|
|
10
|
-
private static default_DECIMAL;
|
|
11
|
-
static DECIMAL(width?: number, scale?: number): DecimalDuckDBType;
|
|
12
|
-
static ENUM: EnumDuckDBType;
|
|
13
|
-
static HUGEINT: HugeIntDuckDBType;
|
|
14
|
-
static INTEGER: IntegerDuckDBType;
|
|
15
|
-
static INTERVAL: IntervalDuckDBType;
|
|
16
|
-
static LIST(valueType: DuckDBType): ListDuckDBType;
|
|
17
|
-
static MAP(keyType: DuckDBType, valueType: DuckDBType): MapDuckDBType;
|
|
18
|
-
static REAL: RealDuckDBType;
|
|
19
|
-
static SMALLINT: SmallIntDuckDBType;
|
|
20
|
-
static SQLNULL: SQLNullDuckDBType;
|
|
21
|
-
static STRUCT(entries: readonly StructEntry[]): StructDuckDBType;
|
|
22
|
-
static STRUCT_entry(key: string, valueType: DuckDBType): StructEntry;
|
|
23
|
-
static TIME: TimeDuckDBType;
|
|
24
|
-
static TIMESTAMP: TimestampDuckDBType;
|
|
25
|
-
static TIMESTAMP_S: TimestampSecondsDuckDBType;
|
|
26
|
-
static TIMESTAMP_MS: TimestampMillisecondsDuckDBType;
|
|
27
|
-
static TIMESTAMP_NS: TimestampNanosecondsDuckDBType;
|
|
28
|
-
static TIMESTAMP_TZ: TimestampWithTimeZoneDuckDBType;
|
|
29
|
-
static TINYINT: TinyIntDuckDBType;
|
|
30
|
-
static UBIGINT: UBigIntDuckDBType;
|
|
31
|
-
static UINTEGER: UIntegerDuckDBType;
|
|
32
|
-
static USMALLINT: USmallIntDuckDBType;
|
|
33
|
-
static UTINYINT: UTinyIntDuckDBType;
|
|
34
|
-
static UUID: UUIDDuckDBType;
|
|
35
|
-
static UNION(alternatives: readonly UnionAlternative[]): UnionDuckDBType;
|
|
36
|
-
static UNION_alternative(tag: string, valueType: DuckDBType): UnionAlternative;
|
|
37
|
-
static VARCHAR: VarCharDuckDBType;
|
|
38
|
-
static VARCHAR_withLength(length: number): VarCharDuckDBType;
|
|
39
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { DuckDBDecimalFormatOptions } from '../conversion/stringFromDecimal';
|
|
2
|
-
import { SpecialDuckDBValue } from './SpecialDuckDBValue';
|
|
3
|
-
export declare class DuckDBDecimal extends SpecialDuckDBValue {
|
|
4
|
-
readonly scaledValue: bigint;
|
|
5
|
-
readonly scale: number;
|
|
6
|
-
constructor(scaledValue: bigint, scale: number);
|
|
7
|
-
toDuckDBString(): string;
|
|
8
|
-
/** Returns a string representation appropriate to the host environment's current locale. */
|
|
9
|
-
toLocaleString(locales?: string | string[], options?: DuckDBDecimalFormatOptions): string;
|
|
10
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SpecialDuckDBValue } from './SpecialDuckDBValue';
|
|
2
|
-
export declare class DuckDBInterval extends SpecialDuckDBValue {
|
|
3
|
-
readonly months: number;
|
|
4
|
-
readonly days: number;
|
|
5
|
-
readonly microseconds: bigint;
|
|
6
|
-
constructor(months: number, days: number, microseconds: bigint);
|
|
7
|
-
toDuckDBString(): string;
|
|
8
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DuckDBValue } from './DuckDBValue';
|
|
2
|
-
import { SpecialDuckDBValue } from './SpecialDuckDBValue';
|
|
3
|
-
export declare class DuckDBList extends SpecialDuckDBValue {
|
|
4
|
-
readonly values: readonly DuckDBValue[];
|
|
5
|
-
constructor(values: readonly DuckDBValue[]);
|
|
6
|
-
toDuckDBString(): string;
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DuckDBMapEntry } from './DuckDBMapEntry';
|
|
2
|
-
import { SpecialDuckDBValue } from './SpecialDuckDBValue';
|
|
3
|
-
export declare class DuckDBMap extends SpecialDuckDBValue {
|
|
4
|
-
readonly entries: readonly DuckDBMapEntry[];
|
|
5
|
-
constructor(entries: readonly DuckDBMapEntry[]);
|
|
6
|
-
toDuckDBString(): string;
|
|
7
|
-
}
|