@haybarn/node-api 1.5.3-rc2
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/LICENSE +7 -0
- package/README.md +1224 -0
- package/lib/DuckDBAppender.d.ts +51 -0
- package/lib/DuckDBAppender.js +149 -0
- package/lib/DuckDBBindInfo.d.ts +12 -0
- package/lib/DuckDBBindInfo.js +33 -0
- package/lib/DuckDBClientContext.d.ts +6 -0
- package/lib/DuckDBClientContext.js +17 -0
- package/lib/DuckDBConnection.d.ts +49 -0
- package/lib/DuckDBConnection.js +208 -0
- package/lib/DuckDBDataChunk.d.ts +41 -0
- package/lib/DuckDBDataChunk.js +223 -0
- package/lib/DuckDBExtractedStatements.d.ts +12 -0
- package/lib/DuckDBExtractedStatements.js +31 -0
- package/lib/DuckDBFunctionInfo.d.ts +10 -0
- package/lib/DuckDBFunctionInfo.js +29 -0
- package/lib/DuckDBInstance.d.ts +10 -0
- package/lib/DuckDBInstance.js +30 -0
- package/lib/DuckDBInstanceCache.d.ts +8 -0
- package/lib/DuckDBInstanceCache.js +28 -0
- package/lib/DuckDBLogicalType.d.ts +66 -0
- package/lib/DuckDBLogicalType.js +328 -0
- package/lib/DuckDBMaterializedResult.d.ts +9 -0
- package/lib/DuckDBMaterializedResult.js +24 -0
- package/lib/DuckDBPendingResult.d.ts +18 -0
- package/lib/DuckDBPendingResult.js +60 -0
- package/lib/DuckDBPreparedStatement.d.ts +72 -0
- package/lib/DuckDBPreparedStatement.js +219 -0
- package/lib/DuckDBPreparedStatementCollection.d.ts +4 -0
- package/lib/DuckDBPreparedStatementCollection.js +2 -0
- package/lib/DuckDBPreparedStatementWeakRefCollection.d.ts +9 -0
- package/lib/DuckDBPreparedStatementWeakRefCollection.js +28 -0
- package/lib/DuckDBResult.d.ts +57 -0
- package/lib/DuckDBResult.js +229 -0
- package/lib/DuckDBResultReader.d.ts +68 -0
- package/lib/DuckDBResultReader.js +203 -0
- package/lib/DuckDBScalarFunction.d.ts +33 -0
- package/lib/DuckDBScalarFunction.js +83 -0
- package/lib/DuckDBType.d.ts +373 -0
- package/lib/DuckDBType.js +930 -0
- package/lib/DuckDBTypeId.d.ts +42 -0
- package/lib/DuckDBTypeId.js +47 -0
- package/lib/DuckDBValueConverter.d.ts +3 -0
- package/lib/DuckDBValueConverter.js +2 -0
- package/lib/DuckDBValueConverters.d.ts +47 -0
- package/lib/DuckDBValueConverters.js +214 -0
- package/lib/DuckDBVector.d.ts +596 -0
- package/lib/DuckDBVector.js +2525 -0
- package/lib/JS.d.ts +3 -0
- package/lib/JS.js +2 -0
- package/lib/JSDuckDBValueConverter.d.ts +3 -0
- package/lib/JSDuckDBValueConverter.js +49 -0
- package/lib/Json.d.ts +3 -0
- package/lib/Json.js +2 -0
- package/lib/JsonDuckDBValueConverter.d.ts +3 -0
- package/lib/JsonDuckDBValueConverter.js +49 -0
- package/lib/configurationOptionDescriptions.d.ts +1 -0
- package/lib/configurationOptionDescriptions.js +16 -0
- package/lib/conversion/bytesFromString.d.ts +1 -0
- package/lib/conversion/bytesFromString.js +7 -0
- package/lib/conversion/dateTimeStringConversion.d.ts +20 -0
- package/lib/conversion/dateTimeStringConversion.js +238 -0
- package/lib/conversion/displayStringForDuckDBValue.d.ts +2 -0
- package/lib/conversion/displayStringForDuckDBValue.js +13 -0
- package/lib/conversion/stringFromBlob.d.ts +4 -0
- package/lib/conversion/stringFromBlob.js +45 -0
- package/lib/conversion/stringFromDecimal.d.ts +18 -0
- package/lib/conversion/stringFromDecimal.js +80 -0
- package/lib/convertColumnsFromChunks.d.ts +3 -0
- package/lib/convertColumnsFromChunks.js +16 -0
- package/lib/convertColumnsObjectFromChunks.d.ts +3 -0
- package/lib/convertColumnsObjectFromChunks.js +19 -0
- package/lib/convertRowObjectsFromChunks.d.ts +3 -0
- package/lib/convertRowObjectsFromChunks.js +17 -0
- package/lib/convertRowsFromChunks.d.ts +3 -0
- package/lib/convertRowsFromChunks.js +13 -0
- package/lib/createConfig.d.ts +2 -0
- package/lib/createConfig.js +19 -0
- package/lib/createDuckDBValueConverter.d.ts +3 -0
- package/lib/createDuckDBValueConverter.js +15 -0
- package/lib/createResult.d.ts +3 -0
- package/lib/createResult.js +17 -0
- package/lib/createValue.d.ts +4 -0
- package/lib/createValue.js +222 -0
- package/lib/duckdb.d.ts +33 -0
- package/lib/duckdb.js +54 -0
- package/lib/enums.d.ts +5 -0
- package/lib/enums.js +9 -0
- package/lib/getColumnsFromChunks.d.ts +3 -0
- package/lib/getColumnsFromChunks.js +10 -0
- package/lib/getColumnsObjectFromChunks.d.ts +3 -0
- package/lib/getColumnsObjectFromChunks.js +10 -0
- package/lib/getRowObjectsFromChunks.d.ts +3 -0
- package/lib/getRowObjectsFromChunks.js +10 -0
- package/lib/getRowsFromChunks.d.ts +3 -0
- package/lib/getRowsFromChunks.js +10 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +41 -0
- package/lib/sleep.d.ts +1 -0
- package/lib/sleep.js +8 -0
- package/lib/sql.d.ts +2 -0
- package/lib/sql.js +10 -0
- package/lib/typeForValue.d.ts +3 -0
- package/lib/typeForValue.js +91 -0
- package/lib/values/DuckDBArrayValue.d.ts +7 -0
- package/lib/values/DuckDBArrayValue.js +18 -0
- package/lib/values/DuckDBBitValue.d.ts +16 -0
- package/lib/values/DuckDBBitValue.js +103 -0
- package/lib/values/DuckDBBlobValue.d.ts +8 -0
- package/lib/values/DuckDBBlobValue.js +26 -0
- package/lib/values/DuckDBDateValue.d.ts +16 -0
- package/lib/values/DuckDBDateValue.js +39 -0
- package/lib/values/DuckDBDecimalValue.d.ts +19 -0
- package/lib/values/DuckDBDecimalValue.js +44 -0
- package/lib/values/DuckDBIntervalValue.d.ts +9 -0
- package/lib/values/DuckDBIntervalValue.js +22 -0
- package/lib/values/DuckDBListValue.d.ts +7 -0
- package/lib/values/DuckDBListValue.js +18 -0
- package/lib/values/DuckDBMapValue.d.ts +11 -0
- package/lib/values/DuckDBMapValue.js +18 -0
- package/lib/values/DuckDBStructValue.d.ts +7 -0
- package/lib/values/DuckDBStructValue.js +22 -0
- package/lib/values/DuckDBTimeNSValue.d.ts +9 -0
- package/lib/values/DuckDBTimeNSValue.js +20 -0
- package/lib/values/DuckDBTimeTZValue.d.ts +35 -0
- package/lib/values/DuckDBTimeTZValue.js +65 -0
- package/lib/values/DuckDBTimeValue.d.ts +12 -0
- package/lib/values/DuckDBTimeValue.js +33 -0
- package/lib/values/DuckDBTimestampMillisecondsValue.d.ts +13 -0
- package/lib/values/DuckDBTimestampMillisecondsValue.js +31 -0
- package/lib/values/DuckDBTimestampNanosecondsValue.d.ts +13 -0
- package/lib/values/DuckDBTimestampNanosecondsValue.js +30 -0
- package/lib/values/DuckDBTimestampSecondsValue.d.ts +13 -0
- package/lib/values/DuckDBTimestampSecondsValue.js +30 -0
- package/lib/values/DuckDBTimestampTZValue.d.ts +16 -0
- package/lib/values/DuckDBTimestampTZValue.js +41 -0
- package/lib/values/DuckDBTimestampValue.d.ts +18 -0
- package/lib/values/DuckDBTimestampValue.js +41 -0
- package/lib/values/DuckDBUUIDValue.d.ts +19 -0
- package/lib/values/DuckDBUUIDValue.js +40 -0
- package/lib/values/DuckDBUnionValue.d.ts +8 -0
- package/lib/values/DuckDBUnionValue.js +22 -0
- package/lib/values/DuckDBValue.d.ts +20 -0
- package/lib/values/DuckDBValue.js +2 -0
- package/lib/values/index.d.ts +20 -0
- package/lib/values/index.js +36 -0
- package/lib/version.d.ts +1 -0
- package/lib/version.js +10 -0
- package/package.json +15 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DuckDBResultReader = void 0;
|
|
4
|
+
const convertColumnsFromChunks_1 = require("./convertColumnsFromChunks");
|
|
5
|
+
const convertColumnsObjectFromChunks_1 = require("./convertColumnsObjectFromChunks");
|
|
6
|
+
const convertRowObjectsFromChunks_1 = require("./convertRowObjectsFromChunks");
|
|
7
|
+
const convertRowsFromChunks_1 = require("./convertRowsFromChunks");
|
|
8
|
+
const getColumnsFromChunks_1 = require("./getColumnsFromChunks");
|
|
9
|
+
const getColumnsObjectFromChunks_1 = require("./getColumnsObjectFromChunks");
|
|
10
|
+
const getRowObjectsFromChunks_1 = require("./getRowObjectsFromChunks");
|
|
11
|
+
const getRowsFromChunks_1 = require("./getRowsFromChunks");
|
|
12
|
+
const JSDuckDBValueConverter_1 = require("./JSDuckDBValueConverter");
|
|
13
|
+
const JsonDuckDBValueConverter_1 = require("./JsonDuckDBValueConverter");
|
|
14
|
+
class DuckDBResultReader {
|
|
15
|
+
result;
|
|
16
|
+
chunks;
|
|
17
|
+
chunkSizeRuns;
|
|
18
|
+
currentRowCount_;
|
|
19
|
+
done_;
|
|
20
|
+
constructor(result) {
|
|
21
|
+
this.result = result;
|
|
22
|
+
this.chunks = [];
|
|
23
|
+
this.chunkSizeRuns = [];
|
|
24
|
+
this.currentRowCount_ = 0;
|
|
25
|
+
this.done_ = false;
|
|
26
|
+
}
|
|
27
|
+
get returnType() {
|
|
28
|
+
return this.result.returnType;
|
|
29
|
+
}
|
|
30
|
+
get statementType() {
|
|
31
|
+
return this.result.statementType;
|
|
32
|
+
}
|
|
33
|
+
get columnCount() {
|
|
34
|
+
return this.result.columnCount;
|
|
35
|
+
}
|
|
36
|
+
columnName(columnIndex) {
|
|
37
|
+
return this.result.columnName(columnIndex);
|
|
38
|
+
}
|
|
39
|
+
columnNames() {
|
|
40
|
+
return this.result.columnNames();
|
|
41
|
+
}
|
|
42
|
+
deduplicatedColumnNames() {
|
|
43
|
+
return this.result.deduplicatedColumnNames();
|
|
44
|
+
}
|
|
45
|
+
columnTypeId(columnIndex) {
|
|
46
|
+
return this.result.columnTypeId(columnIndex);
|
|
47
|
+
}
|
|
48
|
+
columnLogicalType(columnIndex) {
|
|
49
|
+
return this.result.columnLogicalType(columnIndex);
|
|
50
|
+
}
|
|
51
|
+
columnType(columnIndex) {
|
|
52
|
+
return this.result.columnType(columnIndex);
|
|
53
|
+
}
|
|
54
|
+
columnTypeJson(columnIndex) {
|
|
55
|
+
return this.result.columnTypeJson(columnIndex);
|
|
56
|
+
}
|
|
57
|
+
columnTypes() {
|
|
58
|
+
return this.result.columnTypes();
|
|
59
|
+
}
|
|
60
|
+
columnTypesJson() {
|
|
61
|
+
return this.result.columnTypesJson();
|
|
62
|
+
}
|
|
63
|
+
columnNamesAndTypesJson() {
|
|
64
|
+
return this.result.columnNamesAndTypesJson();
|
|
65
|
+
}
|
|
66
|
+
columnNameAndTypeObjectsJson() {
|
|
67
|
+
return this.result.columnNameAndTypeObjectsJson();
|
|
68
|
+
}
|
|
69
|
+
get rowsChanged() {
|
|
70
|
+
return this.result.rowsChanged;
|
|
71
|
+
}
|
|
72
|
+
/** Total number of rows read so far. Call `readAll` or `readUntil` to read rows. */
|
|
73
|
+
get currentRowCount() {
|
|
74
|
+
return this.currentRowCount_;
|
|
75
|
+
}
|
|
76
|
+
/** Whether reading is done, that is, there are no more rows to read. */
|
|
77
|
+
get done() {
|
|
78
|
+
return this.done_;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Returns the value for the given column and row. Both are zero-indexed.
|
|
82
|
+
*
|
|
83
|
+
* Will return an error if `rowIndex` is greater than `currentRowCount`.
|
|
84
|
+
*/
|
|
85
|
+
value(columnIndex, rowIndex) {
|
|
86
|
+
if (this.currentRowCount_ === 0) {
|
|
87
|
+
throw Error(`No rows have been read`);
|
|
88
|
+
}
|
|
89
|
+
let chunkIndex = 0;
|
|
90
|
+
let currentRowIndex = rowIndex;
|
|
91
|
+
// Find which run of chunks our row is in.
|
|
92
|
+
// Since chunkSizeRuns shouldn't ever be longer than 2, this should be O(1).
|
|
93
|
+
for (const run of this.chunkSizeRuns) {
|
|
94
|
+
if (currentRowIndex < run.rowCount) {
|
|
95
|
+
// The row we're looking for is in this run.
|
|
96
|
+
// Calculate the chunk index and the row index in that chunk.
|
|
97
|
+
chunkIndex += Math.floor(currentRowIndex / run.chunkSize);
|
|
98
|
+
const rowIndexInChunk = currentRowIndex % run.chunkSize;
|
|
99
|
+
const chunk = this.chunks[chunkIndex];
|
|
100
|
+
return chunk.getColumnVector(columnIndex).getItem(rowIndexInChunk);
|
|
101
|
+
}
|
|
102
|
+
// The row we're looking for is not in this run.
|
|
103
|
+
// Update our counts for this run and move to the next one.
|
|
104
|
+
chunkIndex += run.chunkCount;
|
|
105
|
+
currentRowIndex -= run.rowCount;
|
|
106
|
+
}
|
|
107
|
+
// We didn't find our row. It must have been out of range.
|
|
108
|
+
throw Error(`Row index ${rowIndex} requested, but only ${this.currentRowCount_} row have been read so far.`);
|
|
109
|
+
}
|
|
110
|
+
/** Read all rows. */
|
|
111
|
+
async readAll() {
|
|
112
|
+
return this.fetchChunks();
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Read rows until at least the given target row count has been met.
|
|
116
|
+
*
|
|
117
|
+
* Note that the resulting row count could be greater than the target, since rows are read in chunks, typically of 2048 rows each.
|
|
118
|
+
*/
|
|
119
|
+
async readUntil(targetRowCount) {
|
|
120
|
+
return this.fetchChunks(targetRowCount);
|
|
121
|
+
}
|
|
122
|
+
async fetchChunks(targetRowCount) {
|
|
123
|
+
while (!(this.done_ ||
|
|
124
|
+
(targetRowCount !== undefined &&
|
|
125
|
+
this.currentRowCount_ >= targetRowCount))) {
|
|
126
|
+
const chunk = await this.result.fetchChunk();
|
|
127
|
+
if (chunk && chunk.rowCount > 0) {
|
|
128
|
+
this.updateChunkSizeRuns(chunk);
|
|
129
|
+
this.chunks.push(chunk);
|
|
130
|
+
this.currentRowCount_ += chunk.rowCount;
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
this.done_ = true;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
updateChunkSizeRuns(chunk) {
|
|
138
|
+
if (this.chunkSizeRuns.length > 0) {
|
|
139
|
+
const lastRun = this.chunkSizeRuns[this.chunkSizeRuns.length - 1];
|
|
140
|
+
if (lastRun.chunkSize === chunk.rowCount) {
|
|
141
|
+
// If the new batch is the same size as the last one, just update our last run.
|
|
142
|
+
lastRun.chunkCount += 1;
|
|
143
|
+
lastRun.rowCount += lastRun.chunkSize;
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
// If this is our first batch, or it's a different size, create a new run.
|
|
148
|
+
this.chunkSizeRuns.push({
|
|
149
|
+
chunkCount: 1,
|
|
150
|
+
chunkSize: chunk.rowCount,
|
|
151
|
+
rowCount: chunk.rowCount,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
getColumns() {
|
|
155
|
+
return (0, getColumnsFromChunks_1.getColumnsFromChunks)(this.chunks);
|
|
156
|
+
}
|
|
157
|
+
convertColumns(converter) {
|
|
158
|
+
return (0, convertColumnsFromChunks_1.convertColumnsFromChunks)(this.chunks, converter);
|
|
159
|
+
}
|
|
160
|
+
getColumnsJS() {
|
|
161
|
+
return this.convertColumns(JSDuckDBValueConverter_1.JSDuckDBValueConverter);
|
|
162
|
+
}
|
|
163
|
+
getColumnsJson() {
|
|
164
|
+
return this.convertColumns(JsonDuckDBValueConverter_1.JsonDuckDBValueConverter);
|
|
165
|
+
}
|
|
166
|
+
getColumnsObject() {
|
|
167
|
+
return (0, getColumnsObjectFromChunks_1.getColumnsObjectFromChunks)(this.chunks, this.deduplicatedColumnNames());
|
|
168
|
+
}
|
|
169
|
+
convertColumnsObject(converter) {
|
|
170
|
+
return (0, convertColumnsObjectFromChunks_1.convertColumnsObjectFromChunks)(this.chunks, this.deduplicatedColumnNames(), converter);
|
|
171
|
+
}
|
|
172
|
+
getColumnsObjectJS() {
|
|
173
|
+
return this.convertColumnsObject(JSDuckDBValueConverter_1.JSDuckDBValueConverter);
|
|
174
|
+
}
|
|
175
|
+
getColumnsObjectJson() {
|
|
176
|
+
return this.convertColumnsObject(JsonDuckDBValueConverter_1.JsonDuckDBValueConverter);
|
|
177
|
+
}
|
|
178
|
+
getRows() {
|
|
179
|
+
return (0, getRowsFromChunks_1.getRowsFromChunks)(this.chunks);
|
|
180
|
+
}
|
|
181
|
+
convertRows(converter) {
|
|
182
|
+
return (0, convertRowsFromChunks_1.convertRowsFromChunks)(this.chunks, converter);
|
|
183
|
+
}
|
|
184
|
+
getRowsJS() {
|
|
185
|
+
return this.convertRows(JSDuckDBValueConverter_1.JSDuckDBValueConverter);
|
|
186
|
+
}
|
|
187
|
+
getRowsJson() {
|
|
188
|
+
return this.convertRows(JsonDuckDBValueConverter_1.JsonDuckDBValueConverter);
|
|
189
|
+
}
|
|
190
|
+
getRowObjects() {
|
|
191
|
+
return (0, getRowObjectsFromChunks_1.getRowObjectsFromChunks)(this.chunks, this.deduplicatedColumnNames());
|
|
192
|
+
}
|
|
193
|
+
convertRowObjects(converter) {
|
|
194
|
+
return (0, convertRowObjectsFromChunks_1.convertRowObjectsFromChunks)(this.chunks, this.deduplicatedColumnNames(), converter);
|
|
195
|
+
}
|
|
196
|
+
getRowObjectsJS() {
|
|
197
|
+
return this.convertRowObjects(JSDuckDBValueConverter_1.JSDuckDBValueConverter);
|
|
198
|
+
}
|
|
199
|
+
getRowObjectsJson() {
|
|
200
|
+
return this.convertRowObjects(JsonDuckDBValueConverter_1.JsonDuckDBValueConverter);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
exports.DuckDBResultReader = DuckDBResultReader;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import duckdb from '@haybarn/node-bindings';
|
|
2
|
+
import { DuckDBDataChunk } from './DuckDBDataChunk';
|
|
3
|
+
import { DuckDBFunctionInfo } from './DuckDBFunctionInfo';
|
|
4
|
+
import { DuckDBType } from './DuckDBType';
|
|
5
|
+
import { DuckDBVector } from './DuckDBVector';
|
|
6
|
+
import { DuckDBBindInfo } from './DuckDBBindInfo';
|
|
7
|
+
export type DuckDBScalarBindFunction = (bindInfo: DuckDBBindInfo) => void;
|
|
8
|
+
export type DuckDBScalarMainFunction = (functionInfo: DuckDBFunctionInfo, inputDataChunk: DuckDBDataChunk, outputVector: DuckDBVector) => void;
|
|
9
|
+
export declare class DuckDBScalarFunction {
|
|
10
|
+
readonly scalar_function: duckdb.ScalarFunction;
|
|
11
|
+
constructor();
|
|
12
|
+
static create({ name, bindFunction, mainFunction, returnType, parameterTypes, varArgsType, specialHandling, volatile, extraInfo, }: {
|
|
13
|
+
name: string;
|
|
14
|
+
bindFunction?: DuckDBScalarBindFunction;
|
|
15
|
+
mainFunction: DuckDBScalarMainFunction;
|
|
16
|
+
returnType: DuckDBType;
|
|
17
|
+
parameterTypes?: readonly DuckDBType[];
|
|
18
|
+
varArgsType?: DuckDBType;
|
|
19
|
+
specialHandling?: boolean;
|
|
20
|
+
volatile?: boolean;
|
|
21
|
+
extraInfo?: object;
|
|
22
|
+
}): DuckDBScalarFunction;
|
|
23
|
+
destroySync(): void;
|
|
24
|
+
setName(name: string): void;
|
|
25
|
+
setBindFunction(bindFunction: DuckDBScalarBindFunction): void;
|
|
26
|
+
setMainFunction(mainFunction: DuckDBScalarMainFunction): void;
|
|
27
|
+
setReturnType(returnType: DuckDBType): void;
|
|
28
|
+
addParameter(parameterType: DuckDBType): void;
|
|
29
|
+
setVarArgs(varArgsType: DuckDBType): void;
|
|
30
|
+
setSpecialHandling(): void;
|
|
31
|
+
setVolatile(): void;
|
|
32
|
+
setExtraInfo(extraInfo: object): void;
|
|
33
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DuckDBScalarFunction = void 0;
|
|
7
|
+
const node_bindings_1 = __importDefault(require("@haybarn/node-bindings"));
|
|
8
|
+
const DuckDBDataChunk_1 = require("./DuckDBDataChunk");
|
|
9
|
+
const DuckDBFunctionInfo_1 = require("./DuckDBFunctionInfo");
|
|
10
|
+
const DuckDBVector_1 = require("./DuckDBVector");
|
|
11
|
+
const DuckDBBindInfo_1 = require("./DuckDBBindInfo");
|
|
12
|
+
class DuckDBScalarFunction {
|
|
13
|
+
scalar_function;
|
|
14
|
+
constructor() {
|
|
15
|
+
this.scalar_function = node_bindings_1.default.create_scalar_function();
|
|
16
|
+
}
|
|
17
|
+
static create({ name, bindFunction, mainFunction, returnType, parameterTypes, varArgsType, specialHandling, volatile, extraInfo, }) {
|
|
18
|
+
const scalarFunction = new DuckDBScalarFunction();
|
|
19
|
+
scalarFunction.setName(name);
|
|
20
|
+
if (bindFunction) {
|
|
21
|
+
scalarFunction.setBindFunction(bindFunction);
|
|
22
|
+
}
|
|
23
|
+
scalarFunction.setMainFunction(mainFunction);
|
|
24
|
+
scalarFunction.setReturnType(returnType);
|
|
25
|
+
if (parameterTypes) {
|
|
26
|
+
for (const parameterType of parameterTypes) {
|
|
27
|
+
scalarFunction.addParameter(parameterType);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if (varArgsType) {
|
|
31
|
+
scalarFunction.setVarArgs(varArgsType);
|
|
32
|
+
}
|
|
33
|
+
if (specialHandling) {
|
|
34
|
+
scalarFunction.setSpecialHandling();
|
|
35
|
+
}
|
|
36
|
+
if (volatile) {
|
|
37
|
+
scalarFunction.setVolatile();
|
|
38
|
+
}
|
|
39
|
+
if (extraInfo) {
|
|
40
|
+
scalarFunction.setExtraInfo(extraInfo);
|
|
41
|
+
}
|
|
42
|
+
return scalarFunction;
|
|
43
|
+
}
|
|
44
|
+
destroySync() {
|
|
45
|
+
node_bindings_1.default.destroy_scalar_function_sync(this.scalar_function);
|
|
46
|
+
}
|
|
47
|
+
setName(name) {
|
|
48
|
+
node_bindings_1.default.scalar_function_set_name(this.scalar_function, name);
|
|
49
|
+
}
|
|
50
|
+
setBindFunction(bindFunction) {
|
|
51
|
+
node_bindings_1.default.scalar_function_set_bind(this.scalar_function, (info) => {
|
|
52
|
+
const bindInfo = new DuckDBBindInfo_1.DuckDBBindInfo(info);
|
|
53
|
+
bindFunction(bindInfo);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
setMainFunction(mainFunction) {
|
|
57
|
+
node_bindings_1.default.scalar_function_set_function(this.scalar_function, (info, input, output) => {
|
|
58
|
+
const functionInfo = new DuckDBFunctionInfo_1.DuckDBFunctionInfo(info);
|
|
59
|
+
const inputDataChunk = new DuckDBDataChunk_1.DuckDBDataChunk(input);
|
|
60
|
+
const outputVector = DuckDBVector_1.DuckDBVector.create(output, inputDataChunk.rowCount);
|
|
61
|
+
mainFunction(functionInfo, inputDataChunk, outputVector);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
setReturnType(returnType) {
|
|
65
|
+
node_bindings_1.default.scalar_function_set_return_type(this.scalar_function, returnType.toLogicalType().logical_type);
|
|
66
|
+
}
|
|
67
|
+
addParameter(parameterType) {
|
|
68
|
+
node_bindings_1.default.scalar_function_add_parameter(this.scalar_function, parameterType.toLogicalType().logical_type);
|
|
69
|
+
}
|
|
70
|
+
setVarArgs(varArgsType) {
|
|
71
|
+
node_bindings_1.default.scalar_function_set_varargs(this.scalar_function, varArgsType.toLogicalType().logical_type);
|
|
72
|
+
}
|
|
73
|
+
setSpecialHandling() {
|
|
74
|
+
node_bindings_1.default.scalar_function_set_special_handling(this.scalar_function);
|
|
75
|
+
}
|
|
76
|
+
setVolatile() {
|
|
77
|
+
node_bindings_1.default.scalar_function_set_volatile(this.scalar_function);
|
|
78
|
+
}
|
|
79
|
+
setExtraInfo(extraInfo) {
|
|
80
|
+
node_bindings_1.default.scalar_function_set_extra_info(this.scalar_function, extraInfo);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
exports.DuckDBScalarFunction = DuckDBScalarFunction;
|
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
import { DuckDBLogicalType } from './DuckDBLogicalType';
|
|
2
|
+
import { DuckDBTypeId } from './DuckDBTypeId';
|
|
3
|
+
import { Json } from './Json';
|
|
4
|
+
import { DuckDBDateValue, DuckDBTimestampMillisecondsValue, DuckDBTimestampNanosecondsValue, DuckDBTimestampSecondsValue, DuckDBTimestampTZValue, DuckDBTimestampValue, DuckDBTimeTZValue, DuckDBTimeValue, DuckDBUUIDValue } from './values';
|
|
5
|
+
export declare abstract class BaseDuckDBType<T extends DuckDBTypeId> {
|
|
6
|
+
readonly typeId: T;
|
|
7
|
+
readonly alias?: string;
|
|
8
|
+
protected constructor(typeId: T, alias?: string);
|
|
9
|
+
toString(): string;
|
|
10
|
+
toLogicalType(): DuckDBLogicalType;
|
|
11
|
+
toJson(): Json;
|
|
12
|
+
}
|
|
13
|
+
export declare class DuckDBBooleanType extends BaseDuckDBType<DuckDBTypeId.BOOLEAN> {
|
|
14
|
+
constructor(alias?: string);
|
|
15
|
+
static readonly instance: DuckDBBooleanType;
|
|
16
|
+
static create(alias?: string): DuckDBBooleanType;
|
|
17
|
+
}
|
|
18
|
+
export declare const BOOLEAN: DuckDBBooleanType;
|
|
19
|
+
export declare class DuckDBTinyIntType extends BaseDuckDBType<DuckDBTypeId.TINYINT> {
|
|
20
|
+
constructor(alias?: string);
|
|
21
|
+
static readonly instance: DuckDBTinyIntType;
|
|
22
|
+
static create(alias?: string): DuckDBTinyIntType;
|
|
23
|
+
static readonly Max: number;
|
|
24
|
+
static readonly Min: number;
|
|
25
|
+
get max(): number;
|
|
26
|
+
get min(): number;
|
|
27
|
+
}
|
|
28
|
+
export declare const TINYINT: DuckDBTinyIntType;
|
|
29
|
+
export declare class DuckDBSmallIntType extends BaseDuckDBType<DuckDBTypeId.SMALLINT> {
|
|
30
|
+
constructor(alias?: string);
|
|
31
|
+
static readonly instance: DuckDBSmallIntType;
|
|
32
|
+
static create(alias?: string): DuckDBSmallIntType;
|
|
33
|
+
static readonly Max: number;
|
|
34
|
+
static readonly Min: number;
|
|
35
|
+
get max(): number;
|
|
36
|
+
get min(): number;
|
|
37
|
+
}
|
|
38
|
+
export declare const SMALLINT: DuckDBSmallIntType;
|
|
39
|
+
export declare class DuckDBIntegerType extends BaseDuckDBType<DuckDBTypeId.INTEGER> {
|
|
40
|
+
constructor(alias?: string);
|
|
41
|
+
static readonly instance: DuckDBIntegerType;
|
|
42
|
+
static create(alias?: string): DuckDBIntegerType;
|
|
43
|
+
static readonly Max: number;
|
|
44
|
+
static readonly Min: number;
|
|
45
|
+
get max(): number;
|
|
46
|
+
get min(): number;
|
|
47
|
+
}
|
|
48
|
+
export declare const INTEGER: DuckDBIntegerType;
|
|
49
|
+
export declare class DuckDBBigIntType extends BaseDuckDBType<DuckDBTypeId.BIGINT> {
|
|
50
|
+
constructor(alias?: string);
|
|
51
|
+
static readonly instance: DuckDBBigIntType;
|
|
52
|
+
static create(alias?: string): DuckDBBigIntType;
|
|
53
|
+
static readonly Max: bigint;
|
|
54
|
+
static readonly Min: bigint;
|
|
55
|
+
get max(): bigint;
|
|
56
|
+
get min(): bigint;
|
|
57
|
+
}
|
|
58
|
+
export declare const BIGINT: DuckDBBigIntType;
|
|
59
|
+
export declare class DuckDBUTinyIntType extends BaseDuckDBType<DuckDBTypeId.UTINYINT> {
|
|
60
|
+
constructor(alias?: string);
|
|
61
|
+
static readonly instance: DuckDBUTinyIntType;
|
|
62
|
+
static create(alias?: string): DuckDBUTinyIntType;
|
|
63
|
+
static readonly Max: number;
|
|
64
|
+
static readonly Min = 0;
|
|
65
|
+
get max(): number;
|
|
66
|
+
get min(): number;
|
|
67
|
+
}
|
|
68
|
+
export declare const UTINYINT: DuckDBUTinyIntType;
|
|
69
|
+
export declare class DuckDBUSmallIntType extends BaseDuckDBType<DuckDBTypeId.USMALLINT> {
|
|
70
|
+
constructor(alias?: string);
|
|
71
|
+
static readonly instance: DuckDBUSmallIntType;
|
|
72
|
+
static create(alias?: string): DuckDBUSmallIntType;
|
|
73
|
+
static readonly Max: number;
|
|
74
|
+
static readonly Min = 0;
|
|
75
|
+
get max(): number;
|
|
76
|
+
get min(): number;
|
|
77
|
+
}
|
|
78
|
+
export declare const USMALLINT: DuckDBUSmallIntType;
|
|
79
|
+
export declare class DuckDBUIntegerType extends BaseDuckDBType<DuckDBTypeId.UINTEGER> {
|
|
80
|
+
constructor(alias?: string);
|
|
81
|
+
static readonly instance: DuckDBUIntegerType;
|
|
82
|
+
static create(alias?: string): DuckDBUIntegerType;
|
|
83
|
+
static readonly Max: number;
|
|
84
|
+
static readonly Min = 0;
|
|
85
|
+
get max(): number;
|
|
86
|
+
get min(): number;
|
|
87
|
+
}
|
|
88
|
+
export declare const UINTEGER: DuckDBUIntegerType;
|
|
89
|
+
export declare class DuckDBUBigIntType extends BaseDuckDBType<DuckDBTypeId.UBIGINT> {
|
|
90
|
+
constructor(alias?: string);
|
|
91
|
+
static readonly instance: DuckDBUBigIntType;
|
|
92
|
+
static create(alias?: string): DuckDBUBigIntType;
|
|
93
|
+
static readonly Max: bigint;
|
|
94
|
+
static readonly Min: bigint;
|
|
95
|
+
get max(): bigint;
|
|
96
|
+
get min(): bigint;
|
|
97
|
+
}
|
|
98
|
+
export declare const UBIGINT: DuckDBUBigIntType;
|
|
99
|
+
export declare class DuckDBFloatType extends BaseDuckDBType<DuckDBTypeId.FLOAT> {
|
|
100
|
+
constructor(alias?: string);
|
|
101
|
+
static readonly instance: DuckDBFloatType;
|
|
102
|
+
static create(alias?: string): DuckDBFloatType;
|
|
103
|
+
static readonly Max: number;
|
|
104
|
+
static readonly Min: number;
|
|
105
|
+
get max(): number;
|
|
106
|
+
get min(): number;
|
|
107
|
+
}
|
|
108
|
+
export declare const FLOAT: DuckDBFloatType;
|
|
109
|
+
export declare class DuckDBDoubleType extends BaseDuckDBType<DuckDBTypeId.DOUBLE> {
|
|
110
|
+
constructor(alias?: string);
|
|
111
|
+
static readonly instance: DuckDBDoubleType;
|
|
112
|
+
static create(alias?: string): DuckDBDoubleType;
|
|
113
|
+
static readonly Max: number;
|
|
114
|
+
static readonly Min: number;
|
|
115
|
+
get max(): number;
|
|
116
|
+
get min(): number;
|
|
117
|
+
}
|
|
118
|
+
export declare const DOUBLE: DuckDBDoubleType;
|
|
119
|
+
export declare class DuckDBTimestampType extends BaseDuckDBType<DuckDBTypeId.TIMESTAMP> {
|
|
120
|
+
constructor(alias?: string);
|
|
121
|
+
static readonly instance: DuckDBTimestampType;
|
|
122
|
+
static create(alias?: string): DuckDBTimestampType;
|
|
123
|
+
get epoch(): DuckDBTimestampValue;
|
|
124
|
+
get max(): DuckDBTimestampValue;
|
|
125
|
+
get min(): DuckDBTimestampValue;
|
|
126
|
+
get posInf(): DuckDBTimestampValue;
|
|
127
|
+
get negInf(): DuckDBTimestampValue;
|
|
128
|
+
}
|
|
129
|
+
export declare const TIMESTAMP: DuckDBTimestampType;
|
|
130
|
+
export type DuckDBTimestampMicrosecondsType = DuckDBTimestampType;
|
|
131
|
+
export declare const DuckDBTimestampMicrosecondsType: typeof DuckDBTimestampType;
|
|
132
|
+
export declare class DuckDBDateType extends BaseDuckDBType<DuckDBTypeId.DATE> {
|
|
133
|
+
constructor(alias?: string);
|
|
134
|
+
static readonly instance: DuckDBDateType;
|
|
135
|
+
static create(alias?: string): DuckDBDateType;
|
|
136
|
+
get epoch(): DuckDBDateValue;
|
|
137
|
+
get max(): DuckDBDateValue;
|
|
138
|
+
get min(): DuckDBDateValue;
|
|
139
|
+
get posInf(): DuckDBDateValue;
|
|
140
|
+
get negInf(): DuckDBDateValue;
|
|
141
|
+
}
|
|
142
|
+
export declare const DATE: DuckDBDateType;
|
|
143
|
+
export declare class DuckDBTimeType extends BaseDuckDBType<DuckDBTypeId.TIME> {
|
|
144
|
+
constructor(alias?: string);
|
|
145
|
+
static readonly instance: DuckDBTimeType;
|
|
146
|
+
static create(alias?: string): DuckDBTimeType;
|
|
147
|
+
get max(): DuckDBTimeValue;
|
|
148
|
+
get min(): DuckDBTimeValue;
|
|
149
|
+
}
|
|
150
|
+
export declare const TIME: DuckDBTimeType;
|
|
151
|
+
export declare class DuckDBIntervalType extends BaseDuckDBType<DuckDBTypeId.INTERVAL> {
|
|
152
|
+
constructor(alias?: string);
|
|
153
|
+
static readonly instance: DuckDBIntervalType;
|
|
154
|
+
static create(alias?: string): DuckDBIntervalType;
|
|
155
|
+
}
|
|
156
|
+
export declare const INTERVAL: DuckDBIntervalType;
|
|
157
|
+
export declare class DuckDBHugeIntType extends BaseDuckDBType<DuckDBTypeId.HUGEINT> {
|
|
158
|
+
constructor(alias?: string);
|
|
159
|
+
static readonly instance: DuckDBHugeIntType;
|
|
160
|
+
static create(alias?: string): DuckDBHugeIntType;
|
|
161
|
+
static readonly Max: bigint;
|
|
162
|
+
static readonly Min: bigint;
|
|
163
|
+
get max(): bigint;
|
|
164
|
+
get min(): bigint;
|
|
165
|
+
}
|
|
166
|
+
export declare const HUGEINT: DuckDBHugeIntType;
|
|
167
|
+
export declare class DuckDBUHugeIntType extends BaseDuckDBType<DuckDBTypeId.UHUGEINT> {
|
|
168
|
+
constructor(alias?: string);
|
|
169
|
+
static readonly instance: DuckDBUHugeIntType;
|
|
170
|
+
static create(alias?: string): DuckDBUHugeIntType;
|
|
171
|
+
static readonly Max: bigint;
|
|
172
|
+
static readonly Min: bigint;
|
|
173
|
+
get max(): bigint;
|
|
174
|
+
get min(): bigint;
|
|
175
|
+
}
|
|
176
|
+
export declare const UHUGEINT: DuckDBUHugeIntType;
|
|
177
|
+
export declare class DuckDBVarCharType extends BaseDuckDBType<DuckDBTypeId.VARCHAR> {
|
|
178
|
+
constructor(alias?: string);
|
|
179
|
+
static readonly instance: DuckDBVarCharType;
|
|
180
|
+
static create(alias?: string): DuckDBVarCharType;
|
|
181
|
+
}
|
|
182
|
+
export declare const VARCHAR: DuckDBVarCharType;
|
|
183
|
+
export declare class DuckDBBlobType extends BaseDuckDBType<DuckDBTypeId.BLOB> {
|
|
184
|
+
constructor(alias?: string);
|
|
185
|
+
static readonly instance: DuckDBBlobType;
|
|
186
|
+
static create(alias?: string): DuckDBBlobType;
|
|
187
|
+
}
|
|
188
|
+
export declare const BLOB: DuckDBBlobType;
|
|
189
|
+
export declare class DuckDBDecimalType extends BaseDuckDBType<DuckDBTypeId.DECIMAL> {
|
|
190
|
+
readonly width: number;
|
|
191
|
+
readonly scale: number;
|
|
192
|
+
constructor(width: number, scale: number, alias?: string);
|
|
193
|
+
toString(): string;
|
|
194
|
+
toLogicalType(): DuckDBLogicalType;
|
|
195
|
+
toJson(): Json;
|
|
196
|
+
static readonly default: DuckDBDecimalType;
|
|
197
|
+
}
|
|
198
|
+
export declare function DECIMAL(width?: number, scale?: number, alias?: string): DuckDBDecimalType;
|
|
199
|
+
export declare class DuckDBTimestampSecondsType extends BaseDuckDBType<DuckDBTypeId.TIMESTAMP_S> {
|
|
200
|
+
constructor(alias?: string);
|
|
201
|
+
static readonly instance: DuckDBTimestampSecondsType;
|
|
202
|
+
static create(alias?: string): DuckDBTimestampSecondsType;
|
|
203
|
+
get epoch(): DuckDBTimestampSecondsValue;
|
|
204
|
+
get max(): DuckDBTimestampSecondsValue;
|
|
205
|
+
get min(): DuckDBTimestampSecondsValue;
|
|
206
|
+
get posInf(): DuckDBTimestampSecondsValue;
|
|
207
|
+
get negInf(): DuckDBTimestampSecondsValue;
|
|
208
|
+
}
|
|
209
|
+
export declare const TIMESTAMP_S: DuckDBTimestampSecondsType;
|
|
210
|
+
export declare class DuckDBTimestampMillisecondsType extends BaseDuckDBType<DuckDBTypeId.TIMESTAMP_MS> {
|
|
211
|
+
constructor(alias?: string);
|
|
212
|
+
static readonly instance: DuckDBTimestampMillisecondsType;
|
|
213
|
+
static create(alias?: string): DuckDBTimestampMillisecondsType;
|
|
214
|
+
get epoch(): DuckDBTimestampMillisecondsValue;
|
|
215
|
+
get max(): DuckDBTimestampMillisecondsValue;
|
|
216
|
+
get min(): DuckDBTimestampMillisecondsValue;
|
|
217
|
+
get posInf(): DuckDBTimestampMillisecondsValue;
|
|
218
|
+
get negInf(): DuckDBTimestampMillisecondsValue;
|
|
219
|
+
}
|
|
220
|
+
export declare const TIMESTAMP_MS: DuckDBTimestampMillisecondsType;
|
|
221
|
+
export declare class DuckDBTimestampNanosecondsType extends BaseDuckDBType<DuckDBTypeId.TIMESTAMP_NS> {
|
|
222
|
+
constructor(alias?: string);
|
|
223
|
+
static readonly instance: DuckDBTimestampNanosecondsType;
|
|
224
|
+
static create(alias?: string): DuckDBTimestampNanosecondsType;
|
|
225
|
+
get epoch(): DuckDBTimestampNanosecondsValue;
|
|
226
|
+
get max(): DuckDBTimestampNanosecondsValue;
|
|
227
|
+
get min(): DuckDBTimestampNanosecondsValue;
|
|
228
|
+
get posInf(): DuckDBTimestampNanosecondsValue;
|
|
229
|
+
get negInf(): DuckDBTimestampNanosecondsValue;
|
|
230
|
+
}
|
|
231
|
+
export declare const TIMESTAMP_NS: DuckDBTimestampNanosecondsType;
|
|
232
|
+
export declare class DuckDBEnumType extends BaseDuckDBType<DuckDBTypeId.ENUM> {
|
|
233
|
+
readonly values: readonly string[];
|
|
234
|
+
readonly valueIndexes: Readonly<Record<string, number>>;
|
|
235
|
+
readonly internalTypeId: DuckDBTypeId;
|
|
236
|
+
constructor(values: readonly string[], internalTypeId: DuckDBTypeId, alias?: string);
|
|
237
|
+
indexForValue(value: string): number;
|
|
238
|
+
toString(): string;
|
|
239
|
+
toLogicalType(): DuckDBLogicalType;
|
|
240
|
+
toJson(): Json;
|
|
241
|
+
}
|
|
242
|
+
export declare function ENUM8(values: readonly string[], alias?: string): DuckDBEnumType;
|
|
243
|
+
export declare function ENUM16(values: readonly string[], alias?: string): DuckDBEnumType;
|
|
244
|
+
export declare function ENUM32(values: readonly string[], alias?: string): DuckDBEnumType;
|
|
245
|
+
export declare function ENUM(values: readonly string[], alias?: string): DuckDBEnumType;
|
|
246
|
+
export declare class DuckDBListType extends BaseDuckDBType<DuckDBTypeId.LIST> {
|
|
247
|
+
readonly valueType: DuckDBType;
|
|
248
|
+
constructor(valueType: DuckDBType, alias?: string);
|
|
249
|
+
toString(): string;
|
|
250
|
+
toLogicalType(): DuckDBLogicalType;
|
|
251
|
+
toJson(): Json;
|
|
252
|
+
}
|
|
253
|
+
export declare function LIST(valueType: DuckDBType, alias?: string): DuckDBListType;
|
|
254
|
+
export declare class DuckDBStructType extends BaseDuckDBType<DuckDBTypeId.STRUCT> {
|
|
255
|
+
readonly entryNames: readonly string[];
|
|
256
|
+
readonly entryTypes: readonly DuckDBType[];
|
|
257
|
+
readonly entryIndexes: Readonly<Record<string, number>>;
|
|
258
|
+
constructor(entryNames: readonly string[], entryTypes: readonly DuckDBType[], alias?: string);
|
|
259
|
+
get entryCount(): number;
|
|
260
|
+
indexForEntry(entryName: string): number;
|
|
261
|
+
typeForEntry(entryName: string): DuckDBType;
|
|
262
|
+
toString(): string;
|
|
263
|
+
toLogicalType(): DuckDBLogicalType;
|
|
264
|
+
toJson(): Json;
|
|
265
|
+
}
|
|
266
|
+
export declare function STRUCT(entries: Record<string, DuckDBType>, alias?: string): DuckDBStructType;
|
|
267
|
+
export declare class DuckDBMapType extends BaseDuckDBType<DuckDBTypeId.MAP> {
|
|
268
|
+
readonly keyType: DuckDBType;
|
|
269
|
+
readonly valueType: DuckDBType;
|
|
270
|
+
constructor(keyType: DuckDBType, valueType: DuckDBType, alias?: string);
|
|
271
|
+
toString(): string;
|
|
272
|
+
toLogicalType(): DuckDBLogicalType;
|
|
273
|
+
toJson(): Json;
|
|
274
|
+
}
|
|
275
|
+
export declare function MAP(keyType: DuckDBType, valueType: DuckDBType, alias?: string): DuckDBMapType;
|
|
276
|
+
export declare class DuckDBArrayType extends BaseDuckDBType<DuckDBTypeId.ARRAY> {
|
|
277
|
+
readonly valueType: DuckDBType;
|
|
278
|
+
readonly length: number;
|
|
279
|
+
constructor(valueType: DuckDBType, length: number, alias?: string);
|
|
280
|
+
toString(): string;
|
|
281
|
+
toLogicalType(): DuckDBLogicalType;
|
|
282
|
+
toJson(): Json;
|
|
283
|
+
}
|
|
284
|
+
export declare function ARRAY(valueType: DuckDBType, length: number, alias?: string): DuckDBArrayType;
|
|
285
|
+
export declare class DuckDBUUIDType extends BaseDuckDBType<DuckDBTypeId.UUID> {
|
|
286
|
+
constructor(alias?: string);
|
|
287
|
+
static readonly instance: DuckDBUUIDType;
|
|
288
|
+
static create(alias?: string): DuckDBUUIDType;
|
|
289
|
+
get max(): DuckDBUUIDValue;
|
|
290
|
+
get min(): DuckDBUUIDValue;
|
|
291
|
+
}
|
|
292
|
+
export declare const UUID: DuckDBUUIDType;
|
|
293
|
+
export declare class DuckDBUnionType extends BaseDuckDBType<DuckDBTypeId.UNION> {
|
|
294
|
+
readonly memberTags: readonly string[];
|
|
295
|
+
readonly tagMemberIndexes: Readonly<Record<string, number>>;
|
|
296
|
+
readonly memberTypes: readonly DuckDBType[];
|
|
297
|
+
constructor(memberTags: readonly string[], memberTypes: readonly DuckDBType[], alias?: string);
|
|
298
|
+
memberIndexForTag(tag: string): number;
|
|
299
|
+
memberTypeForTag(tag: string): DuckDBType;
|
|
300
|
+
get memberCount(): number;
|
|
301
|
+
toString(): string;
|
|
302
|
+
toLogicalType(): DuckDBLogicalType;
|
|
303
|
+
toJson(): Json;
|
|
304
|
+
}
|
|
305
|
+
export declare function UNION(members: Record<string, DuckDBType>, alias?: string): DuckDBUnionType;
|
|
306
|
+
export declare class DuckDBBitType extends BaseDuckDBType<DuckDBTypeId.BIT> {
|
|
307
|
+
constructor(alias?: string);
|
|
308
|
+
static readonly instance: DuckDBBitType;
|
|
309
|
+
static create(alias?: string): DuckDBBitType;
|
|
310
|
+
}
|
|
311
|
+
export declare const BIT: DuckDBBitType;
|
|
312
|
+
export declare class DuckDBTimeTZType extends BaseDuckDBType<DuckDBTypeId.TIME_TZ> {
|
|
313
|
+
constructor(alias?: string);
|
|
314
|
+
toString(): string;
|
|
315
|
+
static readonly instance: DuckDBTimeTZType;
|
|
316
|
+
static create(alias?: string): DuckDBTimeTZType;
|
|
317
|
+
get max(): DuckDBTimeTZValue;
|
|
318
|
+
get min(): DuckDBTimeTZValue;
|
|
319
|
+
}
|
|
320
|
+
export declare const TIMETZ: DuckDBTimeTZType;
|
|
321
|
+
export declare class DuckDBTimestampTZType extends BaseDuckDBType<DuckDBTypeId.TIMESTAMP_TZ> {
|
|
322
|
+
constructor(alias?: string);
|
|
323
|
+
toString(): string;
|
|
324
|
+
static readonly instance: DuckDBTimestampTZType;
|
|
325
|
+
static create(alias?: string): DuckDBTimestampTZType;
|
|
326
|
+
get epoch(): DuckDBTimestampTZValue;
|
|
327
|
+
get max(): DuckDBTimestampTZValue;
|
|
328
|
+
get min(): DuckDBTimestampTZValue;
|
|
329
|
+
get posInf(): DuckDBTimestampTZValue;
|
|
330
|
+
get negInf(): DuckDBTimestampTZValue;
|
|
331
|
+
}
|
|
332
|
+
export declare const TIMESTAMPTZ: DuckDBTimestampTZType;
|
|
333
|
+
export declare class DuckDBAnyType extends BaseDuckDBType<DuckDBTypeId.ANY> {
|
|
334
|
+
constructor(alias?: string);
|
|
335
|
+
static readonly instance: DuckDBAnyType;
|
|
336
|
+
static create(alias?: string): DuckDBAnyType;
|
|
337
|
+
}
|
|
338
|
+
export declare const ANY: DuckDBAnyType;
|
|
339
|
+
export declare class DuckDBBigNumType extends BaseDuckDBType<DuckDBTypeId.BIGNUM> {
|
|
340
|
+
constructor(alias?: string);
|
|
341
|
+
static readonly instance: DuckDBBigNumType;
|
|
342
|
+
static create(alias?: string): DuckDBBigNumType;
|
|
343
|
+
static readonly Max: bigint;
|
|
344
|
+
static readonly Min: bigint;
|
|
345
|
+
get max(): bigint;
|
|
346
|
+
get min(): bigint;
|
|
347
|
+
}
|
|
348
|
+
export declare const BIGNUM: DuckDBBigNumType;
|
|
349
|
+
export declare class DuckDBSQLNullType extends BaseDuckDBType<DuckDBTypeId.SQLNULL> {
|
|
350
|
+
constructor(alias?: string);
|
|
351
|
+
static readonly instance: DuckDBSQLNullType;
|
|
352
|
+
static create(alias?: string): DuckDBSQLNullType;
|
|
353
|
+
}
|
|
354
|
+
export declare const SQLNULL: DuckDBSQLNullType;
|
|
355
|
+
export declare class DuckDBStringLiteralType extends BaseDuckDBType<DuckDBTypeId.STRING_LITERAL> {
|
|
356
|
+
constructor(alias?: string);
|
|
357
|
+
static readonly instance: DuckDBStringLiteralType;
|
|
358
|
+
static create(alias?: string): DuckDBStringLiteralType;
|
|
359
|
+
}
|
|
360
|
+
export declare const STRING_LITERAL: DuckDBStringLiteralType;
|
|
361
|
+
export declare class DuckDBIntegerLiteralType extends BaseDuckDBType<DuckDBTypeId.INTEGER_LITERAL> {
|
|
362
|
+
constructor(alias?: string);
|
|
363
|
+
static readonly instance: DuckDBIntegerLiteralType;
|
|
364
|
+
static create(alias?: string): DuckDBIntegerLiteralType;
|
|
365
|
+
}
|
|
366
|
+
export declare const INTEGER_LITERAL: DuckDBIntegerLiteralType;
|
|
367
|
+
export declare class DuckDBTimeNSType extends BaseDuckDBType<DuckDBTypeId.TIME_NS> {
|
|
368
|
+
constructor(alias?: string);
|
|
369
|
+
static readonly instance: DuckDBTimeNSType;
|
|
370
|
+
static create(alias?: string): DuckDBTimeNSType;
|
|
371
|
+
}
|
|
372
|
+
export declare const TIME_NS: DuckDBTimeNSType;
|
|
373
|
+
export type DuckDBType = DuckDBBooleanType | DuckDBTinyIntType | DuckDBSmallIntType | DuckDBIntegerType | DuckDBBigIntType | DuckDBUTinyIntType | DuckDBUSmallIntType | DuckDBUIntegerType | DuckDBUBigIntType | DuckDBFloatType | DuckDBDoubleType | DuckDBTimestampType | DuckDBDateType | DuckDBTimeType | DuckDBIntervalType | DuckDBHugeIntType | DuckDBUHugeIntType | DuckDBVarCharType | DuckDBBlobType | DuckDBDecimalType | DuckDBTimestampSecondsType | DuckDBTimestampMillisecondsType | DuckDBTimestampNanosecondsType | DuckDBEnumType | DuckDBListType | DuckDBStructType | DuckDBMapType | DuckDBArrayType | DuckDBUUIDType | DuckDBUnionType | DuckDBBitType | DuckDBTimeTZType | DuckDBTimestampTZType | DuckDBAnyType | DuckDBBigNumType | DuckDBSQLNullType | DuckDBStringLiteralType | DuckDBIntegerLiteralType | DuckDBTimeNSType;
|