@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,12 @@
|
|
|
1
|
+
import { Time, TimeParts } from '@haybarn/node-bindings';
|
|
2
|
+
export type { TimeParts };
|
|
3
|
+
export declare class DuckDBTimeValue implements Time {
|
|
4
|
+
readonly micros: bigint;
|
|
5
|
+
constructor(micros: bigint);
|
|
6
|
+
toString(): string;
|
|
7
|
+
toParts(): TimeParts;
|
|
8
|
+
static fromParts(parts: TimeParts): DuckDBTimeValue;
|
|
9
|
+
static readonly Max: DuckDBTimeValue;
|
|
10
|
+
static readonly Min: DuckDBTimeValue;
|
|
11
|
+
}
|
|
12
|
+
export declare function timeValue(microsOrParts: bigint | TimeParts): DuckDBTimeValue;
|
|
@@ -0,0 +1,33 @@
|
|
|
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.DuckDBTimeValue = void 0;
|
|
7
|
+
exports.timeValue = timeValue;
|
|
8
|
+
const node_bindings_1 = __importDefault(require("@haybarn/node-bindings"));
|
|
9
|
+
const dateTimeStringConversion_1 = require("../conversion/dateTimeStringConversion");
|
|
10
|
+
class DuckDBTimeValue {
|
|
11
|
+
micros;
|
|
12
|
+
constructor(micros) {
|
|
13
|
+
this.micros = micros;
|
|
14
|
+
}
|
|
15
|
+
toString() {
|
|
16
|
+
return (0, dateTimeStringConversion_1.getDuckDBTimeStringFromMicrosecondsInDay)(this.micros);
|
|
17
|
+
}
|
|
18
|
+
toParts() {
|
|
19
|
+
return node_bindings_1.default.from_time(this);
|
|
20
|
+
}
|
|
21
|
+
static fromParts(parts) {
|
|
22
|
+
return new DuckDBTimeValue(node_bindings_1.default.to_time(parts).micros);
|
|
23
|
+
}
|
|
24
|
+
static Max = new DuckDBTimeValue(24n * 60n * 60n * 1000n * 1000n);
|
|
25
|
+
static Min = new DuckDBTimeValue(0n);
|
|
26
|
+
}
|
|
27
|
+
exports.DuckDBTimeValue = DuckDBTimeValue;
|
|
28
|
+
function timeValue(microsOrParts) {
|
|
29
|
+
if (typeof microsOrParts === 'bigint') {
|
|
30
|
+
return new DuckDBTimeValue(microsOrParts);
|
|
31
|
+
}
|
|
32
|
+
return DuckDBTimeValue.fromParts(microsOrParts);
|
|
33
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TimestampMilliseconds } from '@haybarn/node-bindings';
|
|
2
|
+
export declare class DuckDBTimestampMillisecondsValue implements TimestampMilliseconds {
|
|
3
|
+
readonly millis: bigint;
|
|
4
|
+
constructor(millis: bigint);
|
|
5
|
+
get isFinite(): boolean;
|
|
6
|
+
toString(): string;
|
|
7
|
+
static readonly Epoch: DuckDBTimestampMillisecondsValue;
|
|
8
|
+
static readonly Max: DuckDBTimestampMillisecondsValue;
|
|
9
|
+
static readonly Min: DuckDBTimestampMillisecondsValue;
|
|
10
|
+
static readonly PosInf: DuckDBTimestampMillisecondsValue;
|
|
11
|
+
static readonly NegInf: DuckDBTimestampMillisecondsValue;
|
|
12
|
+
}
|
|
13
|
+
export declare function timestampMillisValue(millis: bigint): DuckDBTimestampMillisecondsValue;
|
|
@@ -0,0 +1,31 @@
|
|
|
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.DuckDBTimestampMillisecondsValue = void 0;
|
|
7
|
+
exports.timestampMillisValue = timestampMillisValue;
|
|
8
|
+
const node_bindings_1 = __importDefault(require("@haybarn/node-bindings"));
|
|
9
|
+
const dateTimeStringConversion_1 = require("../conversion/dateTimeStringConversion");
|
|
10
|
+
const DuckDBTimestampSecondsValue_1 = require("./DuckDBTimestampSecondsValue");
|
|
11
|
+
class DuckDBTimestampMillisecondsValue {
|
|
12
|
+
millis;
|
|
13
|
+
constructor(millis) {
|
|
14
|
+
this.millis = millis;
|
|
15
|
+
}
|
|
16
|
+
get isFinite() {
|
|
17
|
+
return node_bindings_1.default.is_finite_timestamp_ms(this);
|
|
18
|
+
}
|
|
19
|
+
toString() {
|
|
20
|
+
return (0, dateTimeStringConversion_1.getDuckDBTimestampStringFromMilliseconds)(this.millis);
|
|
21
|
+
}
|
|
22
|
+
static Epoch = new DuckDBTimestampMillisecondsValue(0n);
|
|
23
|
+
static Max = new DuckDBTimestampMillisecondsValue((2n ** 63n - 2n) / 1000n);
|
|
24
|
+
static Min = new DuckDBTimestampMillisecondsValue(DuckDBTimestampSecondsValue_1.DuckDBTimestampSecondsValue.Min.seconds * 1000n);
|
|
25
|
+
static PosInf = new DuckDBTimestampMillisecondsValue(2n ** 63n - 1n);
|
|
26
|
+
static NegInf = new DuckDBTimestampMillisecondsValue(-(2n ** 63n - 1n));
|
|
27
|
+
}
|
|
28
|
+
exports.DuckDBTimestampMillisecondsValue = DuckDBTimestampMillisecondsValue;
|
|
29
|
+
function timestampMillisValue(millis) {
|
|
30
|
+
return new DuckDBTimestampMillisecondsValue(millis);
|
|
31
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TimestampNanoseconds } from '@haybarn/node-bindings';
|
|
2
|
+
export declare class DuckDBTimestampNanosecondsValue implements TimestampNanoseconds {
|
|
3
|
+
readonly nanos: bigint;
|
|
4
|
+
constructor(nanos: bigint);
|
|
5
|
+
get isFinite(): boolean;
|
|
6
|
+
toString(): string;
|
|
7
|
+
static readonly Epoch: DuckDBTimestampNanosecondsValue;
|
|
8
|
+
static readonly Max: DuckDBTimestampNanosecondsValue;
|
|
9
|
+
static readonly Min: DuckDBTimestampNanosecondsValue;
|
|
10
|
+
static readonly PosInf: DuckDBTimestampNanosecondsValue;
|
|
11
|
+
static readonly NegInf: DuckDBTimestampNanosecondsValue;
|
|
12
|
+
}
|
|
13
|
+
export declare function timestampNanosValue(nanos: bigint): DuckDBTimestampNanosecondsValue;
|
|
@@ -0,0 +1,30 @@
|
|
|
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.DuckDBTimestampNanosecondsValue = void 0;
|
|
7
|
+
exports.timestampNanosValue = timestampNanosValue;
|
|
8
|
+
const node_bindings_1 = __importDefault(require("@haybarn/node-bindings"));
|
|
9
|
+
const dateTimeStringConversion_1 = require("../conversion/dateTimeStringConversion");
|
|
10
|
+
class DuckDBTimestampNanosecondsValue {
|
|
11
|
+
nanos;
|
|
12
|
+
constructor(nanos) {
|
|
13
|
+
this.nanos = nanos;
|
|
14
|
+
}
|
|
15
|
+
get isFinite() {
|
|
16
|
+
return node_bindings_1.default.is_finite_timestamp_ns(this);
|
|
17
|
+
}
|
|
18
|
+
toString() {
|
|
19
|
+
return (0, dateTimeStringConversion_1.getDuckDBTimestampStringFromNanoseconds)(this.nanos);
|
|
20
|
+
}
|
|
21
|
+
static Epoch = new DuckDBTimestampNanosecondsValue(0n);
|
|
22
|
+
static Max = new DuckDBTimestampNanosecondsValue(2n ** 63n - 2n);
|
|
23
|
+
static Min = new DuckDBTimestampNanosecondsValue(-9223286400000000000n);
|
|
24
|
+
static PosInf = new DuckDBTimestampNanosecondsValue(2n ** 63n - 1n);
|
|
25
|
+
static NegInf = new DuckDBTimestampNanosecondsValue(-(2n ** 63n - 1n));
|
|
26
|
+
}
|
|
27
|
+
exports.DuckDBTimestampNanosecondsValue = DuckDBTimestampNanosecondsValue;
|
|
28
|
+
function timestampNanosValue(nanos) {
|
|
29
|
+
return new DuckDBTimestampNanosecondsValue(nanos);
|
|
30
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TimestampSeconds } from '@haybarn/node-bindings';
|
|
2
|
+
export declare class DuckDBTimestampSecondsValue implements TimestampSeconds {
|
|
3
|
+
readonly seconds: bigint;
|
|
4
|
+
constructor(seconds: bigint);
|
|
5
|
+
get isFinite(): boolean;
|
|
6
|
+
toString(): string;
|
|
7
|
+
static readonly Epoch: DuckDBTimestampSecondsValue;
|
|
8
|
+
static readonly Max: DuckDBTimestampSecondsValue;
|
|
9
|
+
static readonly Min: DuckDBTimestampSecondsValue;
|
|
10
|
+
static readonly PosInf: DuckDBTimestampSecondsValue;
|
|
11
|
+
static readonly NegInf: DuckDBTimestampSecondsValue;
|
|
12
|
+
}
|
|
13
|
+
export declare function timestampSecondsValue(seconds: bigint): DuckDBTimestampSecondsValue;
|
|
@@ -0,0 +1,30 @@
|
|
|
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.DuckDBTimestampSecondsValue = void 0;
|
|
7
|
+
exports.timestampSecondsValue = timestampSecondsValue;
|
|
8
|
+
const node_bindings_1 = __importDefault(require("@haybarn/node-bindings"));
|
|
9
|
+
const dateTimeStringConversion_1 = require("../conversion/dateTimeStringConversion");
|
|
10
|
+
class DuckDBTimestampSecondsValue {
|
|
11
|
+
seconds;
|
|
12
|
+
constructor(seconds) {
|
|
13
|
+
this.seconds = seconds;
|
|
14
|
+
}
|
|
15
|
+
get isFinite() {
|
|
16
|
+
return node_bindings_1.default.is_finite_timestamp_s(this);
|
|
17
|
+
}
|
|
18
|
+
toString() {
|
|
19
|
+
return (0, dateTimeStringConversion_1.getDuckDBTimestampStringFromSeconds)(this.seconds);
|
|
20
|
+
}
|
|
21
|
+
static Epoch = new DuckDBTimestampSecondsValue(0n);
|
|
22
|
+
static Max = new DuckDBTimestampSecondsValue(9223372036854n);
|
|
23
|
+
static Min = new DuckDBTimestampSecondsValue(-9223372022400n); // from test_all_types() select epoch(timestamp_s)::bigint;
|
|
24
|
+
static PosInf = new DuckDBTimestampSecondsValue(2n ** 63n - 1n);
|
|
25
|
+
static NegInf = new DuckDBTimestampSecondsValue(-(2n ** 63n - 1n));
|
|
26
|
+
}
|
|
27
|
+
exports.DuckDBTimestampSecondsValue = DuckDBTimestampSecondsValue;
|
|
28
|
+
function timestampSecondsValue(seconds) {
|
|
29
|
+
return new DuckDBTimestampSecondsValue(seconds);
|
|
30
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Timestamp, TimestampParts } from '@haybarn/node-bindings';
|
|
2
|
+
export declare class DuckDBTimestampTZValue implements Timestamp {
|
|
3
|
+
static timezoneOffsetInMinutes: number;
|
|
4
|
+
readonly micros: bigint;
|
|
5
|
+
constructor(micros: bigint);
|
|
6
|
+
get isFinite(): boolean;
|
|
7
|
+
toString(): string;
|
|
8
|
+
toParts(): TimestampParts;
|
|
9
|
+
static fromParts(parts: TimestampParts): DuckDBTimestampTZValue;
|
|
10
|
+
static readonly Epoch: DuckDBTimestampTZValue;
|
|
11
|
+
static readonly Max: DuckDBTimestampTZValue;
|
|
12
|
+
static readonly Min: DuckDBTimestampTZValue;
|
|
13
|
+
static readonly PosInf: DuckDBTimestampTZValue;
|
|
14
|
+
static readonly NegInf: DuckDBTimestampTZValue;
|
|
15
|
+
}
|
|
16
|
+
export declare function timestampTZValue(microsOrParts: bigint | TimestampParts): DuckDBTimestampTZValue;
|
|
@@ -0,0 +1,41 @@
|
|
|
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.DuckDBTimestampTZValue = void 0;
|
|
7
|
+
exports.timestampTZValue = timestampTZValue;
|
|
8
|
+
const node_bindings_1 = __importDefault(require("@haybarn/node-bindings"));
|
|
9
|
+
const dateTimeStringConversion_1 = require("../conversion/dateTimeStringConversion");
|
|
10
|
+
const DuckDBTimestampValue_1 = require("./DuckDBTimestampValue");
|
|
11
|
+
class DuckDBTimestampTZValue {
|
|
12
|
+
static timezoneOffsetInMinutes = -new Date().getTimezoneOffset();
|
|
13
|
+
micros;
|
|
14
|
+
constructor(micros) {
|
|
15
|
+
this.micros = micros;
|
|
16
|
+
}
|
|
17
|
+
get isFinite() {
|
|
18
|
+
return node_bindings_1.default.is_finite_timestamp(this);
|
|
19
|
+
}
|
|
20
|
+
toString() {
|
|
21
|
+
return (0, dateTimeStringConversion_1.getDuckDBTimestampStringFromMicroseconds)(this.micros, DuckDBTimestampTZValue.timezoneOffsetInMinutes);
|
|
22
|
+
}
|
|
23
|
+
toParts() {
|
|
24
|
+
return node_bindings_1.default.from_timestamp(this);
|
|
25
|
+
}
|
|
26
|
+
static fromParts(parts) {
|
|
27
|
+
return new DuckDBTimestampTZValue(node_bindings_1.default.to_timestamp(parts).micros);
|
|
28
|
+
}
|
|
29
|
+
static Epoch = new DuckDBTimestampTZValue(0n);
|
|
30
|
+
static Max = new DuckDBTimestampTZValue(DuckDBTimestampValue_1.DuckDBTimestampValue.Max.micros);
|
|
31
|
+
static Min = new DuckDBTimestampTZValue(DuckDBTimestampValue_1.DuckDBTimestampValue.Min.micros);
|
|
32
|
+
static PosInf = new DuckDBTimestampTZValue(DuckDBTimestampValue_1.DuckDBTimestampValue.PosInf.micros);
|
|
33
|
+
static NegInf = new DuckDBTimestampTZValue(DuckDBTimestampValue_1.DuckDBTimestampValue.NegInf.micros);
|
|
34
|
+
}
|
|
35
|
+
exports.DuckDBTimestampTZValue = DuckDBTimestampTZValue;
|
|
36
|
+
function timestampTZValue(microsOrParts) {
|
|
37
|
+
if (typeof microsOrParts === 'bigint') {
|
|
38
|
+
return new DuckDBTimestampTZValue(microsOrParts);
|
|
39
|
+
}
|
|
40
|
+
return DuckDBTimestampTZValue.fromParts(microsOrParts);
|
|
41
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Timestamp, TimestampParts } from '@haybarn/node-bindings';
|
|
2
|
+
export type { TimestampParts };
|
|
3
|
+
export declare class DuckDBTimestampValue implements Timestamp {
|
|
4
|
+
readonly micros: bigint;
|
|
5
|
+
constructor(micros: bigint);
|
|
6
|
+
get isFinite(): boolean;
|
|
7
|
+
toString(): string;
|
|
8
|
+
toParts(): TimestampParts;
|
|
9
|
+
static fromParts(parts: TimestampParts): DuckDBTimestampValue;
|
|
10
|
+
static readonly Epoch: DuckDBTimestampValue;
|
|
11
|
+
static readonly Max: DuckDBTimestampValue;
|
|
12
|
+
static readonly Min: DuckDBTimestampValue;
|
|
13
|
+
static readonly PosInf: DuckDBTimestampValue;
|
|
14
|
+
static readonly NegInf: DuckDBTimestampValue;
|
|
15
|
+
}
|
|
16
|
+
export type DuckDBTimestampMicrosecondsValue = DuckDBTimestampValue;
|
|
17
|
+
export declare const DuckDBTimestampMicrosecondsValue: typeof DuckDBTimestampValue;
|
|
18
|
+
export declare function timestampValue(microsOrParts: bigint | TimestampParts): DuckDBTimestampValue;
|
|
@@ -0,0 +1,41 @@
|
|
|
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.DuckDBTimestampMicrosecondsValue = exports.DuckDBTimestampValue = void 0;
|
|
7
|
+
exports.timestampValue = timestampValue;
|
|
8
|
+
const node_bindings_1 = __importDefault(require("@haybarn/node-bindings"));
|
|
9
|
+
const dateTimeStringConversion_1 = require("../conversion/dateTimeStringConversion");
|
|
10
|
+
const DuckDBTimestampMillisecondsValue_1 = require("./DuckDBTimestampMillisecondsValue");
|
|
11
|
+
class DuckDBTimestampValue {
|
|
12
|
+
micros;
|
|
13
|
+
constructor(micros) {
|
|
14
|
+
this.micros = micros;
|
|
15
|
+
}
|
|
16
|
+
get isFinite() {
|
|
17
|
+
return node_bindings_1.default.is_finite_timestamp(this);
|
|
18
|
+
}
|
|
19
|
+
toString() {
|
|
20
|
+
return (0, dateTimeStringConversion_1.getDuckDBTimestampStringFromMicroseconds)(this.micros);
|
|
21
|
+
}
|
|
22
|
+
toParts() {
|
|
23
|
+
return node_bindings_1.default.from_timestamp(this);
|
|
24
|
+
}
|
|
25
|
+
static fromParts(parts) {
|
|
26
|
+
return new DuckDBTimestampValue(node_bindings_1.default.to_timestamp(parts).micros);
|
|
27
|
+
}
|
|
28
|
+
static Epoch = new DuckDBTimestampValue(0n);
|
|
29
|
+
static Max = new DuckDBTimestampValue(2n ** 63n - 2n);
|
|
30
|
+
static Min = new DuckDBTimestampValue(DuckDBTimestampMillisecondsValue_1.DuckDBTimestampMillisecondsValue.Min.millis * 1000n);
|
|
31
|
+
static PosInf = new DuckDBTimestampValue(2n ** 63n - 1n);
|
|
32
|
+
static NegInf = new DuckDBTimestampValue(-(2n ** 63n - 1n));
|
|
33
|
+
}
|
|
34
|
+
exports.DuckDBTimestampValue = DuckDBTimestampValue;
|
|
35
|
+
exports.DuckDBTimestampMicrosecondsValue = DuckDBTimestampValue;
|
|
36
|
+
function timestampValue(microsOrParts) {
|
|
37
|
+
if (typeof microsOrParts === 'bigint') {
|
|
38
|
+
return new DuckDBTimestampValue(microsOrParts);
|
|
39
|
+
}
|
|
40
|
+
return DuckDBTimestampValue.fromParts(microsOrParts);
|
|
41
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare class DuckDBUUIDValue {
|
|
2
|
+
readonly hugeint: bigint;
|
|
3
|
+
private constructor();
|
|
4
|
+
/** Return the UUID as an unsigned 128-bit integer in a JS BigInt. */
|
|
5
|
+
toUint128(): bigint;
|
|
6
|
+
toString(): string;
|
|
7
|
+
/** Create a DuckDBUUIDValue from an unsigned 128-bit integer in a JS BigInt. */
|
|
8
|
+
static fromUint128(uint128: bigint): DuckDBUUIDValue;
|
|
9
|
+
/**
|
|
10
|
+
* Create a DuckDBUUIDValue from a HUGEINT as stored by DuckDB.
|
|
11
|
+
*
|
|
12
|
+
* UUID values are stored with their MSB flipped so their numeric ordering matches their string ordering.
|
|
13
|
+
*/
|
|
14
|
+
static fromStoredHugeInt(hugeint: bigint): DuckDBUUIDValue;
|
|
15
|
+
static readonly Max: DuckDBUUIDValue;
|
|
16
|
+
static readonly Min: DuckDBUUIDValue;
|
|
17
|
+
}
|
|
18
|
+
/** Create a DuckDBUUIDValue from an unsigned 128-bit integer in a JS BigInt. */
|
|
19
|
+
export declare function uuidValue(uint128: bigint): DuckDBUUIDValue;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DuckDBUUIDValue = void 0;
|
|
4
|
+
exports.uuidValue = uuidValue;
|
|
5
|
+
class DuckDBUUIDValue {
|
|
6
|
+
hugeint;
|
|
7
|
+
constructor(hugeint) {
|
|
8
|
+
this.hugeint = hugeint;
|
|
9
|
+
}
|
|
10
|
+
/** Return the UUID as an unsigned 128-bit integer in a JS BigInt. */
|
|
11
|
+
toUint128() {
|
|
12
|
+
// UUID values are stored with their MSB flipped so their numeric ordering matches their string ordering.
|
|
13
|
+
return (this.hugeint ^ 0x80000000000000000000000000000000n) & 0xffffffffffffffffffffffffffffffffn;
|
|
14
|
+
}
|
|
15
|
+
toString() {
|
|
16
|
+
// Prepend with a (hex) 1 before converting to a hex string.
|
|
17
|
+
// This ensures the trailing 32 characters are the hex digits we want, left padded with zeros as needed.
|
|
18
|
+
const hex = (this.toUint128() | 0x100000000000000000000000000000000n).toString(16);
|
|
19
|
+
return `${hex.substring(1, 9)}-${hex.substring(9, 13)}-${hex.substring(13, 17)}-${hex.substring(17, 21)}-${hex.substring(21, 33)}`;
|
|
20
|
+
}
|
|
21
|
+
/** Create a DuckDBUUIDValue from an unsigned 128-bit integer in a JS BigInt. */
|
|
22
|
+
static fromUint128(uint128) {
|
|
23
|
+
return new DuckDBUUIDValue((uint128 ^ 0x80000000000000000000000000000000n) & 0xffffffffffffffffffffffffffffffffn);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Create a DuckDBUUIDValue from a HUGEINT as stored by DuckDB.
|
|
27
|
+
*
|
|
28
|
+
* UUID values are stored with their MSB flipped so their numeric ordering matches their string ordering.
|
|
29
|
+
*/
|
|
30
|
+
static fromStoredHugeInt(hugeint) {
|
|
31
|
+
return new DuckDBUUIDValue(hugeint);
|
|
32
|
+
}
|
|
33
|
+
static Max = new DuckDBUUIDValue(2n ** 127n - 1n); // 7fffffffffffffffffffffffffffffff
|
|
34
|
+
static Min = new DuckDBUUIDValue(-(2n ** 127n)); // 80000000000000000000000000000000
|
|
35
|
+
}
|
|
36
|
+
exports.DuckDBUUIDValue = DuckDBUUIDValue;
|
|
37
|
+
/** Create a DuckDBUUIDValue from an unsigned 128-bit integer in a JS BigInt. */
|
|
38
|
+
function uuidValue(uint128) {
|
|
39
|
+
return DuckDBUUIDValue.fromUint128(uint128);
|
|
40
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DuckDBValue } from './DuckDBValue';
|
|
2
|
+
export declare class DuckDBUnionValue {
|
|
3
|
+
readonly tag: string;
|
|
4
|
+
readonly value: DuckDBValue;
|
|
5
|
+
constructor(tag: string, value: DuckDBValue);
|
|
6
|
+
toString(): string;
|
|
7
|
+
}
|
|
8
|
+
export declare function unionValue(tag: string, value: DuckDBValue): DuckDBUnionValue;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DuckDBUnionValue = void 0;
|
|
4
|
+
exports.unionValue = unionValue;
|
|
5
|
+
class DuckDBUnionValue {
|
|
6
|
+
tag;
|
|
7
|
+
value;
|
|
8
|
+
constructor(tag, value) {
|
|
9
|
+
this.tag = tag;
|
|
10
|
+
this.value = value;
|
|
11
|
+
}
|
|
12
|
+
toString() {
|
|
13
|
+
if (this.value == null) {
|
|
14
|
+
return 'NULL';
|
|
15
|
+
}
|
|
16
|
+
return this.value.toString();
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.DuckDBUnionValue = DuckDBUnionValue;
|
|
20
|
+
function unionValue(tag, value) {
|
|
21
|
+
return new DuckDBUnionValue(tag, value);
|
|
22
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DuckDBArrayValue } from './DuckDBArrayValue';
|
|
2
|
+
import { DuckDBBitValue } from './DuckDBBitValue';
|
|
3
|
+
import { DuckDBBlobValue } from './DuckDBBlobValue';
|
|
4
|
+
import { DuckDBDateValue } from './DuckDBDateValue';
|
|
5
|
+
import { DuckDBDecimalValue } from './DuckDBDecimalValue';
|
|
6
|
+
import { DuckDBIntervalValue } from './DuckDBIntervalValue';
|
|
7
|
+
import { DuckDBListValue } from './DuckDBListValue';
|
|
8
|
+
import { DuckDBMapValue } from './DuckDBMapValue';
|
|
9
|
+
import { DuckDBStructValue } from './DuckDBStructValue';
|
|
10
|
+
import { DuckDBTimeNSValue } from './DuckDBTimeNSValue';
|
|
11
|
+
import { DuckDBTimestampMillisecondsValue } from './DuckDBTimestampMillisecondsValue';
|
|
12
|
+
import { DuckDBTimestampNanosecondsValue } from './DuckDBTimestampNanosecondsValue';
|
|
13
|
+
import { DuckDBTimestampSecondsValue } from './DuckDBTimestampSecondsValue';
|
|
14
|
+
import { DuckDBTimestampTZValue } from './DuckDBTimestampTZValue';
|
|
15
|
+
import { DuckDBTimestampValue } from './DuckDBTimestampValue';
|
|
16
|
+
import { DuckDBTimeTZValue } from './DuckDBTimeTZValue';
|
|
17
|
+
import { DuckDBTimeValue } from './DuckDBTimeValue';
|
|
18
|
+
import { DuckDBUnionValue } from './DuckDBUnionValue';
|
|
19
|
+
import { DuckDBUUIDValue } from './DuckDBUUIDValue';
|
|
20
|
+
export type DuckDBValue = null | boolean | number | bigint | string | DuckDBArrayValue | DuckDBBitValue | DuckDBBlobValue | DuckDBDateValue | DuckDBDecimalValue | DuckDBIntervalValue | DuckDBListValue | DuckDBMapValue | DuckDBStructValue | DuckDBTimestampMillisecondsValue | DuckDBTimestampNanosecondsValue | DuckDBTimestampSecondsValue | DuckDBTimestampTZValue | DuckDBTimestampValue | DuckDBTimeTZValue | DuckDBTimeValue | DuckDBTimeNSValue | DuckDBUnionValue | DuckDBUUIDValue;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from './DuckDBArrayValue';
|
|
2
|
+
export * from './DuckDBBitValue';
|
|
3
|
+
export * from './DuckDBBlobValue';
|
|
4
|
+
export * from './DuckDBDateValue';
|
|
5
|
+
export * from './DuckDBDecimalValue';
|
|
6
|
+
export * from './DuckDBIntervalValue';
|
|
7
|
+
export * from './DuckDBListValue';
|
|
8
|
+
export * from './DuckDBMapValue';
|
|
9
|
+
export * from './DuckDBStructValue';
|
|
10
|
+
export * from './DuckDBTimeNSValue';
|
|
11
|
+
export * from './DuckDBTimestampMillisecondsValue';
|
|
12
|
+
export * from './DuckDBTimestampNanosecondsValue';
|
|
13
|
+
export * from './DuckDBTimestampSecondsValue';
|
|
14
|
+
export * from './DuckDBTimestampTZValue';
|
|
15
|
+
export * from './DuckDBTimestampValue';
|
|
16
|
+
export * from './DuckDBTimeTZValue';
|
|
17
|
+
export * from './DuckDBTimeValue';
|
|
18
|
+
export * from './DuckDBUnionValue';
|
|
19
|
+
export * from './DuckDBUUIDValue';
|
|
20
|
+
export * from './DuckDBValue';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./DuckDBArrayValue"), exports);
|
|
18
|
+
__exportStar(require("./DuckDBBitValue"), exports);
|
|
19
|
+
__exportStar(require("./DuckDBBlobValue"), exports);
|
|
20
|
+
__exportStar(require("./DuckDBDateValue"), exports);
|
|
21
|
+
__exportStar(require("./DuckDBDecimalValue"), exports);
|
|
22
|
+
__exportStar(require("./DuckDBIntervalValue"), exports);
|
|
23
|
+
__exportStar(require("./DuckDBListValue"), exports);
|
|
24
|
+
__exportStar(require("./DuckDBMapValue"), exports);
|
|
25
|
+
__exportStar(require("./DuckDBStructValue"), exports);
|
|
26
|
+
__exportStar(require("./DuckDBTimeNSValue"), exports);
|
|
27
|
+
__exportStar(require("./DuckDBTimestampMillisecondsValue"), exports);
|
|
28
|
+
__exportStar(require("./DuckDBTimestampNanosecondsValue"), exports);
|
|
29
|
+
__exportStar(require("./DuckDBTimestampSecondsValue"), exports);
|
|
30
|
+
__exportStar(require("./DuckDBTimestampTZValue"), exports);
|
|
31
|
+
__exportStar(require("./DuckDBTimestampValue"), exports);
|
|
32
|
+
__exportStar(require("./DuckDBTimeTZValue"), exports);
|
|
33
|
+
__exportStar(require("./DuckDBTimeValue"), exports);
|
|
34
|
+
__exportStar(require("./DuckDBUnionValue"), exports);
|
|
35
|
+
__exportStar(require("./DuckDBUUIDValue"), exports);
|
|
36
|
+
__exportStar(require("./DuckDBValue"), exports);
|
package/lib/version.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function version(): string;
|
package/lib/version.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
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.version = version;
|
|
7
|
+
const node_bindings_1 = __importDefault(require("@haybarn/node-bindings"));
|
|
8
|
+
function version() {
|
|
9
|
+
return node_bindings_1.default.library_version();
|
|
10
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@haybarn/node-api",
|
|
3
|
+
"version": "1.5.3-rc2",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"main": "./lib/index.js",
|
|
6
|
+
"types": "./lib/index.d.ts",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@haybarn/node-bindings": "1.5.3-rc2"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/Query-farm-haybarn/haybarn-node-neo.git"
|
|
13
|
+
},
|
|
14
|
+
"description": "High-level Node API for Haybarn — a derived distribution of DuckDB, powered by DuckDB."
|
|
15
|
+
}
|