@haybarn/node-api 1.5.6-rc1 → 2.0.0-rc3
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 +315 -20
- package/lib/DuckDBAppender.d.ts +8 -2
- package/lib/DuckDBAppender.js +19 -1
- package/lib/DuckDBConnection.d.ts +2 -0
- package/lib/DuckDBConnection.js +4 -1
- package/lib/DuckDBDataChunk.d.ts +30 -0
- package/lib/DuckDBDataChunk.js +94 -1
- package/lib/DuckDBDataChunkWriter.d.ts +74 -0
- package/lib/DuckDBDataChunkWriter.js +109 -0
- package/lib/DuckDBLogicalType.d.ts +5 -1
- package/lib/DuckDBLogicalType.js +18 -1
- package/lib/DuckDBMaterializedResult.d.ts +8 -1
- package/lib/DuckDBMaterializedResult.js +22 -2
- package/lib/DuckDBPendingResult.d.ts +16 -1
- package/lib/DuckDBPendingResult.js +19 -2
- package/lib/DuckDBPreparedStatement.d.ts +4 -1
- package/lib/DuckDBPreparedStatement.js +17 -4
- package/lib/DuckDBResult.d.ts +21 -1
- package/lib/DuckDBResult.js +87 -5
- package/lib/DuckDBResultReader.d.ts +5 -0
- package/lib/DuckDBResultReader.js +9 -2
- package/lib/DuckDBScalarFunction.d.ts +9 -5
- package/lib/DuckDBScalarFunction.js +14 -5
- package/lib/DuckDBScalarFunctionBindInfo.d.ts +16 -0
- package/lib/{DuckDBBindInfo.js → DuckDBScalarFunctionBindInfo.js} +5 -3
- package/lib/DuckDBScalarFunctionInfo.d.ts +16 -0
- package/lib/{DuckDBFunctionInfo.js → DuckDBScalarFunctionInfo.js} +11 -3
- package/lib/{DuckDBBindInfo.d.ts → DuckDBScalarFunctionInitInfo.d.ts} +6 -4
- package/lib/DuckDBScalarFunctionInitInfo.js +39 -0
- package/lib/DuckDBTableFunction.d.ts +41 -0
- package/lib/DuckDBTableFunction.js +83 -0
- package/lib/DuckDBTableFunctionBindInfo.d.ts +21 -0
- package/lib/DuckDBTableFunctionBindInfo.js +54 -0
- package/lib/DuckDBTableFunctionInfo.d.ts +15 -0
- package/lib/DuckDBTableFunctionInfo.js +42 -0
- package/lib/DuckDBTableFunctionInitInfo.d.ts +22 -0
- package/lib/DuckDBTableFunctionInitInfo.js +58 -0
- package/lib/DuckDBType.d.ts +1 -373
- package/lib/DuckDBType.js +14 -927
- package/lib/DuckDBTypeId.d.ts +4 -1
- package/lib/DuckDBTypeId.js +3 -0
- package/lib/DuckDBValueConverter.d.ts +10 -0
- package/lib/DuckDBValueConverters.d.ts +27 -0
- package/lib/DuckDBValueConverters.js +128 -1
- package/lib/DuckDBVector.d.ts +1 -596
- package/lib/DuckDBVector.js +14 -2522
- package/lib/JSDuckDBValueConverter.d.ts +1 -2
- package/lib/JSDuckDBValueConverter.js +5 -2
- package/lib/JSInputTypeForTypeId.d.ts +104 -0
- package/lib/JSInputTypeForTypeId.js +3 -0
- package/lib/JSToDuckDBValueConverter.d.ts +30 -0
- package/lib/JSToDuckDBValueConverter.js +83 -0
- package/lib/JSTypeForTypeId.d.ts +91 -0
- package/lib/JSTypeForTypeId.js +3 -0
- package/lib/JsonDuckDBValueConverter.d.ts +1 -2
- package/lib/JsonDuckDBValueConverter.js +4 -1
- package/lib/JsonTypeForTypeId.d.ts +96 -0
- package/lib/JsonTypeForTypeId.js +3 -0
- package/lib/ToDuckDBValueConverter.d.ts +41 -0
- package/lib/ToDuckDBValueConverter.js +27 -0
- package/lib/ToDuckDBValueConverters.d.ts +54 -0
- package/lib/ToDuckDBValueConverters.js +199 -0
- package/lib/conversion/dateTimeStringConversion.d.ts +2 -2
- package/lib/conversion/dateTimeStringConversion.js +20 -7
- package/lib/conversion/varintDecode.d.ts +18 -0
- package/lib/conversion/varintDecode.js +42 -0
- package/lib/convertColumnsFromChunks.d.ts +1 -1
- package/lib/convertColumnsFromChunks.js +2 -2
- package/lib/createResult.d.ts +2 -1
- package/lib/createResult.js +3 -3
- package/lib/createValue.js +63 -5
- package/lib/duckdb.d.ts +15 -2
- package/lib/duckdb.js +15 -2
- package/lib/getColumnsFromChunks.d.ts +1 -1
- package/lib/getColumnsFromChunks.js +2 -2
- package/lib/getColumnsObjectFromChunks.js +3 -0
- package/lib/readValue.d.ts +22 -0
- package/lib/readValue.js +35 -0
- package/lib/typeForValue.js +21 -2
- package/lib/types/BaseDuckDBType.d.ts +11 -0
- package/lib/types/BaseDuckDBType.js +34 -0
- package/lib/types/DuckDBAnyType.d.ts +8 -0
- package/lib/types/DuckDBAnyType.js +16 -0
- package/lib/types/DuckDBArrayType.d.ts +14 -0
- package/lib/types/DuckDBArrayType.js +38 -0
- package/lib/types/DuckDBBigIntType.d.ts +12 -0
- package/lib/types/DuckDBBigIntType.js +24 -0
- package/lib/types/DuckDBBigNumType.d.ts +12 -0
- package/lib/types/DuckDBBigNumType.js +24 -0
- package/lib/types/DuckDBBitType.d.ts +8 -0
- package/lib/types/DuckDBBitType.js +16 -0
- package/lib/types/DuckDBBlobType.d.ts +8 -0
- package/lib/types/DuckDBBlobType.js +16 -0
- package/lib/types/DuckDBBooleanType.d.ts +8 -0
- package/lib/types/DuckDBBooleanType.js +16 -0
- package/lib/types/DuckDBDateType.d.ts +14 -0
- package/lib/types/DuckDBDateType.js +32 -0
- package/lib/types/DuckDBDecimalType.d.ts +14 -0
- package/lib/types/DuckDBDecimalType.js +45 -0
- package/lib/types/DuckDBDoubleType.d.ts +12 -0
- package/lib/types/DuckDBDoubleType.js +24 -0
- package/lib/types/DuckDBEnumType.d.ts +29 -0
- package/lib/types/DuckDBEnumType.js +100 -0
- package/lib/types/DuckDBFloatType.d.ts +12 -0
- package/lib/types/DuckDBFloatType.js +24 -0
- package/lib/types/DuckDBGeometryType.d.ts +19 -0
- package/lib/types/DuckDBGeometryType.js +38 -0
- package/lib/types/DuckDBHugeIntType.d.ts +12 -0
- package/lib/types/DuckDBHugeIntType.js +24 -0
- package/lib/types/DuckDBIntegerLiteralType.d.ts +8 -0
- package/lib/types/DuckDBIntegerLiteralType.js +16 -0
- package/lib/types/DuckDBIntegerType.d.ts +12 -0
- package/lib/types/DuckDBIntegerType.js +24 -0
- package/lib/types/DuckDBIntervalType.d.ts +8 -0
- package/lib/types/DuckDBIntervalType.js +16 -0
- package/lib/types/DuckDBListType.d.ts +13 -0
- package/lib/types/DuckDBListType.js +35 -0
- package/lib/types/DuckDBMapType.d.ts +14 -0
- package/lib/types/DuckDBMapType.js +38 -0
- package/lib/types/DuckDBSQLNullType.d.ts +10 -0
- package/lib/types/DuckDBSQLNullType.js +20 -0
- package/lib/types/DuckDBSmallIntType.d.ts +12 -0
- package/lib/types/DuckDBSmallIntType.js +24 -0
- package/lib/types/DuckDBStringLiteralType.d.ts +8 -0
- package/lib/types/DuckDBStringLiteralType.js +16 -0
- package/lib/types/DuckDBStructType.d.ts +29 -0
- package/lib/types/DuckDBStructType.js +86 -0
- package/lib/types/DuckDBTimeNSType.d.ts +11 -0
- package/lib/types/DuckDBTimeNSType.js +23 -0
- package/lib/types/DuckDBTimeTZType.d.ts +12 -0
- package/lib/types/DuckDBTimeTZType.js +26 -0
- package/lib/types/DuckDBTimeType.d.ts +11 -0
- package/lib/types/DuckDBTimeType.js +23 -0
- package/lib/types/DuckDBTimestampMillisecondsType.d.ts +14 -0
- package/lib/types/DuckDBTimestampMillisecondsType.js +32 -0
- package/lib/types/DuckDBTimestampNanosecondsType.d.ts +14 -0
- package/lib/types/DuckDBTimestampNanosecondsType.js +32 -0
- package/lib/types/DuckDBTimestampSecondsType.d.ts +14 -0
- package/lib/types/DuckDBTimestampSecondsType.js +32 -0
- package/lib/types/DuckDBTimestampTZNanosecondsType.d.ts +15 -0
- package/lib/types/DuckDBTimestampTZNanosecondsType.js +35 -0
- package/lib/types/DuckDBTimestampTZType.d.ts +15 -0
- package/lib/types/DuckDBTimestampTZType.js +35 -0
- package/lib/types/DuckDBTimestampType.d.ts +16 -0
- package/lib/types/DuckDBTimestampType.js +33 -0
- package/lib/types/DuckDBTinyIntType.d.ts +12 -0
- package/lib/types/DuckDBTinyIntType.js +24 -0
- package/lib/types/DuckDBType.d.ts +43 -0
- package/lib/types/DuckDBType.js +2 -0
- package/lib/types/DuckDBUBigIntType.d.ts +12 -0
- package/lib/types/DuckDBUBigIntType.js +24 -0
- package/lib/types/DuckDBUHugeIntType.d.ts +12 -0
- package/lib/types/DuckDBUHugeIntType.js +24 -0
- package/lib/types/DuckDBUIntegerType.d.ts +12 -0
- package/lib/types/DuckDBUIntegerType.js +24 -0
- package/lib/types/DuckDBUSmallIntType.d.ts +12 -0
- package/lib/types/DuckDBUSmallIntType.js +24 -0
- package/lib/types/DuckDBUTinyIntType.d.ts +12 -0
- package/lib/types/DuckDBUTinyIntType.js +24 -0
- package/lib/types/DuckDBUUIDType.d.ts +11 -0
- package/lib/types/DuckDBUUIDType.js +23 -0
- package/lib/types/DuckDBUnionType.d.ts +18 -0
- package/lib/types/DuckDBUnionType.js +64 -0
- package/lib/types/DuckDBVarCharType.d.ts +8 -0
- package/lib/types/DuckDBVarCharType.js +16 -0
- package/lib/types/DuckDBVariantType.d.ts +8 -0
- package/lib/types/DuckDBVariantType.js +16 -0
- package/lib/types/index.d.ts +44 -0
- package/lib/types/index.js +60 -0
- package/lib/values/DuckDBGeometryValue.d.ts +12 -0
- package/lib/values/DuckDBGeometryValue.js +30 -0
- package/lib/values/DuckDBTimestampTZNanosecondsValue.d.ts +14 -0
- package/lib/values/DuckDBTimestampTZNanosecondsValue.js +33 -0
- package/lib/values/DuckDBTupleValue.d.ts +11 -0
- package/lib/values/DuckDBTupleValue.js +22 -0
- package/lib/values/DuckDBUUIDValue.js +5 -1
- package/lib/values/DuckDBValue.d.ts +5 -1
- package/lib/values/DuckDBVariantValue.d.ts +19 -0
- package/lib/values/DuckDBVariantValue.js +30 -0
- package/lib/values/index.d.ts +4 -0
- package/lib/values/index.js +4 -0
- package/lib/vectors/DuckDBArrayVector.d.ts +21 -0
- package/lib/vectors/DuckDBArrayVector.js +79 -0
- package/lib/vectors/DuckDBBigIntVector.d.ts +17 -0
- package/lib/vectors/DuckDBBigIntVector.js +58 -0
- package/lib/vectors/DuckDBBigNumVector.d.ts +21 -0
- package/lib/vectors/DuckDBBigNumVector.js +70 -0
- package/lib/vectors/DuckDBBitVector.d.ts +22 -0
- package/lib/vectors/DuckDBBitVector.js +74 -0
- package/lib/vectors/DuckDBBlobVector.d.ts +32 -0
- package/lib/vectors/DuckDBBlobVector.js +83 -0
- package/lib/vectors/DuckDBBooleanVector.d.ts +18 -0
- package/lib/vectors/DuckDBBooleanVector.js +58 -0
- package/lib/vectors/DuckDBDateVector.d.ts +18 -0
- package/lib/vectors/DuckDBDateVector.js +64 -0
- package/lib/vectors/DuckDBDecimal128Vector.d.ts +21 -0
- package/lib/vectors/DuckDBDecimal128Vector.js +64 -0
- package/lib/vectors/DuckDBDecimal16Vector.d.ts +21 -0
- package/lib/vectors/DuckDBDecimal16Vector.js +64 -0
- package/lib/vectors/DuckDBDecimal32Vector.d.ts +21 -0
- package/lib/vectors/DuckDBDecimal32Vector.js +64 -0
- package/lib/vectors/DuckDBDecimal64Vector.d.ts +21 -0
- package/lib/vectors/DuckDBDecimal64Vector.js +64 -0
- package/lib/vectors/DuckDBDoubleVector.d.ts +17 -0
- package/lib/vectors/DuckDBDoubleVector.js +54 -0
- package/lib/vectors/DuckDBEnum16Vector.d.ts +18 -0
- package/lib/vectors/DuckDBEnum16Vector.js +57 -0
- package/lib/vectors/DuckDBEnum32Vector.d.ts +18 -0
- package/lib/vectors/DuckDBEnum32Vector.js +57 -0
- package/lib/vectors/DuckDBEnum8Vector.d.ts +18 -0
- package/lib/vectors/DuckDBEnum8Vector.js +57 -0
- package/lib/vectors/DuckDBFloatVector.d.ts +17 -0
- package/lib/vectors/DuckDBFloatVector.js +54 -0
- package/lib/vectors/DuckDBGeometryVector.d.ts +22 -0
- package/lib/vectors/DuckDBGeometryVector.js +69 -0
- package/lib/vectors/DuckDBHugeIntVector.d.ts +19 -0
- package/lib/vectors/DuckDBHugeIntVector.js +63 -0
- package/lib/vectors/DuckDBIntegerVector.d.ts +17 -0
- package/lib/vectors/DuckDBIntegerVector.js +61 -0
- package/lib/vectors/DuckDBIntervalVector.d.ts +19 -0
- package/lib/vectors/DuckDBIntervalVector.js +67 -0
- package/lib/vectors/DuckDBListVector.d.ts +35 -0
- package/lib/vectors/DuckDBListVector.js +151 -0
- package/lib/vectors/DuckDBMapVector.d.ts +17 -0
- package/lib/vectors/DuckDBMapVector.js +60 -0
- package/lib/vectors/DuckDBSQLNullVector.d.ts +18 -0
- package/lib/vectors/DuckDBSQLNullVector.js +44 -0
- package/lib/vectors/DuckDBSmallIntVector.d.ts +17 -0
- package/lib/vectors/DuckDBSmallIntVector.js +61 -0
- package/lib/vectors/DuckDBStructVector.d.ts +35 -0
- package/lib/vectors/DuckDBStructVector.js +105 -0
- package/lib/vectors/DuckDBTimeNSVector.d.ts +18 -0
- package/lib/vectors/DuckDBTimeNSVector.js +61 -0
- package/lib/vectors/DuckDBTimeTZVector.d.ts +18 -0
- package/lib/vectors/DuckDBTimeTZVector.js +61 -0
- package/lib/vectors/DuckDBTimeVector.d.ts +18 -0
- package/lib/vectors/DuckDBTimeVector.js +61 -0
- package/lib/vectors/DuckDBTimestampMillisecondsVector.d.ts +18 -0
- package/lib/vectors/DuckDBTimestampMillisecondsVector.js +61 -0
- package/lib/vectors/DuckDBTimestampNanosecondsVector.d.ts +18 -0
- package/lib/vectors/DuckDBTimestampNanosecondsVector.js +61 -0
- package/lib/vectors/DuckDBTimestampSecondsVector.d.ts +18 -0
- package/lib/vectors/DuckDBTimestampSecondsVector.js +61 -0
- package/lib/vectors/DuckDBTimestampTZNanosecondsVector.d.ts +18 -0
- package/lib/vectors/DuckDBTimestampTZNanosecondsVector.js +61 -0
- package/lib/vectors/DuckDBTimestampTZVector.d.ts +18 -0
- package/lib/vectors/DuckDBTimestampTZVector.js +61 -0
- package/lib/vectors/DuckDBTimestampVector.d.ts +18 -0
- package/lib/vectors/DuckDBTimestampVector.js +61 -0
- package/lib/vectors/DuckDBTinyIntVector.d.ts +17 -0
- package/lib/vectors/DuckDBTinyIntVector.js +61 -0
- package/lib/vectors/DuckDBTupleVector.d.ts +26 -0
- package/lib/vectors/DuckDBTupleVector.js +91 -0
- package/lib/vectors/DuckDBUBigIntVector.d.ts +17 -0
- package/lib/vectors/DuckDBUBigIntVector.js +58 -0
- package/lib/vectors/DuckDBUHugeIntVector.d.ts +19 -0
- package/lib/vectors/DuckDBUHugeIntVector.js +63 -0
- package/lib/vectors/DuckDBUIntegerVector.d.ts +17 -0
- package/lib/vectors/DuckDBUIntegerVector.js +61 -0
- package/lib/vectors/DuckDBUSmallIntVector.d.ts +17 -0
- package/lib/vectors/DuckDBUSmallIntVector.js +61 -0
- package/lib/vectors/DuckDBUTinyIntVector.d.ts +17 -0
- package/lib/vectors/DuckDBUTinyIntVector.js +61 -0
- package/lib/vectors/DuckDBUUIDVector.d.ts +19 -0
- package/lib/vectors/DuckDBUUIDVector.js +59 -0
- package/lib/vectors/DuckDBUnionVector.d.ts +17 -0
- package/lib/vectors/DuckDBUnionVector.js +70 -0
- package/lib/vectors/DuckDBValidity.d.ts +12 -0
- package/lib/vectors/DuckDBValidity.js +91 -0
- package/lib/vectors/DuckDBVarCharVector.d.ts +21 -0
- package/lib/vectors/DuckDBVarCharVector.js +74 -0
- package/lib/vectors/DuckDBVariantVector.d.ts +42 -0
- package/lib/vectors/DuckDBVariantVector.js +461 -0
- package/lib/vectors/DuckDBVector.d.ts +14 -0
- package/lib/vectors/DuckDBVector.js +27 -0
- package/lib/vectors/createVector.d.ts +1 -0
- package/lib/vectors/createVector.js +201 -0
- package/lib/vectors/dataAccessors.d.ts +45 -0
- package/lib/vectors/dataAccessors.js +344 -0
- package/lib/vectors/index.d.ts +47 -0
- package/lib/vectors/index.js +65 -0
- package/lib/vectors/vectorRegistry.d.ts +20 -0
- package/lib/vectors/vectorRegistry.js +16 -0
- package/package.json +3 -2
- package/lib/DuckDBFunctionInfo.d.ts +0 -10
|
@@ -0,0 +1,64 @@
|
|
|
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.DuckDBDecimal16Vector = void 0;
|
|
7
|
+
const node_bindings_1 = __importDefault(require("@haybarn/node-bindings"));
|
|
8
|
+
const DuckDBVector_1 = require("./DuckDBVector");
|
|
9
|
+
const DuckDBValidity_1 = require("./DuckDBValidity");
|
|
10
|
+
const dataAccessors_1 = require("./dataAccessors");
|
|
11
|
+
class DuckDBDecimal16Vector extends DuckDBVector_1.DuckDBVector {
|
|
12
|
+
decimalType;
|
|
13
|
+
dataView;
|
|
14
|
+
validity;
|
|
15
|
+
vector;
|
|
16
|
+
_itemCount;
|
|
17
|
+
constructor(decimalType, dataView, validity, vector, itemCount) {
|
|
18
|
+
super();
|
|
19
|
+
this.decimalType = decimalType;
|
|
20
|
+
this.dataView = dataView;
|
|
21
|
+
this.validity = validity;
|
|
22
|
+
this.vector = vector;
|
|
23
|
+
this._itemCount = itemCount;
|
|
24
|
+
}
|
|
25
|
+
static fromRawVector(decimalType, vector, itemCount) {
|
|
26
|
+
const data = (0, dataAccessors_1.vectorData)(vector, itemCount * 2);
|
|
27
|
+
const dataView = new DataView(data.buffer, data.byteOffset, data.byteLength);
|
|
28
|
+
const validity = DuckDBValidity_1.DuckDBValidity.fromVector(vector, itemCount);
|
|
29
|
+
return new DuckDBDecimal16Vector(decimalType, dataView, validity, vector, itemCount);
|
|
30
|
+
}
|
|
31
|
+
get type() {
|
|
32
|
+
return this.decimalType;
|
|
33
|
+
}
|
|
34
|
+
get itemCount() {
|
|
35
|
+
return this._itemCount;
|
|
36
|
+
}
|
|
37
|
+
getItem(itemIndex) {
|
|
38
|
+
return this.validity.itemValid(itemIndex)
|
|
39
|
+
? (0, dataAccessors_1.getDecimal16)(this.dataView, itemIndex * 2, this.decimalType)
|
|
40
|
+
: null;
|
|
41
|
+
}
|
|
42
|
+
getScaledValue(itemIndex) {
|
|
43
|
+
return this.validity.itemValid(itemIndex)
|
|
44
|
+
? (0, dataAccessors_1.getInt16)(this.dataView, itemIndex * 2)
|
|
45
|
+
: null;
|
|
46
|
+
}
|
|
47
|
+
setItem(itemIndex, value) {
|
|
48
|
+
if (value != null) {
|
|
49
|
+
(0, dataAccessors_1.setInt16)(this.dataView, itemIndex * 2, Number(value.value));
|
|
50
|
+
this.validity.setItemValid(itemIndex, true);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
this.validity.setItemValid(itemIndex, false);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
flush() {
|
|
57
|
+
node_bindings_1.default.copy_data_to_vector(this.vector, 0, this.dataView.buffer, this.dataView.byteOffset, this.dataView.byteLength);
|
|
58
|
+
this.validity.flush(this.vector);
|
|
59
|
+
}
|
|
60
|
+
slice(offset, length) {
|
|
61
|
+
return new DuckDBDecimal16Vector(this.decimalType, new DataView(this.dataView.buffer, this.dataView.byteOffset + offset * 2, length * 2), this.validity.slice(offset, length), this.vector, length);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.DuckDBDecimal16Vector = DuckDBDecimal16Vector;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import duckdb from '@haybarn/node-bindings';
|
|
2
|
+
import { DuckDBDecimalType } from '../DuckDBType';
|
|
3
|
+
import { DuckDBDecimalValue } from '../values';
|
|
4
|
+
import { DuckDBVector } from './DuckDBVector';
|
|
5
|
+
import { DuckDBValidity } from './DuckDBValidity';
|
|
6
|
+
export declare class DuckDBDecimal32Vector extends DuckDBVector<DuckDBDecimalValue> {
|
|
7
|
+
private readonly decimalType;
|
|
8
|
+
private readonly dataView;
|
|
9
|
+
private readonly validity;
|
|
10
|
+
private readonly vector;
|
|
11
|
+
private readonly _itemCount;
|
|
12
|
+
constructor(decimalType: DuckDBDecimalType, dataView: DataView, validity: DuckDBValidity, vector: duckdb.Vector, itemCount: number);
|
|
13
|
+
static fromRawVector(decimalType: DuckDBDecimalType, vector: duckdb.Vector, itemCount: number): DuckDBDecimal32Vector;
|
|
14
|
+
get type(): DuckDBDecimalType;
|
|
15
|
+
get itemCount(): number;
|
|
16
|
+
getItem(itemIndex: number): DuckDBDecimalValue | null;
|
|
17
|
+
getScaledValue(itemIndex: number): number | null;
|
|
18
|
+
setItem(itemIndex: number, value: DuckDBDecimalValue | null): void;
|
|
19
|
+
flush(): void;
|
|
20
|
+
slice(offset: number, length: number): DuckDBDecimal32Vector;
|
|
21
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
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.DuckDBDecimal32Vector = void 0;
|
|
7
|
+
const node_bindings_1 = __importDefault(require("@haybarn/node-bindings"));
|
|
8
|
+
const DuckDBVector_1 = require("./DuckDBVector");
|
|
9
|
+
const DuckDBValidity_1 = require("./DuckDBValidity");
|
|
10
|
+
const dataAccessors_1 = require("./dataAccessors");
|
|
11
|
+
class DuckDBDecimal32Vector extends DuckDBVector_1.DuckDBVector {
|
|
12
|
+
decimalType;
|
|
13
|
+
dataView;
|
|
14
|
+
validity;
|
|
15
|
+
vector;
|
|
16
|
+
_itemCount;
|
|
17
|
+
constructor(decimalType, dataView, validity, vector, itemCount) {
|
|
18
|
+
super();
|
|
19
|
+
this.decimalType = decimalType;
|
|
20
|
+
this.dataView = dataView;
|
|
21
|
+
this.validity = validity;
|
|
22
|
+
this.vector = vector;
|
|
23
|
+
this._itemCount = itemCount;
|
|
24
|
+
}
|
|
25
|
+
static fromRawVector(decimalType, vector, itemCount) {
|
|
26
|
+
const data = (0, dataAccessors_1.vectorData)(vector, itemCount * 4);
|
|
27
|
+
const dataView = new DataView(data.buffer, data.byteOffset, data.byteLength);
|
|
28
|
+
const validity = DuckDBValidity_1.DuckDBValidity.fromVector(vector, itemCount);
|
|
29
|
+
return new DuckDBDecimal32Vector(decimalType, dataView, validity, vector, itemCount);
|
|
30
|
+
}
|
|
31
|
+
get type() {
|
|
32
|
+
return this.decimalType;
|
|
33
|
+
}
|
|
34
|
+
get itemCount() {
|
|
35
|
+
return this._itemCount;
|
|
36
|
+
}
|
|
37
|
+
getItem(itemIndex) {
|
|
38
|
+
return this.validity.itemValid(itemIndex)
|
|
39
|
+
? (0, dataAccessors_1.getDecimal32)(this.dataView, itemIndex * 4, this.decimalType)
|
|
40
|
+
: null;
|
|
41
|
+
}
|
|
42
|
+
getScaledValue(itemIndex) {
|
|
43
|
+
return this.validity.itemValid(itemIndex)
|
|
44
|
+
? (0, dataAccessors_1.getInt32)(this.dataView, itemIndex * 4)
|
|
45
|
+
: null;
|
|
46
|
+
}
|
|
47
|
+
setItem(itemIndex, value) {
|
|
48
|
+
if (value != null) {
|
|
49
|
+
(0, dataAccessors_1.setInt32)(this.dataView, itemIndex * 4, Number(value.value));
|
|
50
|
+
this.validity.setItemValid(itemIndex, true);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
this.validity.setItemValid(itemIndex, false);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
flush() {
|
|
57
|
+
node_bindings_1.default.copy_data_to_vector(this.vector, 0, this.dataView.buffer, this.dataView.byteOffset, this.dataView.byteLength);
|
|
58
|
+
this.validity.flush(this.vector);
|
|
59
|
+
}
|
|
60
|
+
slice(offset, length) {
|
|
61
|
+
return new DuckDBDecimal32Vector(this.decimalType, new DataView(this.dataView.buffer, this.dataView.byteOffset + offset * 4, length * 4), this.validity.slice(offset, length), this.vector, length);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.DuckDBDecimal32Vector = DuckDBDecimal32Vector;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import duckdb from '@haybarn/node-bindings';
|
|
2
|
+
import { DuckDBDecimalType } from '../DuckDBType';
|
|
3
|
+
import { DuckDBDecimalValue } from '../values';
|
|
4
|
+
import { DuckDBVector } from './DuckDBVector';
|
|
5
|
+
import { DuckDBValidity } from './DuckDBValidity';
|
|
6
|
+
export declare class DuckDBDecimal64Vector extends DuckDBVector<DuckDBDecimalValue> {
|
|
7
|
+
private readonly decimalType;
|
|
8
|
+
private readonly dataView;
|
|
9
|
+
private readonly validity;
|
|
10
|
+
private readonly vector;
|
|
11
|
+
private readonly _itemCount;
|
|
12
|
+
constructor(decimalType: DuckDBDecimalType, dataView: DataView, validity: DuckDBValidity, vector: duckdb.Vector, itemCount: number);
|
|
13
|
+
static fromRawVector(decimalType: DuckDBDecimalType, vector: duckdb.Vector, itemCount: number): DuckDBDecimal64Vector;
|
|
14
|
+
get type(): DuckDBDecimalType;
|
|
15
|
+
get itemCount(): number;
|
|
16
|
+
getItem(itemIndex: number): DuckDBDecimalValue | null;
|
|
17
|
+
getScaledValue(itemIndex: number): bigint | null;
|
|
18
|
+
setItem(itemIndex: number, value: DuckDBDecimalValue | null): void;
|
|
19
|
+
flush(): void;
|
|
20
|
+
slice(offset: number, length: number): DuckDBDecimal64Vector;
|
|
21
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
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.DuckDBDecimal64Vector = void 0;
|
|
7
|
+
const node_bindings_1 = __importDefault(require("@haybarn/node-bindings"));
|
|
8
|
+
const DuckDBVector_1 = require("./DuckDBVector");
|
|
9
|
+
const DuckDBValidity_1 = require("./DuckDBValidity");
|
|
10
|
+
const dataAccessors_1 = require("./dataAccessors");
|
|
11
|
+
class DuckDBDecimal64Vector extends DuckDBVector_1.DuckDBVector {
|
|
12
|
+
decimalType;
|
|
13
|
+
dataView;
|
|
14
|
+
validity;
|
|
15
|
+
vector;
|
|
16
|
+
_itemCount;
|
|
17
|
+
constructor(decimalType, dataView, validity, vector, itemCount) {
|
|
18
|
+
super();
|
|
19
|
+
this.decimalType = decimalType;
|
|
20
|
+
this.dataView = dataView;
|
|
21
|
+
this.validity = validity;
|
|
22
|
+
this.vector = vector;
|
|
23
|
+
this._itemCount = itemCount;
|
|
24
|
+
}
|
|
25
|
+
static fromRawVector(decimalType, vector, itemCount) {
|
|
26
|
+
const data = (0, dataAccessors_1.vectorData)(vector, itemCount * 8);
|
|
27
|
+
const dataView = new DataView(data.buffer, data.byteOffset, data.byteLength);
|
|
28
|
+
const validity = DuckDBValidity_1.DuckDBValidity.fromVector(vector, itemCount);
|
|
29
|
+
return new DuckDBDecimal64Vector(decimalType, dataView, validity, vector, itemCount);
|
|
30
|
+
}
|
|
31
|
+
get type() {
|
|
32
|
+
return this.decimalType;
|
|
33
|
+
}
|
|
34
|
+
get itemCount() {
|
|
35
|
+
return this._itemCount;
|
|
36
|
+
}
|
|
37
|
+
getItem(itemIndex) {
|
|
38
|
+
return this.validity.itemValid(itemIndex)
|
|
39
|
+
? (0, dataAccessors_1.getDecimal64)(this.dataView, itemIndex * 8, this.decimalType)
|
|
40
|
+
: null;
|
|
41
|
+
}
|
|
42
|
+
getScaledValue(itemIndex) {
|
|
43
|
+
return this.validity.itemValid(itemIndex)
|
|
44
|
+
? (0, dataAccessors_1.getInt64)(this.dataView, itemIndex * 8)
|
|
45
|
+
: null;
|
|
46
|
+
}
|
|
47
|
+
setItem(itemIndex, value) {
|
|
48
|
+
if (value != null) {
|
|
49
|
+
(0, dataAccessors_1.setInt64)(this.dataView, itemIndex * 8, value.value);
|
|
50
|
+
this.validity.setItemValid(itemIndex, true);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
this.validity.setItemValid(itemIndex, false);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
flush() {
|
|
57
|
+
node_bindings_1.default.copy_data_to_vector(this.vector, 0, this.dataView.buffer, this.dataView.byteOffset, this.dataView.byteLength);
|
|
58
|
+
this.validity.flush(this.vector);
|
|
59
|
+
}
|
|
60
|
+
slice(offset, length) {
|
|
61
|
+
return new DuckDBDecimal64Vector(this.decimalType, new DataView(this.dataView.buffer, this.dataView.byteOffset + offset * 8, length * 8), this.validity.slice(offset, length), this.vector, length);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.DuckDBDecimal64Vector = DuckDBDecimal64Vector;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import duckdb from '@haybarn/node-bindings';
|
|
2
|
+
import { DuckDBDoubleType } from '../DuckDBType';
|
|
3
|
+
import { DuckDBVector } from './DuckDBVector';
|
|
4
|
+
import { DuckDBValidity } from './DuckDBValidity';
|
|
5
|
+
export declare class DuckDBDoubleVector extends DuckDBVector<number> {
|
|
6
|
+
private readonly items;
|
|
7
|
+
private readonly validity;
|
|
8
|
+
private readonly vector;
|
|
9
|
+
constructor(items: Float64Array, validity: DuckDBValidity, vector: duckdb.Vector);
|
|
10
|
+
static fromRawVector(vector: duckdb.Vector, itemCount: number): DuckDBDoubleVector;
|
|
11
|
+
get type(): DuckDBDoubleType;
|
|
12
|
+
get itemCount(): number;
|
|
13
|
+
getItem(itemIndex: number): number | null;
|
|
14
|
+
setItem(itemIndex: number, value: number | null): void;
|
|
15
|
+
flush(): void;
|
|
16
|
+
slice(offset: number, length: number): DuckDBDoubleVector;
|
|
17
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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.DuckDBDoubleVector = void 0;
|
|
7
|
+
const node_bindings_1 = __importDefault(require("@haybarn/node-bindings"));
|
|
8
|
+
const DuckDBType_1 = require("../DuckDBType");
|
|
9
|
+
const DuckDBVector_1 = require("./DuckDBVector");
|
|
10
|
+
const DuckDBValidity_1 = require("./DuckDBValidity");
|
|
11
|
+
const dataAccessors_1 = require("./dataAccessors");
|
|
12
|
+
class DuckDBDoubleVector extends DuckDBVector_1.DuckDBVector {
|
|
13
|
+
items;
|
|
14
|
+
validity;
|
|
15
|
+
vector;
|
|
16
|
+
constructor(items, validity, vector) {
|
|
17
|
+
super();
|
|
18
|
+
this.items = items;
|
|
19
|
+
this.validity = validity;
|
|
20
|
+
this.vector = vector;
|
|
21
|
+
}
|
|
22
|
+
static fromRawVector(vector, itemCount) {
|
|
23
|
+
const data = (0, dataAccessors_1.vectorData)(vector, itemCount * Float64Array.BYTES_PER_ELEMENT);
|
|
24
|
+
const items = new Float64Array(data.buffer, data.byteOffset, itemCount);
|
|
25
|
+
const validity = DuckDBValidity_1.DuckDBValidity.fromVector(vector, itemCount);
|
|
26
|
+
return new DuckDBDoubleVector(items, validity, vector);
|
|
27
|
+
}
|
|
28
|
+
get type() {
|
|
29
|
+
return DuckDBType_1.DuckDBDoubleType.instance;
|
|
30
|
+
}
|
|
31
|
+
get itemCount() {
|
|
32
|
+
return this.items.length;
|
|
33
|
+
}
|
|
34
|
+
getItem(itemIndex) {
|
|
35
|
+
return this.validity.itemValid(itemIndex) ? this.items[itemIndex] : null;
|
|
36
|
+
}
|
|
37
|
+
setItem(itemIndex, value) {
|
|
38
|
+
if (value != null) {
|
|
39
|
+
this.items[itemIndex] = value;
|
|
40
|
+
this.validity.setItemValid(itemIndex, true);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
this.validity.setItemValid(itemIndex, false);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
flush() {
|
|
47
|
+
node_bindings_1.default.copy_data_to_vector(this.vector, 0, this.items.buffer, this.items.byteOffset, this.items.byteLength);
|
|
48
|
+
this.validity.flush(this.vector);
|
|
49
|
+
}
|
|
50
|
+
slice(offset, length) {
|
|
51
|
+
return new DuckDBDoubleVector(this.items.slice(offset, offset + length), this.validity.slice(offset, length), this.vector);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.DuckDBDoubleVector = DuckDBDoubleVector;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import duckdb from '@haybarn/node-bindings';
|
|
2
|
+
import { DuckDBEnumType } from '../DuckDBType';
|
|
3
|
+
import { DuckDBVector } from './DuckDBVector';
|
|
4
|
+
import { DuckDBValidity } from './DuckDBValidity';
|
|
5
|
+
export declare class DuckDBEnum16Vector extends DuckDBVector<string> {
|
|
6
|
+
private readonly enumType;
|
|
7
|
+
private readonly items;
|
|
8
|
+
private readonly validity;
|
|
9
|
+
private readonly vector;
|
|
10
|
+
constructor(enumType: DuckDBEnumType, items: Uint16Array, validity: DuckDBValidity, vector: duckdb.Vector);
|
|
11
|
+
static fromRawVector(enumType: DuckDBEnumType, vector: duckdb.Vector, itemCount: number): DuckDBEnum16Vector;
|
|
12
|
+
get type(): DuckDBEnumType;
|
|
13
|
+
get itemCount(): number;
|
|
14
|
+
getItem(itemIndex: number): string | null;
|
|
15
|
+
setItem(itemIndex: number, value: string | null): void;
|
|
16
|
+
flush(): void;
|
|
17
|
+
slice(offset: number, length: number): DuckDBEnum16Vector;
|
|
18
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
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.DuckDBEnum16Vector = void 0;
|
|
7
|
+
const node_bindings_1 = __importDefault(require("@haybarn/node-bindings"));
|
|
8
|
+
const DuckDBVector_1 = require("./DuckDBVector");
|
|
9
|
+
const DuckDBValidity_1 = require("./DuckDBValidity");
|
|
10
|
+
const dataAccessors_1 = require("./dataAccessors");
|
|
11
|
+
class DuckDBEnum16Vector extends DuckDBVector_1.DuckDBVector {
|
|
12
|
+
enumType;
|
|
13
|
+
items;
|
|
14
|
+
validity;
|
|
15
|
+
vector;
|
|
16
|
+
constructor(enumType, items, validity, vector) {
|
|
17
|
+
super();
|
|
18
|
+
this.enumType = enumType;
|
|
19
|
+
this.items = items;
|
|
20
|
+
this.validity = validity;
|
|
21
|
+
this.vector = vector;
|
|
22
|
+
}
|
|
23
|
+
static fromRawVector(enumType, vector, itemCount) {
|
|
24
|
+
const data = (0, dataAccessors_1.vectorData)(vector, itemCount * 2);
|
|
25
|
+
const items = new Uint16Array(data.buffer, data.byteOffset, itemCount);
|
|
26
|
+
const validity = DuckDBValidity_1.DuckDBValidity.fromVector(vector, itemCount);
|
|
27
|
+
return new DuckDBEnum16Vector(enumType, items, validity, vector);
|
|
28
|
+
}
|
|
29
|
+
get type() {
|
|
30
|
+
return this.enumType;
|
|
31
|
+
}
|
|
32
|
+
get itemCount() {
|
|
33
|
+
return this.items.length;
|
|
34
|
+
}
|
|
35
|
+
getItem(itemIndex) {
|
|
36
|
+
return this.validity.itemValid(itemIndex)
|
|
37
|
+
? this.enumType.values[this.items[itemIndex]]
|
|
38
|
+
: null;
|
|
39
|
+
}
|
|
40
|
+
setItem(itemIndex, value) {
|
|
41
|
+
if (value != null) {
|
|
42
|
+
this.items[itemIndex] = this.enumType.indexForValue(value);
|
|
43
|
+
this.validity.setItemValid(itemIndex, true);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
this.validity.setItemValid(itemIndex, false);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
flush() {
|
|
50
|
+
node_bindings_1.default.copy_data_to_vector(this.vector, 0, this.items.buffer, this.items.byteOffset, this.items.byteLength);
|
|
51
|
+
this.validity.flush(this.vector);
|
|
52
|
+
}
|
|
53
|
+
slice(offset, length) {
|
|
54
|
+
return new DuckDBEnum16Vector(this.enumType, this.items.slice(offset, offset + length), this.validity.slice(offset, length), this.vector);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.DuckDBEnum16Vector = DuckDBEnum16Vector;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import duckdb from '@haybarn/node-bindings';
|
|
2
|
+
import { DuckDBEnumType } from '../DuckDBType';
|
|
3
|
+
import { DuckDBVector } from './DuckDBVector';
|
|
4
|
+
import { DuckDBValidity } from './DuckDBValidity';
|
|
5
|
+
export declare class DuckDBEnum32Vector extends DuckDBVector<string> {
|
|
6
|
+
private readonly enumType;
|
|
7
|
+
private readonly items;
|
|
8
|
+
private readonly validity;
|
|
9
|
+
private readonly vector;
|
|
10
|
+
constructor(enumType: DuckDBEnumType, items: Uint32Array, validity: DuckDBValidity, vector: duckdb.Vector);
|
|
11
|
+
static fromRawVector(enumType: DuckDBEnumType, vector: duckdb.Vector, itemCount: number): DuckDBEnum32Vector;
|
|
12
|
+
get type(): DuckDBEnumType;
|
|
13
|
+
get itemCount(): number;
|
|
14
|
+
getItem(itemIndex: number): string | null;
|
|
15
|
+
setItem(itemIndex: number, value: string | null): void;
|
|
16
|
+
flush(): void;
|
|
17
|
+
slice(offset: number, length: number): DuckDBEnum32Vector;
|
|
18
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
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.DuckDBEnum32Vector = void 0;
|
|
7
|
+
const node_bindings_1 = __importDefault(require("@haybarn/node-bindings"));
|
|
8
|
+
const DuckDBVector_1 = require("./DuckDBVector");
|
|
9
|
+
const DuckDBValidity_1 = require("./DuckDBValidity");
|
|
10
|
+
const dataAccessors_1 = require("./dataAccessors");
|
|
11
|
+
class DuckDBEnum32Vector extends DuckDBVector_1.DuckDBVector {
|
|
12
|
+
enumType;
|
|
13
|
+
items;
|
|
14
|
+
validity;
|
|
15
|
+
vector;
|
|
16
|
+
constructor(enumType, items, validity, vector) {
|
|
17
|
+
super();
|
|
18
|
+
this.enumType = enumType;
|
|
19
|
+
this.items = items;
|
|
20
|
+
this.validity = validity;
|
|
21
|
+
this.vector = vector;
|
|
22
|
+
}
|
|
23
|
+
static fromRawVector(enumType, vector, itemCount) {
|
|
24
|
+
const data = (0, dataAccessors_1.vectorData)(vector, itemCount * 4);
|
|
25
|
+
const items = new Uint32Array(data.buffer, data.byteOffset, itemCount);
|
|
26
|
+
const validity = DuckDBValidity_1.DuckDBValidity.fromVector(vector, itemCount);
|
|
27
|
+
return new DuckDBEnum32Vector(enumType, items, validity, vector);
|
|
28
|
+
}
|
|
29
|
+
get type() {
|
|
30
|
+
return this.enumType;
|
|
31
|
+
}
|
|
32
|
+
get itemCount() {
|
|
33
|
+
return this.items.length;
|
|
34
|
+
}
|
|
35
|
+
getItem(itemIndex) {
|
|
36
|
+
return this.validity.itemValid(itemIndex)
|
|
37
|
+
? this.enumType.values[this.items[itemIndex]]
|
|
38
|
+
: null;
|
|
39
|
+
}
|
|
40
|
+
setItem(itemIndex, value) {
|
|
41
|
+
if (value != null) {
|
|
42
|
+
this.items[itemIndex] = this.enumType.indexForValue(value);
|
|
43
|
+
this.validity.setItemValid(itemIndex, true);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
this.validity.setItemValid(itemIndex, false);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
flush() {
|
|
50
|
+
node_bindings_1.default.copy_data_to_vector(this.vector, 0, this.items.buffer, this.items.byteOffset, this.items.byteLength);
|
|
51
|
+
this.validity.flush(this.vector);
|
|
52
|
+
}
|
|
53
|
+
slice(offset, length) {
|
|
54
|
+
return new DuckDBEnum32Vector(this.enumType, this.items.slice(offset, offset + length), this.validity.slice(offset, length), this.vector);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.DuckDBEnum32Vector = DuckDBEnum32Vector;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import duckdb from '@haybarn/node-bindings';
|
|
2
|
+
import { DuckDBEnumType } from '../DuckDBType';
|
|
3
|
+
import { DuckDBVector } from './DuckDBVector';
|
|
4
|
+
import { DuckDBValidity } from './DuckDBValidity';
|
|
5
|
+
export declare class DuckDBEnum8Vector extends DuckDBVector<string> {
|
|
6
|
+
private readonly enumType;
|
|
7
|
+
private readonly items;
|
|
8
|
+
private readonly validity;
|
|
9
|
+
private readonly vector;
|
|
10
|
+
constructor(enumType: DuckDBEnumType, items: Uint8Array, validity: DuckDBValidity, vector: duckdb.Vector);
|
|
11
|
+
static fromRawVector(enumType: DuckDBEnumType, vector: duckdb.Vector, itemCount: number): DuckDBEnum8Vector;
|
|
12
|
+
get type(): DuckDBEnumType;
|
|
13
|
+
get itemCount(): number;
|
|
14
|
+
getItem(itemIndex: number): string | null;
|
|
15
|
+
setItem(itemIndex: number, value: string | null): void;
|
|
16
|
+
flush(): void;
|
|
17
|
+
slice(offset: number, length: number): DuckDBEnum8Vector;
|
|
18
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
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.DuckDBEnum8Vector = void 0;
|
|
7
|
+
const node_bindings_1 = __importDefault(require("@haybarn/node-bindings"));
|
|
8
|
+
const DuckDBVector_1 = require("./DuckDBVector");
|
|
9
|
+
const DuckDBValidity_1 = require("./DuckDBValidity");
|
|
10
|
+
const dataAccessors_1 = require("./dataAccessors");
|
|
11
|
+
class DuckDBEnum8Vector extends DuckDBVector_1.DuckDBVector {
|
|
12
|
+
enumType;
|
|
13
|
+
items;
|
|
14
|
+
validity;
|
|
15
|
+
vector;
|
|
16
|
+
constructor(enumType, items, validity, vector) {
|
|
17
|
+
super();
|
|
18
|
+
this.enumType = enumType;
|
|
19
|
+
this.items = items;
|
|
20
|
+
this.validity = validity;
|
|
21
|
+
this.vector = vector;
|
|
22
|
+
}
|
|
23
|
+
static fromRawVector(enumType, vector, itemCount) {
|
|
24
|
+
const data = (0, dataAccessors_1.vectorData)(vector, itemCount);
|
|
25
|
+
const items = new Uint8Array(data.buffer, data.byteOffset, itemCount);
|
|
26
|
+
const validity = DuckDBValidity_1.DuckDBValidity.fromVector(vector, itemCount);
|
|
27
|
+
return new DuckDBEnum8Vector(enumType, items, validity, vector);
|
|
28
|
+
}
|
|
29
|
+
get type() {
|
|
30
|
+
return this.enumType;
|
|
31
|
+
}
|
|
32
|
+
get itemCount() {
|
|
33
|
+
return this.items.length;
|
|
34
|
+
}
|
|
35
|
+
getItem(itemIndex) {
|
|
36
|
+
return this.validity.itemValid(itemIndex)
|
|
37
|
+
? this.enumType.values[this.items[itemIndex]]
|
|
38
|
+
: null;
|
|
39
|
+
}
|
|
40
|
+
setItem(itemIndex, value) {
|
|
41
|
+
if (value != null) {
|
|
42
|
+
this.items[itemIndex] = this.enumType.indexForValue(value);
|
|
43
|
+
this.validity.setItemValid(itemIndex, true);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
this.validity.setItemValid(itemIndex, false);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
flush() {
|
|
50
|
+
node_bindings_1.default.copy_data_to_vector(this.vector, 0, this.items.buffer, this.items.byteOffset, this.items.byteLength);
|
|
51
|
+
this.validity.flush(this.vector);
|
|
52
|
+
}
|
|
53
|
+
slice(offset, length) {
|
|
54
|
+
return new DuckDBEnum8Vector(this.enumType, this.items.slice(offset, offset + length), this.validity.slice(offset, length), this.vector);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.DuckDBEnum8Vector = DuckDBEnum8Vector;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import duckdb from '@haybarn/node-bindings';
|
|
2
|
+
import { DuckDBFloatType } from '../DuckDBType';
|
|
3
|
+
import { DuckDBVector } from './DuckDBVector';
|
|
4
|
+
import { DuckDBValidity } from './DuckDBValidity';
|
|
5
|
+
export declare class DuckDBFloatVector extends DuckDBVector<number> {
|
|
6
|
+
private readonly items;
|
|
7
|
+
private readonly validity;
|
|
8
|
+
private readonly vector;
|
|
9
|
+
constructor(items: Float32Array, validity: DuckDBValidity, vector: duckdb.Vector);
|
|
10
|
+
static fromRawVector(vector: duckdb.Vector, itemCount: number): DuckDBFloatVector;
|
|
11
|
+
get type(): DuckDBFloatType;
|
|
12
|
+
get itemCount(): number;
|
|
13
|
+
getItem(itemIndex: number): number | null;
|
|
14
|
+
setItem(itemIndex: number, value: number | null): void;
|
|
15
|
+
flush(): void;
|
|
16
|
+
slice(offset: number, length: number): DuckDBFloatVector;
|
|
17
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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.DuckDBFloatVector = void 0;
|
|
7
|
+
const node_bindings_1 = __importDefault(require("@haybarn/node-bindings"));
|
|
8
|
+
const DuckDBType_1 = require("../DuckDBType");
|
|
9
|
+
const DuckDBVector_1 = require("./DuckDBVector");
|
|
10
|
+
const DuckDBValidity_1 = require("./DuckDBValidity");
|
|
11
|
+
const dataAccessors_1 = require("./dataAccessors");
|
|
12
|
+
class DuckDBFloatVector extends DuckDBVector_1.DuckDBVector {
|
|
13
|
+
items;
|
|
14
|
+
validity;
|
|
15
|
+
vector;
|
|
16
|
+
constructor(items, validity, vector) {
|
|
17
|
+
super();
|
|
18
|
+
this.items = items;
|
|
19
|
+
this.validity = validity;
|
|
20
|
+
this.vector = vector;
|
|
21
|
+
}
|
|
22
|
+
static fromRawVector(vector, itemCount) {
|
|
23
|
+
const data = (0, dataAccessors_1.vectorData)(vector, itemCount * Float32Array.BYTES_PER_ELEMENT);
|
|
24
|
+
const items = new Float32Array(data.buffer, data.byteOffset, itemCount);
|
|
25
|
+
const validity = DuckDBValidity_1.DuckDBValidity.fromVector(vector, itemCount);
|
|
26
|
+
return new DuckDBFloatVector(items, validity, vector);
|
|
27
|
+
}
|
|
28
|
+
get type() {
|
|
29
|
+
return DuckDBType_1.DuckDBFloatType.instance;
|
|
30
|
+
}
|
|
31
|
+
get itemCount() {
|
|
32
|
+
return this.items.length;
|
|
33
|
+
}
|
|
34
|
+
getItem(itemIndex) {
|
|
35
|
+
return this.validity.itemValid(itemIndex) ? this.items[itemIndex] : null;
|
|
36
|
+
}
|
|
37
|
+
setItem(itemIndex, value) {
|
|
38
|
+
if (value != null) {
|
|
39
|
+
this.items[itemIndex] = value;
|
|
40
|
+
this.validity.setItemValid(itemIndex, true);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
this.validity.setItemValid(itemIndex, false);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
flush() {
|
|
47
|
+
node_bindings_1.default.copy_data_to_vector(this.vector, 0, this.items.buffer, this.items.byteOffset, this.items.byteLength);
|
|
48
|
+
this.validity.flush(this.vector);
|
|
49
|
+
}
|
|
50
|
+
slice(offset, length) {
|
|
51
|
+
return new DuckDBFloatVector(this.items.slice(offset, offset + length), this.validity.slice(offset, length), this.vector);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.DuckDBFloatVector = DuckDBFloatVector;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import duckdb from '@haybarn/node-bindings';
|
|
2
|
+
import { DuckDBGeometryType } from '../DuckDBType';
|
|
3
|
+
import { DuckDBGeometryValue } from '../values';
|
|
4
|
+
import { DuckDBVector } from './DuckDBVector';
|
|
5
|
+
import { DuckDBValidity } from './DuckDBValidity';
|
|
6
|
+
export declare class DuckDBGeometryVector extends DuckDBVector<DuckDBGeometryValue> {
|
|
7
|
+
private readonly dataView;
|
|
8
|
+
private readonly validity;
|
|
9
|
+
private readonly vector;
|
|
10
|
+
private readonly itemOffset;
|
|
11
|
+
private readonly _itemCount;
|
|
12
|
+
private readonly itemCache;
|
|
13
|
+
private readonly itemCacheDirty;
|
|
14
|
+
constructor(dataView: DataView, validity: DuckDBValidity, vector: duckdb.Vector, itemOffset: number, itemCount: number);
|
|
15
|
+
static fromRawVector(vector: duckdb.Vector, itemCount: number): DuckDBGeometryVector;
|
|
16
|
+
get type(): DuckDBGeometryType;
|
|
17
|
+
get itemCount(): number;
|
|
18
|
+
getItem(itemIndex: number): DuckDBGeometryValue | null;
|
|
19
|
+
setItem(itemIndex: number, value: DuckDBGeometryValue | null): void;
|
|
20
|
+
flush(): void;
|
|
21
|
+
slice(offset: number, length: number): DuckDBGeometryVector;
|
|
22
|
+
}
|