@duckdb/node-bindings 1.3.2-alpha.25 → 1.3.2-alpha.26

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.
Files changed (2) hide show
  1. package/duckdb.d.ts +36 -0
  2. package/package.json +6 -6
package/duckdb.d.ts CHANGED
@@ -170,6 +170,10 @@ export interface TimestampParts {
170
170
  time: TimeParts;
171
171
  }
172
172
 
173
+ export interface FunctionInfo {
174
+ __duckdb_type: 'duckdb_function_info';
175
+ }
176
+
173
177
  export interface Vector {
174
178
  __duckdb_type: 'duckdb_vector';
175
179
  }
@@ -228,6 +232,10 @@ export interface Result {
228
232
  __duckdb_type: 'duckdb_result';
229
233
  }
230
234
 
235
+ export interface ScalarFunction {
236
+ __duckdb_type: 'duckdb_scalar_function';
237
+ }
238
+
231
239
  // export interface SelectionVector {
232
240
  // __duckdb_type: 'duckdb_selection_vector';
233
241
  // }
@@ -248,6 +256,7 @@ export interface ExtractedStatementsAndCount {
248
256
  statement_count: number;
249
257
  }
250
258
 
259
+ export type ScalarFunctionMainFunction = (info: FunctionInfo, input: DataChunk, output: Vector) => void;
251
260
 
252
261
  // Functions
253
262
 
@@ -1013,23 +1022,50 @@ export function validity_set_row_invalid(validity: Uint8Array, row_index: number
1013
1022
  export function validity_set_row_valid(validity: Uint8Array, row_index: number): void;
1014
1023
 
1015
1024
  // DUCKDB_C_API duckdb_scalar_function duckdb_create_scalar_function();
1025
+ export function create_scalar_function(): ScalarFunction;
1026
+
1016
1027
  // DUCKDB_C_API void duckdb_destroy_scalar_function(duckdb_scalar_function *scalar_function);
1028
+ export function destroy_scalar_function_sync(scalar_function: ScalarFunction): void;
1029
+
1017
1030
  // DUCKDB_C_API void duckdb_scalar_function_set_name(duckdb_scalar_function scalar_function, const char *name);
1031
+ export function scalar_function_set_name(scalar_function: ScalarFunction, name: string): void;
1032
+
1018
1033
  // DUCKDB_C_API void duckdb_scalar_function_set_varargs(duckdb_scalar_function scalar_function, duckdb_logical_type type);
1034
+ export function scalar_function_set_varargs(scalar_function: ScalarFunction, logical_type: LogicalType): void;
1035
+
1019
1036
  // DUCKDB_C_API void duckdb_scalar_function_set_special_handling(duckdb_scalar_function scalar_function);
1037
+ export function scalar_function_set_special_handling(scalar_function: ScalarFunction): void;
1038
+
1020
1039
  // DUCKDB_C_API void duckdb_scalar_function_set_volatile(duckdb_scalar_function scalar_function);
1040
+ export function scalar_function_set_volatile(scalar_function: ScalarFunction): void;
1041
+
1021
1042
  // DUCKDB_C_API void duckdb_scalar_function_add_parameter(duckdb_scalar_function scalar_function, duckdb_logical_type type);
1043
+ export function scalar_function_add_parameter(scalar_function: ScalarFunction, logical_type: LogicalType): void;
1044
+
1022
1045
  // DUCKDB_C_API void duckdb_scalar_function_set_return_type(duckdb_scalar_function scalar_function, duckdb_logical_type type);
1046
+ export function scalar_function_set_return_type(scalar_function: ScalarFunction, logical_type: LogicalType): void;
1047
+
1023
1048
  // DUCKDB_C_API void duckdb_scalar_function_set_extra_info(duckdb_scalar_function scalar_function, void *extra_info, duckdb_delete_callback_t destroy);
1049
+ export function scalar_function_set_extra_info(scalar_function: ScalarFunction, extra_info: object): void;
1050
+
1024
1051
  // DUCKDB_C_API void duckdb_scalar_function_set_bind(duckdb_scalar_function scalar_function, duckdb_scalar_function_bind_t bind);
1025
1052
  // DUCKDB_C_API void duckdb_scalar_function_set_bind_data(duckdb_bind_info info, void *bind_data, duckdb_delete_callback_t destroy);
1026
1053
  // DUCKDB_C_API void duckdb_scalar_function_bind_set_error(duckdb_bind_info info, const char *error);
1054
+
1027
1055
  // DUCKDB_C_API void duckdb_scalar_function_set_function(duckdb_scalar_function scalar_function, duckdb_scalar_function_t function);
1056
+ export function scalar_function_set_function(scalar_function: ScalarFunction, func: ScalarFunctionMainFunction): void;
1057
+
1028
1058
  // DUCKDB_C_API duckdb_state duckdb_register_scalar_function(duckdb_connection con, duckdb_scalar_function scalar_function);
1059
+ export function register_scalar_function(connection: Connection, scalar_function: ScalarFunction): void;
1060
+
1029
1061
  // DUCKDB_C_API void *duckdb_scalar_function_get_extra_info(duckdb_function_info info);
1062
+ export function scalar_function_get_extra_info(function_info: FunctionInfo): object | undefined;
1063
+
1030
1064
  // DUCKDB_C_API void *duckdb_scalar_function_get_bind_data(duckdb_function_info info);
1031
1065
  // DUCKDB_C_API void duckdb_scalar_function_get_client_context(duckdb_bind_info info, duckdb_client_context *out_context);
1066
+
1032
1067
  // DUCKDB_C_API void duckdb_scalar_function_set_error(duckdb_function_info info, const char *error);
1068
+ export function scalar_function_set_error(function_info: FunctionInfo, error: string): void;
1033
1069
 
1034
1070
  // DUCKDB_C_API duckdb_scalar_function_set duckdb_create_scalar_function_set(const char *name);
1035
1071
  // DUCKDB_C_API void duckdb_destroy_scalar_function_set(duckdb_scalar_function_set *scalar_function_set);
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@duckdb/node-bindings",
3
- "version": "1.3.2-alpha.25",
3
+ "version": "1.3.2-alpha.26",
4
4
  "license": "MIT",
5
5
  "main": "./duckdb.js",
6
6
  "types": "./duckdb.d.ts",
7
7
  "optionalDependencies": {
8
- "@duckdb/node-bindings-darwin-arm64": "1.3.2-alpha.25",
9
- "@duckdb/node-bindings-darwin-x64": "1.3.2-alpha.25",
10
- "@duckdb/node-bindings-linux-arm64": "1.3.2-alpha.25",
11
- "@duckdb/node-bindings-linux-x64": "1.3.2-alpha.25",
12
- "@duckdb/node-bindings-win32-x64": "1.3.2-alpha.25"
8
+ "@duckdb/node-bindings-darwin-arm64": "1.3.2-alpha.26",
9
+ "@duckdb/node-bindings-darwin-x64": "1.3.2-alpha.26",
10
+ "@duckdb/node-bindings-linux-arm64": "1.3.2-alpha.26",
11
+ "@duckdb/node-bindings-linux-x64": "1.3.2-alpha.26",
12
+ "@duckdb/node-bindings-win32-x64": "1.3.2-alpha.26"
13
13
  },
14
14
  "repository": {
15
15
  "type": "git",