From 17333b0485ca7ea25f8a1f1116107d469529a189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20M=C3=BChleisen?= Date: Fri, 7 Jun 2024 13:16:42 +0200 Subject: [PATCH] also remove extension hooks --- generate-wrapper.py | 37 +------------------ lib/duckdb.d.ts | 30 +++------------- src/duckdb_node.cpp | 2 ++ src/duckdb_node_generated.cpp | 67 ++++++----------------------------- 4 files changed, 19 insertions(+), 117 deletions(-) diff --git a/generate-wrapper.py b/generate-wrapper.py index a2e04476..d7c8961c 100644 --- a/generate-wrapper.py +++ b/generate-wrapper.py @@ -40,44 +40,9 @@ 'duckdb_prepared_statement', 'duckdb_value', 'duckdb_vector', - #'duckdb_arrow', - #'duckdb_arrow_array', - #'duckdb_arrow_schema', - #'duckdb_arrow_stream', ] deprecated_functions = [ - 'duckdb_column_data', - 'duckdb_nullmask_data', - 'duckdb_validity_row_is_valid', - 'duckdb_validity_set_row_invalid', - 'duckdb_validity_set_row_valid', - 'duckdb_validity_set_row_validity', - 'duckdb_vector_ensure_validity_writable', - 'duckdb_value_blob', - 'duckdb_value_boolean', - 'duckdb_value_date', - 'duckdb_value_decimal', - 'duckdb_value_double', - 'duckdb_value_float', - 'duckdb_value_hugeint', - 'duckdb_value_int16', - 'duckdb_value_int32', - 'duckdb_value_int64', - 'duckdb_value_int8', - 'duckdb_value_interval', - 'duckdb_value_is_null', - 'duckdb_value_string', - 'duckdb_value_string_internal', - 'duckdb_value_time', - 'duckdb_value_timestamp', - 'duckdb_value_uint16', - 'duckdb_value_uint32', - 'duckdb_value_uint64', - 'duckdb_value_uint8', - 'duckdb_value_varchar', - 'duckdb_value_varchar_internal', - "duckdb_bind_set_bind_data", ] def typename(decl): @@ -257,7 +222,7 @@ def create_func_defs(filename): zip.extract("duckdb.h", tmp) os.system("sed -i -e 's/#include /#include /' %s" % os.path.join(tmp, "duckdb.h")) # until 0.10.0 has been released - os.system("gcc -DDUCKDB_API_NO_DEPRECATED -E -D__builtin_va_list=int %s > %s" % (os.path.join(tmp, "duckdb.h"), os.path.join(tmp, "duckdb-preprocessed.h"))) + os.system("gcc -DDUCKDB_NO_EXTENSION_FUNCTIONS -DDUCKDB_API_NO_DEPRECATED -E -D__builtin_va_list=int %s > %s" % (os.path.join(tmp, "duckdb.h"), os.path.join(tmp, "duckdb-preprocessed.h"))) cpp_result, types_result = create_func_defs(os.path.join(tmp, "duckdb-preprocessed.h")) diff --git a/lib/duckdb.d.ts b/lib/duckdb.d.ts index 61a4428d..c6ad8c94 100644 --- a/lib/duckdb.d.ts +++ b/lib/duckdb.d.ts @@ -119,11 +119,6 @@ export class duckdb_config {} export class duckdb_logical_type {} export class duckdb_data_chunk {} export class duckdb_value {} -export class duckdb_table_function {} -export class duckdb_bind_info {} -export class duckdb_init_info {} -export class duckdb_function_info {} -export class duckdb_replacement_scan_info {} export class duckdb_arrow {} export class duckdb_arrow_stream {} export class duckdb_arrow_schema {} @@ -262,6 +257,7 @@ export function duckdb_data_chunk_set_size(chunk: duckdb_data_chunk, size: numbe export function duckdb_vector_get_column_type(vector: duckdb_vector): duckdb_logical_type; export function duckdb_vector_get_data(vector: duckdb_vector): pointer; export function duckdb_vector_get_validity(vector: duckdb_vector): uint64_pointer; +export function duckdb_vector_ensure_validity_writable(vector: duckdb_vector): void; export function duckdb_vector_assign_string_element(vector: duckdb_vector, index: number, str: string): void; export function duckdb_vector_assign_string_element_len(vector: duckdb_vector, index: number, str: string, str_len: number): void; export function duckdb_list_vector_get_child(vector: duckdb_vector): duckdb_vector; @@ -270,18 +266,10 @@ export function duckdb_list_vector_set_size(vector: duckdb_vector, size: number) export function duckdb_list_vector_reserve(vector: duckdb_vector, required_capacity: number): duckdb_state; export function duckdb_struct_vector_get_child(vector: duckdb_vector, index: number): duckdb_vector; export function duckdb_array_vector_get_child(vector: duckdb_vector): duckdb_vector; -export function duckdb_bind_get_extra_info(info: duckdb_bind_info): pointer; -export function duckdb_bind_add_result_column(info: duckdb_bind_info, name: string, type: duckdb_logical_type): void; -export function duckdb_bind_get_parameter_count(info: duckdb_bind_info): number; -export function duckdb_bind_get_parameter(info: duckdb_bind_info, index: number): duckdb_value; -export function duckdb_bind_get_named_parameter(info: duckdb_bind_info, name: string): duckdb_value; -export function duckdb_bind_set_cardinality(info: duckdb_bind_info, cardinality: number, is_exact: boolean): void; -export function duckdb_bind_set_error(info: duckdb_bind_info, error: string): void; -export function duckdb_function_get_extra_info(info: duckdb_function_info): pointer; -export function duckdb_function_get_bind_data(info: duckdb_function_info): pointer; -export function duckdb_function_get_init_data(info: duckdb_function_info): pointer; -export function duckdb_function_get_local_init_data(info: duckdb_function_info): pointer; -export function duckdb_function_set_error(info: duckdb_function_info, error: string): void; +export function duckdb_validity_row_is_valid(validity: uint64_pointer, row: number): boolean; +export function duckdb_validity_set_row_validity(validity: uint64_pointer, row: number, valid: boolean): void; +export function duckdb_validity_set_row_invalid(validity: uint64_pointer, row: number): void; +export function duckdb_validity_set_row_valid(validity: uint64_pointer, row: number): void; export function duckdb_appender_create(connection: duckdb_connection, schema: string, table: string, out_appender: duckdb_appender): Promise; export function duckdb_appender_column_count(appender: duckdb_appender): number; export function duckdb_appender_column_type(appender: duckdb_appender, col_idx: number): duckdb_logical_type; @@ -313,14 +301,6 @@ export function duckdb_append_varchar_length(appender: duckdb_appender, val: str export function duckdb_append_blob(appender: duckdb_appender, data: pointer, length: number): duckdb_state; export function duckdb_append_null(appender: duckdb_appender): duckdb_state; export function duckdb_append_data_chunk(appender: duckdb_appender, chunk: duckdb_data_chunk): duckdb_state; -export function duckdb_execute_tasks(database: duckdb_database, max_tasks: number): Promise; -export function duckdb_create_task_state(database: duckdb_database): duckdb_task_state; -export function duckdb_execute_tasks_state(state: duckdb_task_state): void; -export function duckdb_execute_n_tasks_state(state: duckdb_task_state, max_tasks: number): number; -export function duckdb_finish_execution(state: duckdb_task_state): void; -export function duckdb_task_state_is_finished(state: duckdb_task_state): boolean; -export function duckdb_destroy_task_state(state: duckdb_task_state): void; -export function duckdb_execution_is_finished(con: duckdb_connection): boolean; export function duckdb_fetch_chunk(result: duckdb_result): duckdb_data_chunk; // bindings-defined constants export const sizeof_bool: number; diff --git a/src/duckdb_node.cpp b/src/duckdb_node.cpp index 48ef01de..73547d4f 100644 --- a/src/duckdb_node.cpp +++ b/src/duckdb_node.cpp @@ -6,7 +6,9 @@ static void *duckdb_node_dlopen_handle; +#define DUCKDB_NO_EXTENSION_FUNCTIONS #define DUCKDB_API_NO_DEPRECATED + // this file contains generated template instantiations from duckdb.h #include "duckdb_node_generated.cpp" diff --git a/src/duckdb_node_generated.cpp b/src/duckdb_node_generated.cpp index b420db1f..440d00b8 100644 --- a/src/duckdb_node_generated.cpp +++ b/src/duckdb_node_generated.cpp @@ -533,6 +533,9 @@ static void RegisterGenerated(Napi::Env env, Napi::Object exports, exports.Set( Napi::String::New(env, "duckdb_vector_get_validity"), Napi::Function::New>(env)); + exports.Set( + Napi::String::New(env, "duckdb_vector_ensure_validity_writable"), + Napi::Function::New>(env)); exports.Set( Napi::String::New(env, "duckdb_vector_assign_string_element"), Napi::Function::New>(env)); @@ -558,41 +561,17 @@ static void RegisterGenerated(Napi::Env env, Napi::Object exports, Napi::String::New(env, "duckdb_array_vector_get_child"), Napi::Function::New>(env)); exports.Set( - Napi::String::New(env, "duckdb_bind_get_extra_info"), - Napi::Function::New>(env)); - exports.Set( - Napi::String::New(env, "duckdb_bind_add_result_column"), - Napi::Function::New>(env)); - exports.Set( - Napi::String::New(env, "duckdb_bind_get_parameter_count"), - Napi::Function::New>(env)); - exports.Set( - Napi::String::New(env, "duckdb_bind_get_parameter"), - Napi::Function::New>(env)); - exports.Set( - Napi::String::New(env, "duckdb_bind_get_named_parameter"), - Napi::Function::New>(env)); - exports.Set( - Napi::String::New(env, "duckdb_bind_set_cardinality"), - Napi::Function::New>(env)); - exports.Set( - Napi::String::New(env, "duckdb_bind_set_error"), - Napi::Function::New>(env)); - exports.Set( - Napi::String::New(env, "duckdb_function_get_extra_info"), - Napi::Function::New>(env)); - exports.Set( - Napi::String::New(env, "duckdb_function_get_bind_data"), - Napi::Function::New>(env)); + Napi::String::New(env, "duckdb_validity_row_is_valid"), + Napi::Function::New>(env)); exports.Set( - Napi::String::New(env, "duckdb_function_get_init_data"), - Napi::Function::New>(env)); + Napi::String::New(env, "duckdb_validity_set_row_validity"), + Napi::Function::New>(env)); exports.Set( - Napi::String::New(env, "duckdb_function_get_local_init_data"), - Napi::Function::New>(env)); + Napi::String::New(env, "duckdb_validity_set_row_invalid"), + Napi::Function::New>(env)); exports.Set( - Napi::String::New(env, "duckdb_function_set_error"), - Napi::Function::New>(env)); + Napi::String::New(env, "duckdb_validity_set_row_valid"), + Napi::Function::New>(env)); exports.Set( Napi::String::New(env, "duckdb_appender_create"), Napi::Function::New>(env)); @@ -686,30 +665,6 @@ static void RegisterGenerated(Napi::Env env, Napi::Object exports, exports.Set( Napi::String::New(env, "duckdb_append_data_chunk"), Napi::Function::New>(env)); - exports.Set( - Napi::String::New(env, "duckdb_execute_tasks"), - Napi::Function::New>(env)); - exports.Set( - Napi::String::New(env, "duckdb_create_task_state"), - Napi::Function::New>(env)); - exports.Set( - Napi::String::New(env, "duckdb_execute_tasks_state"), - Napi::Function::New>(env)); - exports.Set( - Napi::String::New(env, "duckdb_execute_n_tasks_state"), - Napi::Function::New>(env)); - exports.Set( - Napi::String::New(env, "duckdb_finish_execution"), - Napi::Function::New>(env)); - exports.Set( - Napi::String::New(env, "duckdb_task_state_is_finished"), - Napi::Function::New>(env)); - exports.Set( - Napi::String::New(env, "duckdb_destroy_task_state"), - Napi::Function::New>(env)); - exports.Set( - Napi::String::New(env, "duckdb_execution_is_finished"), - Napi::Function::New>(env)); exports.Set( Napi::String::New(env, "duckdb_fetch_chunk"), Napi::Function::New>(env));