duckdb 0.3.5-dev692.0 → 0.3.5-dev705.0
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/package.json +1 -1
- package/src/connection.cpp +7 -0
- package/src/duckdb.cpp +22 -12
- package/src/duckdb.hpp +602 -602
- package/src/parquet-amalgamation.cpp +30897 -30897
- package/src/statement.cpp +2 -1
- package/test/data_type_support.test.js +22 -1
package/src/statement.cpp
CHANGED
|
@@ -179,7 +179,8 @@ static Napi::Value convert_chunk(Napi::Env &env, std::vector<std::string> names,
|
|
|
179
179
|
const auto scale = duckdb::Interval::SECS_PER_DAY * duckdb::Interval::MSECS_PER_SEC;
|
|
180
180
|
value = Napi::Date::New(env, double(dval.GetValue<int32_t>() * scale));
|
|
181
181
|
} break;
|
|
182
|
-
case duckdb::LogicalTypeId::TIMESTAMP:
|
|
182
|
+
case duckdb::LogicalTypeId::TIMESTAMP:
|
|
183
|
+
case duckdb::LogicalTypeId::TIMESTAMP_TZ: {
|
|
183
184
|
value = Napi::Date::New(env, double(dval.GetValue<int64_t>() / duckdb::Interval::MICROS_PER_MSEC));
|
|
184
185
|
} break;
|
|
185
186
|
#endif
|
|
@@ -21,7 +21,7 @@ describe("data type support", function () {
|
|
|
21
21
|
});
|
|
22
22
|
});
|
|
23
23
|
it("supports INTERVAL values", function (done) {
|
|
24
|
-
db.prepare(`SELECT
|
|
24
|
+
db.prepare(`SELECT
|
|
25
25
|
INTERVAL 1 MINUTE as minutes,
|
|
26
26
|
INTERVAL 5 DAY as days,
|
|
27
27
|
INTERVAL 4 MONTH as months,
|
|
@@ -34,4 +34,25 @@ describe("data type support", function () {
|
|
|
34
34
|
done();
|
|
35
35
|
});
|
|
36
36
|
});
|
|
37
|
+
it("supports DATE values", function (done) {
|
|
38
|
+
db.prepare(`SELECT '2021-01-01'::DATE as dt;`).each((err, row) => {
|
|
39
|
+
assert(err === null);
|
|
40
|
+
assert.deepEqual(row.dt, new Date(Date.UTC(2021, 0, 1)));
|
|
41
|
+
done();
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
it("supports TIMESTAMP values", function (done) {
|
|
45
|
+
db.prepare(`SELECT '2021-01-01T00:00:00'::TIMESTAMP as ts;`).each((err, row) => {
|
|
46
|
+
assert(err === null);
|
|
47
|
+
assert.deepEqual(row.ts, new Date(Date.UTC(2021, 0, 1)));
|
|
48
|
+
done();
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
it("supports TIMESTAMP WITH TIME ZONE values", function (done) {
|
|
52
|
+
db.prepare(`SELECT '2021-01-01T00:00:00Z'::TIMESTAMPTZ as tstz;`).each((err, row) => {
|
|
53
|
+
assert(err === null);
|
|
54
|
+
assert.deepEqual(row.tstz, new Date(Date.UTC(2021, 0, 1)));
|
|
55
|
+
done();
|
|
56
|
+
});
|
|
57
|
+
});
|
|
37
58
|
});
|