Skip to content

Commit 82e91f2

Browse files
committed
update duckdb to v1.1.1; add types & fix tests
1 parent 71937c0 commit 82e91f2

18 files changed

+210
-96
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ node test.mjs
117117
Expected output for above example:
118118

119119
```
120-
v1.0.0
120+
v1.1.1
121121
[col 0] bool::BOOLEAN
122122
[row 0] false
123123
[row 1] true

api/src/DuckDBLogicalType.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import duckdb from '@duckdb/node-bindings';
22
import {
3+
DuckDBAnyType,
34
DuckDBArrayType,
45
DuckDBBigIntType,
56
DuckDBBitType,
@@ -15,6 +16,7 @@ import {
1516
DuckDBIntervalType,
1617
DuckDBListType,
1718
DuckDBMapType,
19+
DuckDBSQLNullType,
1820
DuckDBSmallIntType,
1921
DuckDBStructType,
2022
DuckDBTimeTZType,
@@ -34,6 +36,7 @@ import {
3436
DuckDBUUIDType,
3537
DuckDBUnionType,
3638
DuckDBVarCharType,
39+
DuckDBVarIntType,
3740
} from './DuckDBType';
3841
import { DuckDBTypeId } from './DuckDBTypeId';
3942

@@ -204,6 +207,12 @@ export class DuckDBLogicalType {
204207
return DuckDBTimeTZType.instance;
205208
case DuckDBTypeId.TIMESTAMP_TZ:
206209
return DuckDBTimestampTZType.instance;
210+
case DuckDBTypeId.ANY:
211+
return DuckDBAnyType.instance;
212+
case DuckDBTypeId.VARINT:
213+
return DuckDBVarIntType.instance;
214+
case DuckDBTypeId.SQLNULL:
215+
return DuckDBSQLNullType.instance;
207216
default:
208217
throw new Error(`Unexpected type id: ${this.typeId}`);
209218
}

api/src/DuckDBType.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,27 @@ export class DuckDBTimestampTZType extends BaseDuckDBType {
266266
public static readonly instance = new DuckDBTimestampTZType();
267267
}
268268

269+
export class DuckDBAnyType extends BaseDuckDBType {
270+
private constructor() {
271+
super(DuckDBTypeId.ANY);
272+
}
273+
public static readonly instance = new DuckDBAnyType();
274+
}
275+
276+
export class DuckDBVarIntType extends BaseDuckDBType {
277+
private constructor() {
278+
super(DuckDBTypeId.VARINT);
279+
}
280+
public static readonly instance = new DuckDBVarIntType();
281+
}
282+
283+
export class DuckDBSQLNullType extends BaseDuckDBType {
284+
private constructor() {
285+
super(DuckDBTypeId.SQLNULL);
286+
}
287+
public static readonly instance = new DuckDBSQLNullType();
288+
}
289+
269290
export type DuckDBType =
270291
| DuckDBBooleanType
271292
| DuckDBTinyIntType
@@ -300,4 +321,7 @@ export type DuckDBType =
300321
| DuckDBBitType
301322
| DuckDBTimeTZType
302323
| DuckDBTimestampTZType
324+
| DuckDBAnyType
325+
| DuckDBVarIntType
326+
| DuckDBSQLNullType
303327
;

api/src/DuckDBTypeId.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,7 @@ export enum DuckDBTypeId {
3434
BIT = 29,
3535
TIME_TZ = 30,
3636
TIMESTAMP_TZ = 31,
37+
ANY = 34,
38+
VARINT = 35,
39+
SQLNULL = 36,
3740
}

api/src/DuckDBVector.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,12 @@ export abstract class DuckDBVector<T> {
361361
return DuckDBTimeTZVector.fromRawVector(vector, itemCount);
362362
case DuckDBTypeId.TIMESTAMP_TZ:
363363
return DuckDBTimestampVector.fromRawVector(vector, itemCount);
364+
case DuckDBTypeId.ANY:
365+
throw new Error(`Vector not implemented for ANY type`);
366+
case DuckDBTypeId.VARINT:
367+
return DuckDBBlobVector.fromRawVector(vector, itemCount); // TODO: VARINT
368+
case DuckDBTypeId.SQLNULL:
369+
throw new Error(`Vector not implemented for SQLNULL type`);
364370
default:
365371
throw new Error(`Invalid type id: ${vectorType.typeId}`);
366372
}

api/test/api.test.ts

Lines changed: 67 additions & 44 deletions
Large diffs are not rendered by default.

bindings/pkgs/@duckdb/node-bindings/duckdb.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ export enum Type {
8282
BIT = 29,
8383
TIME_TZ = 30,
8484
TIMESTAMP_TZ = 31,
85+
ANY = 34,
86+
VARINT = 35,
87+
SQLNULL = 36,
8588
}
8689

8790

bindings/scripts/fetch_libduckdb_linux.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
from fetch_libduckdb import fetch_libduckdb
33

4-
zip_url = "https://github.com/duckdb/duckdb/releases/download/v1.0.0/libduckdb-linux-amd64.zip"
4+
zip_url = "https://github.com/duckdb/duckdb/releases/download/v1.1.1/libduckdb-linux-amd64.zip"
55
output_dir = os.path.join(os.path.dirname(__file__), "..", "libduckdb")
66
files = [
77
"duckdb.h",

bindings/scripts/fetch_libduckdb_mac.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
from fetch_libduckdb import fetch_libduckdb
33

4-
zip_url = "https://github.com/duckdb/duckdb/releases/download/v1.0.0/libduckdb-osx-universal.zip"
4+
zip_url = "https://github.com/duckdb/duckdb/releases/download/v1.1.1/libduckdb-osx-universal.zip"
55
output_dir = os.path.join(os.path.dirname(__file__), "..", "libduckdb")
66
files = [
77
"duckdb.h",

bindings/scripts/fetch_libduckdb_win.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
from fetch_libduckdb import fetch_libduckdb
33

4-
zip_url = "https://github.com/duckdb/duckdb/releases/download/v1.0.0/libduckdb-windows-amd64.zip"
4+
zip_url = "https://github.com/duckdb/duckdb/releases/download/v1.1.1/libduckdb-windows-amd64.zip"
55
output_dir = os.path.join(os.path.dirname(__file__), "..", "libduckdb")
66
files = [
77
"duckdb.h",

0 commit comments

Comments
 (0)