@duckdb/node-bindings 1.5.5-r.2 → 1.5.5-r.4
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/duckdb.d.ts +116 -12
- package/package.json +9 -9
package/duckdb.d.ts
CHANGED
|
@@ -95,7 +95,6 @@ export enum Type {
|
|
|
95
95
|
VARIANT = 41,
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
|
|
99
98
|
// Types (no explicit destroy)
|
|
100
99
|
|
|
101
100
|
export interface Date_ {
|
|
@@ -183,14 +182,46 @@ export interface TimestampParts {
|
|
|
183
182
|
time: TimeParts;
|
|
184
183
|
}
|
|
185
184
|
|
|
186
|
-
|
|
185
|
+
// The C API reuses one opaque handle type for bind info, init info and function
|
|
186
|
+
// info across function families, but the struct behind each handle differs per
|
|
187
|
+
// family and is reinterpret_cast with no check. Passing one family's handle to
|
|
188
|
+
// another family's accessor corrupts memory rather than failing, so each family
|
|
189
|
+
// gets its own type here, and its own runtime type tag in the bindings.
|
|
190
|
+
//
|
|
191
|
+
// __duckdb_type records the underlying C type; __duckdb_function_kind is what
|
|
192
|
+
// keeps the families from being assignable to one another.
|
|
193
|
+
|
|
194
|
+
export interface ScalarFunctionBindInfo {
|
|
195
|
+
__duckdb_type: 'duckdb_bind_info';
|
|
196
|
+
__duckdb_function_kind: 'scalar_function';
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export interface ScalarFunctionInfo {
|
|
200
|
+
__duckdb_type: 'duckdb_function_info';
|
|
201
|
+
__duckdb_function_kind: 'scalar_function';
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export interface TableFunctionBindInfo {
|
|
187
205
|
__duckdb_type: 'duckdb_bind_info';
|
|
206
|
+
__duckdb_function_kind: 'table_function';
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export interface TableFunctionInitInfo {
|
|
210
|
+
__duckdb_type: 'duckdb_init_info';
|
|
211
|
+
__duckdb_function_kind: 'table_function';
|
|
188
212
|
}
|
|
189
213
|
|
|
190
|
-
export interface
|
|
214
|
+
export interface TableFunctionInfo {
|
|
191
215
|
__duckdb_type: 'duckdb_function_info';
|
|
216
|
+
__duckdb_function_kind: 'table_function';
|
|
192
217
|
}
|
|
193
218
|
|
|
219
|
+
/** @deprecated Renamed to ScalarFunctionBindInfo. */
|
|
220
|
+
export type BindInfo = ScalarFunctionBindInfo;
|
|
221
|
+
|
|
222
|
+
/** @deprecated Renamed to ScalarFunctionInfo. */
|
|
223
|
+
export type FunctionInfo = ScalarFunctionInfo;
|
|
224
|
+
|
|
194
225
|
export interface Vector {
|
|
195
226
|
__duckdb_type: 'duckdb_vector';
|
|
196
227
|
}
|
|
@@ -253,6 +284,10 @@ export interface ScalarFunction {
|
|
|
253
284
|
__duckdb_type: 'duckdb_scalar_function';
|
|
254
285
|
}
|
|
255
286
|
|
|
287
|
+
export interface TableFunction {
|
|
288
|
+
__duckdb_type: 'duckdb_table_function';
|
|
289
|
+
}
|
|
290
|
+
|
|
256
291
|
// export interface SelectionVector {
|
|
257
292
|
// __duckdb_type: 'duckdb_selection_vector';
|
|
258
293
|
// }
|
|
@@ -273,8 +308,12 @@ export interface ExtractedStatementsAndCount {
|
|
|
273
308
|
statement_count: number;
|
|
274
309
|
}
|
|
275
310
|
|
|
276
|
-
export type ScalarFunctionBindFunction = (info:
|
|
277
|
-
export type ScalarFunctionMainFunction = (info:
|
|
311
|
+
export type ScalarFunctionBindFunction = (info: ScalarFunctionBindInfo) => void;
|
|
312
|
+
export type ScalarFunctionMainFunction = (info: ScalarFunctionInfo, input: DataChunk, output: Vector) => void;
|
|
313
|
+
|
|
314
|
+
export type TableFunctionBindFunction = (info: TableFunctionBindInfo) => void;
|
|
315
|
+
export type TableFunctionInitFunction = (info: TableFunctionInitInfo) => void;
|
|
316
|
+
export type TableFunctionMainFunction = (info: TableFunctionInfo, output: DataChunk) => void;
|
|
278
317
|
|
|
279
318
|
// Functions
|
|
280
319
|
|
|
@@ -1018,8 +1057,10 @@ export function data_chunk_get_size(chunk: DataChunk): number;
|
|
|
1018
1057
|
export function data_chunk_set_size(chunk: DataChunk, size: number): void;
|
|
1019
1058
|
|
|
1020
1059
|
// DUCKDB_C_API duckdb_vector duckdb_create_vector(duckdb_logical_type type, idx_t capacity);
|
|
1060
|
+
export function create_vector(logical_type: LogicalType, capacity: number): Vector;
|
|
1021
1061
|
|
|
1022
1062
|
// DUCKDB_C_API void duckdb_destroy_vector(duckdb_vector *vector);
|
|
1063
|
+
// not exposed: destroyed in finalizer
|
|
1023
1064
|
|
|
1024
1065
|
// DUCKDB_C_API duckdb_logical_type duckdb_vector_get_column_type(duckdb_vector vector);
|
|
1025
1066
|
export function vector_get_column_type(vector: Vector): LogicalType;
|
|
@@ -1064,6 +1105,7 @@ export function array_vector_get_child(vector: Vector): Vector;
|
|
|
1064
1105
|
// DUCKDB_C_API void duckdb_vector_copy_sel(duckdb_vector src, duckdb_vector dst, duckdb_selection_vector sel, idx_t src_count, idx_t src_offset, idx_t dst_offset);
|
|
1065
1106
|
|
|
1066
1107
|
// DUCKDB_C_API void duckdb_vector_reference_value(duckdb_vector vector, duckdb_value value);
|
|
1108
|
+
export function vector_reference_value(vector: Vector, value: Value): void;
|
|
1067
1109
|
|
|
1068
1110
|
// DUCKDB_C_API void duckdb_vector_reference_vector(duckdb_vector to_vector, duckdb_vector from_vector);
|
|
1069
1111
|
|
|
@@ -1110,13 +1152,13 @@ export function scalar_function_set_extra_info(scalar_function: ScalarFunction,
|
|
|
1110
1152
|
export function scalar_function_set_bind(scalar_function: ScalarFunction, func: ScalarFunctionBindFunction): void;
|
|
1111
1153
|
|
|
1112
1154
|
// DUCKDB_C_API void duckdb_scalar_function_set_bind_data(duckdb_bind_info info, void *bind_data, duckdb_delete_callback_t destroy);
|
|
1113
|
-
export function scalar_function_set_bind_data(info:
|
|
1155
|
+
export function scalar_function_set_bind_data(info: ScalarFunctionBindInfo, bind_data: object): void;
|
|
1114
1156
|
|
|
1115
1157
|
// DUCKDB_C_API void duckdb_scalar_function_set_bind_data_copy(duckdb_bind_info info, duckdb_copy_callback_t copy);
|
|
1116
1158
|
// not exposed: handled by scalar_function_set_bind_data
|
|
1117
1159
|
|
|
1118
1160
|
// DUCKDB_C_API void duckdb_scalar_function_bind_set_error(duckdb_bind_info info, const char *error);
|
|
1119
|
-
export function scalar_function_bind_set_error(bind_info:
|
|
1161
|
+
export function scalar_function_bind_set_error(bind_info: ScalarFunctionBindInfo, error: string): void;
|
|
1120
1162
|
|
|
1121
1163
|
// DUCKDB_C_API void duckdb_scalar_function_set_function(duckdb_scalar_function scalar_function, duckdb_scalar_function_t function);
|
|
1122
1164
|
export function scalar_function_set_function(scalar_function: ScalarFunction, func: ScalarFunctionMainFunction): void;
|
|
@@ -1125,19 +1167,19 @@ export function scalar_function_set_function(scalar_function: ScalarFunction, fu
|
|
|
1125
1167
|
export function register_scalar_function(connection: Connection, scalar_function: ScalarFunction): void;
|
|
1126
1168
|
|
|
1127
1169
|
// DUCKDB_C_API void *duckdb_scalar_function_get_extra_info(duckdb_function_info info);
|
|
1128
|
-
export function scalar_function_get_extra_info(function_info:
|
|
1170
|
+
export function scalar_function_get_extra_info(function_info: ScalarFunctionInfo): object | undefined;
|
|
1129
1171
|
|
|
1130
1172
|
// DUCKDB_C_API void *duckdb_scalar_function_bind_get_extra_info(duckdb_bind_info info);
|
|
1131
|
-
export function scalar_function_bind_get_extra_info(bind_info:
|
|
1173
|
+
export function scalar_function_bind_get_extra_info(bind_info: ScalarFunctionBindInfo): object | undefined;
|
|
1132
1174
|
|
|
1133
1175
|
// DUCKDB_C_API void *duckdb_scalar_function_get_bind_data(duckdb_function_info info);
|
|
1134
|
-
export function scalar_function_get_bind_data(function_info:
|
|
1176
|
+
export function scalar_function_get_bind_data(function_info: ScalarFunctionInfo): object | undefined;
|
|
1135
1177
|
|
|
1136
1178
|
// DUCKDB_C_API void duckdb_scalar_function_get_client_context(duckdb_bind_info info, duckdb_client_context *out_context);
|
|
1137
|
-
export function scalar_function_get_client_context(bind_info:
|
|
1179
|
+
export function scalar_function_get_client_context(bind_info: ScalarFunctionBindInfo): ClientContext;
|
|
1138
1180
|
|
|
1139
1181
|
// DUCKDB_C_API void duckdb_scalar_function_set_error(duckdb_function_info info, const char *error);
|
|
1140
|
-
export function scalar_function_set_error(function_info:
|
|
1182
|
+
export function scalar_function_set_error(function_info: ScalarFunctionInfo, error: string): void;
|
|
1141
1183
|
|
|
1142
1184
|
// DUCKDB_C_API duckdb_scalar_function_set duckdb_create_scalar_function_set(const char *name);
|
|
1143
1185
|
// DUCKDB_C_API void duckdb_destroy_scalar_function_set(duckdb_scalar_function_set *scalar_function_set);
|
|
@@ -1178,41 +1220,103 @@ export function scalar_function_set_error(function_info: FunctionInfo, error: st
|
|
|
1178
1220
|
// DUCKDB_C_API duckdb_state duckdb_register_aggregate_function_set(duckdb_connection con, duckdb_aggregate_function_set set);
|
|
1179
1221
|
|
|
1180
1222
|
// DUCKDB_C_API duckdb_table_function duckdb_create_table_function();
|
|
1223
|
+
export function create_table_function(): TableFunction;
|
|
1224
|
+
|
|
1181
1225
|
// DUCKDB_C_API void duckdb_destroy_table_function(duckdb_table_function *table_function);
|
|
1226
|
+
export function destroy_table_function_sync(table_function: TableFunction): void;
|
|
1227
|
+
|
|
1182
1228
|
// DUCKDB_C_API void duckdb_table_function_set_name(duckdb_table_function table_function, const char *name);
|
|
1229
|
+
export function table_function_set_name(table_function: TableFunction, name: string): void;
|
|
1230
|
+
|
|
1183
1231
|
// DUCKDB_C_API void duckdb_table_function_add_parameter(duckdb_table_function table_function, duckdb_logical_type type);
|
|
1232
|
+
export function table_function_add_parameter(table_function: TableFunction, logical_type: LogicalType): void;
|
|
1233
|
+
|
|
1184
1234
|
// DUCKDB_C_API void duckdb_table_function_add_named_parameter(duckdb_table_function table_function, const char *name, duckdb_logical_type type);
|
|
1235
|
+
export function table_function_add_named_parameter(table_function: TableFunction, name: string, logical_type: LogicalType): void;
|
|
1236
|
+
|
|
1185
1237
|
// DUCKDB_C_API void duckdb_table_function_set_extra_info(duckdb_table_function table_function, void *extra_info, duckdb_delete_callback_t destroy);
|
|
1238
|
+
export function table_function_set_extra_info(table_function: TableFunction, extra_info: object): void;
|
|
1239
|
+
|
|
1186
1240
|
// DUCKDB_C_API void duckdb_table_function_set_bind(duckdb_table_function table_function, duckdb_table_function_bind_t bind);
|
|
1241
|
+
export function table_function_set_bind(table_function: TableFunction, func: TableFunctionBindFunction): void;
|
|
1242
|
+
|
|
1187
1243
|
// DUCKDB_C_API void duckdb_table_function_set_init(duckdb_table_function table_function, duckdb_table_function_init_t init);
|
|
1244
|
+
export function table_function_set_init(table_function: TableFunction, func: TableFunctionInitFunction): void;
|
|
1245
|
+
|
|
1188
1246
|
// DUCKDB_C_API void duckdb_table_function_set_local_init(duckdb_table_function table_function, duckdb_table_function_init_t init);
|
|
1247
|
+
export function table_function_set_local_init(table_function: TableFunction, func: TableFunctionInitFunction): void;
|
|
1248
|
+
|
|
1189
1249
|
// DUCKDB_C_API void duckdb_table_function_set_function(duckdb_table_function table_function, duckdb_table_function_t function);
|
|
1250
|
+
export function table_function_set_function(table_function: TableFunction, func: TableFunctionMainFunction): void;
|
|
1251
|
+
|
|
1190
1252
|
// DUCKDB_C_API void duckdb_table_function_supports_projection_pushdown(duckdb_table_function table_function, bool pushdown);
|
|
1253
|
+
export function table_function_supports_projection_pushdown(table_function: TableFunction, pushdown: boolean): void;
|
|
1254
|
+
|
|
1191
1255
|
// DUCKDB_C_API duckdb_state duckdb_register_table_function(duckdb_connection con, duckdb_table_function function);
|
|
1256
|
+
export function register_table_function(connection: Connection, table_function: TableFunction): void;
|
|
1192
1257
|
|
|
1193
1258
|
// DUCKDB_C_API void *duckdb_bind_get_extra_info(duckdb_bind_info info);
|
|
1259
|
+
export function bind_get_extra_info(bind_info: TableFunctionBindInfo): object | undefined;
|
|
1260
|
+
|
|
1194
1261
|
// DUCKDB_C_API void duckdb_table_function_get_client_context(duckdb_bind_info info, duckdb_client_context *out_context);
|
|
1262
|
+
export function table_function_get_client_context(bind_info: TableFunctionBindInfo): ClientContext;
|
|
1263
|
+
|
|
1195
1264
|
// DUCKDB_C_API void duckdb_bind_add_result_column(duckdb_bind_info info, const char *name, duckdb_logical_type type);
|
|
1265
|
+
export function bind_add_result_column(bind_info: TableFunctionBindInfo, name: string, logical_type: LogicalType): void;
|
|
1266
|
+
|
|
1196
1267
|
// DUCKDB_C_API idx_t duckdb_bind_get_parameter_count(duckdb_bind_info info);
|
|
1268
|
+
export function bind_get_parameter_count(bind_info: TableFunctionBindInfo): number;
|
|
1269
|
+
|
|
1197
1270
|
// DUCKDB_C_API duckdb_value duckdb_bind_get_parameter(duckdb_bind_info info, idx_t index);
|
|
1271
|
+
export function bind_get_parameter(bind_info: TableFunctionBindInfo, index: number): Value;
|
|
1272
|
+
|
|
1198
1273
|
// DUCKDB_C_API duckdb_value duckdb_bind_get_named_parameter(duckdb_bind_info info, const char *name);
|
|
1274
|
+
export function bind_get_named_parameter(bind_info: TableFunctionBindInfo, name: string): Value | null;
|
|
1275
|
+
|
|
1199
1276
|
// DUCKDB_C_API void duckdb_bind_set_bind_data(duckdb_bind_info info, void *bind_data, duckdb_delete_callback_t destroy);
|
|
1277
|
+
export function bind_set_bind_data(bind_info: TableFunctionBindInfo, bind_data: object): void;
|
|
1278
|
+
|
|
1200
1279
|
// DUCKDB_C_API void duckdb_bind_set_cardinality(duckdb_bind_info info, idx_t cardinality, bool is_exact);
|
|
1280
|
+
export function bind_set_cardinality(bind_info: TableFunctionBindInfo, cardinality: number, is_exact: boolean): void;
|
|
1281
|
+
|
|
1201
1282
|
// DUCKDB_C_API void duckdb_bind_set_error(duckdb_bind_info info, const char *error);
|
|
1283
|
+
export function bind_set_error(bind_info: TableFunctionBindInfo, error: string): void;
|
|
1202
1284
|
|
|
1203
1285
|
// DUCKDB_C_API void *duckdb_init_get_extra_info(duckdb_init_info info);
|
|
1286
|
+
export function init_get_extra_info(init_info: TableFunctionInitInfo): object | undefined;
|
|
1287
|
+
|
|
1204
1288
|
// DUCKDB_C_API void *duckdb_init_get_bind_data(duckdb_init_info info);
|
|
1289
|
+
export function init_get_bind_data(init_info: TableFunctionInitInfo): object | undefined;
|
|
1290
|
+
|
|
1205
1291
|
// DUCKDB_C_API void duckdb_init_set_init_data(duckdb_init_info info, void *init_data, duckdb_delete_callback_t destroy);
|
|
1292
|
+
export function init_set_init_data(init_info: TableFunctionInitInfo, init_data: object): void;
|
|
1293
|
+
|
|
1206
1294
|
// DUCKDB_C_API idx_t duckdb_init_get_column_count(duckdb_init_info info);
|
|
1295
|
+
export function init_get_column_count(init_info: TableFunctionInitInfo): number;
|
|
1296
|
+
|
|
1207
1297
|
// DUCKDB_C_API idx_t duckdb_init_get_column_index(duckdb_init_info info, idx_t column_index);
|
|
1298
|
+
export function init_get_column_index(init_info: TableFunctionInitInfo, column_index: number): number;
|
|
1299
|
+
|
|
1208
1300
|
// DUCKDB_C_API void duckdb_init_set_max_threads(duckdb_init_info info, idx_t max_threads);
|
|
1301
|
+
export function init_set_max_threads(init_info: TableFunctionInitInfo, max_threads: number): void;
|
|
1302
|
+
|
|
1209
1303
|
// DUCKDB_C_API void duckdb_init_set_error(duckdb_init_info info, const char *error);
|
|
1304
|
+
export function init_set_error(init_info: TableFunctionInitInfo, error: string): void;
|
|
1210
1305
|
|
|
1211
1306
|
// DUCKDB_C_API void *duckdb_function_get_extra_info(duckdb_function_info info);
|
|
1307
|
+
export function function_get_extra_info(function_info: TableFunctionInfo): object | undefined;
|
|
1308
|
+
|
|
1212
1309
|
// DUCKDB_C_API void *duckdb_function_get_bind_data(duckdb_function_info info);
|
|
1310
|
+
export function function_get_bind_data(function_info: TableFunctionInfo): object | undefined;
|
|
1311
|
+
|
|
1213
1312
|
// DUCKDB_C_API void *duckdb_function_get_init_data(duckdb_function_info info);
|
|
1313
|
+
export function function_get_init_data(function_info: TableFunctionInfo): object | undefined;
|
|
1314
|
+
|
|
1214
1315
|
// DUCKDB_C_API void *duckdb_function_get_local_init_data(duckdb_function_info info);
|
|
1316
|
+
export function function_get_local_init_data(function_info: TableFunctionInfo): object | undefined;
|
|
1317
|
+
|
|
1215
1318
|
// DUCKDB_C_API void duckdb_function_set_error(duckdb_function_info info, const char *error);
|
|
1319
|
+
export function function_set_error(function_info: TableFunctionInfo, error: string): void;
|
|
1216
1320
|
|
|
1217
1321
|
// DUCKDB_C_API void duckdb_add_replacement_scan(duckdb_database db, duckdb_replacement_callback_t replacement, void *extra_data, duckdb_delete_callback_t delete_callback);
|
|
1218
1322
|
// DUCKDB_C_API void duckdb_replacement_scan_set_function_name(duckdb_replacement_scan_info info, const char *function_name);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@duckdb/node-bindings",
|
|
3
|
-
"version": "1.5.5-r.
|
|
3
|
+
"version": "1.5.5-r.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./duckdb.js",
|
|
6
6
|
"types": "./duckdb.d.ts",
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
"detect-libc": "^2.1.2"
|
|
9
9
|
},
|
|
10
10
|
"optionalDependencies": {
|
|
11
|
-
"@duckdb/node-bindings-darwin-arm64": "1.5.5-r.
|
|
12
|
-
"@duckdb/node-bindings-
|
|
13
|
-
"@duckdb/node-bindings-linux-arm64-musl": "1.5.5-r.
|
|
14
|
-
"@duckdb/node-bindings-linux-x64": "1.5.5-r.
|
|
15
|
-
"@duckdb/node-bindings-
|
|
16
|
-
"@duckdb/node-bindings-linux-x64-musl": "1.5.5-r.
|
|
17
|
-
"@duckdb/node-bindings-win32-arm64": "1.5.5-r.
|
|
18
|
-
"@duckdb/node-bindings-win32-x64": "1.5.5-r.
|
|
11
|
+
"@duckdb/node-bindings-darwin-arm64": "1.5.5-r.4",
|
|
12
|
+
"@duckdb/node-bindings-linux-arm64": "1.5.5-r.4",
|
|
13
|
+
"@duckdb/node-bindings-linux-arm64-musl": "1.5.5-r.4",
|
|
14
|
+
"@duckdb/node-bindings-linux-x64": "1.5.5-r.4",
|
|
15
|
+
"@duckdb/node-bindings-darwin-x64": "1.5.5-r.4",
|
|
16
|
+
"@duckdb/node-bindings-linux-x64-musl": "1.5.5-r.4",
|
|
17
|
+
"@duckdb/node-bindings-win32-arm64": "1.5.5-r.4",
|
|
18
|
+
"@duckdb/node-bindings-win32-x64": "1.5.5-r.4"
|
|
19
19
|
},
|
|
20
20
|
"repository": {
|
|
21
21
|
"type": "git",
|