From 19ca8f2f9d0705831556067fdd9c45cc28a9294f Mon Sep 17 00:00:00 2001 From: DuckLabs GitHub Bot Date: Mon, 19 Oct 2026 02:42:12 +0000 Subject: [PATCH 1/2] Update vendored DuckDB sources to 804b3f2070e --- .../core_functions/scalar/date/date_part.cpp | 5 +- ...nerated_extension_loader_package_build.cpp | 8 +- src/duckdb/src/common/file_system.cpp | 10 + .../src/function/scalar/string/like.cpp | 5 +- .../src/function/table/arrow_conversion.cpp | 25 +- .../function/table/system/duckdb_settings.cpp | 30 +- .../function/table/version/pragma_version.cpp | 6 +- .../duckdb/main/capi_v2/extension_api_v2.hpp | 216 +- .../include/duckdb/main/http/http_util.hpp | 3 + .../include/duckdb/main/query_profiler.hpp | 5 + src/duckdb/src/include/duckdb_extension_v2.h | 2548 +++++++++++----- src/duckdb/src/include/duckdb_v2.h | 2585 +++++++++++++---- .../main/capi/v2/capi_v2_query_metrics.cpp | 220 ++ src/duckdb/src/main/extension.cpp | 7 + src/duckdb/src/main/http/http_util.cpp | 5 +- src/duckdb/src/main/query_profiler.cpp | 11 + .../rule/list_comprehension_rewrite.cpp | 28 +- .../parser/expression/operator_expression.cpp | 63 + .../expression/bind_window_expression.cpp | 9 +- .../expression/bound_cast_expression.cpp | 4 + .../serialize_parsed_expression.cpp | 11 - src/duckdb/ub_src_main_capi_v2.cpp | 2 + 22 files changed, 4421 insertions(+), 1385 deletions(-) create mode 100644 src/duckdb/src/main/capi/v2/capi_v2_query_metrics.cpp diff --git a/src/duckdb/extension/core_functions/scalar/date/date_part.cpp b/src/duckdb/extension/core_functions/scalar/date/date_part.cpp index 5663e2957..09e4d8070 100644 --- a/src/duckdb/extension/core_functions/scalar/date/date_part.cpp +++ b/src/duckdb/extension/core_functions/scalar/date/date_part.cpp @@ -2671,9 +2671,8 @@ ScalarFunctionSet HoursFun::GetFunctions() { } ScalarFunctionSet YearWeekFun::GetFunctions() { - auto set = GetDatePartFunction(); - set.SetUnaryArgProperties(ArgProperties().NonDecreasing()); - return set; + // Not monotone on the full date domain: see YearWeekOperator::YearWeekFromParts. + return GetDatePartFunction(); } ScalarFunctionSet DayOfMonthFun::GetFunctions() { diff --git a/src/duckdb/generated_extension_loader_package_build.cpp b/src/duckdb/generated_extension_loader_package_build.cpp index e647b4f1e..e75186b0b 100644 --- a/src/duckdb/generated_extension_loader_package_build.cpp +++ b/src/duckdb/generated_extension_loader_package_build.cpp @@ -45,7 +45,7 @@ int32_t duckdb_extension_core_functions_describe(duckdb_extension_descriptor *de descriptor->version = 1; descriptor->name = "core_functions"; descriptor->extension_version = EXT_VERSION_CORE_FUNCTIONS; - descriptor->api_version = "v2.0.0-alpha48780"; + descriptor->api_version = "v2.0.0-alpha48841"; descriptor->entry_cpp = (void (*)(void))core_functions_duckdb_cpp_init; return 0; } @@ -78,7 +78,7 @@ int32_t duckdb_extension_parquet_describe(duckdb_extension_descriptor *descripto descriptor->version = 1; descriptor->name = "parquet"; descriptor->extension_version = EXT_VERSION_PARQUET; - descriptor->api_version = "v2.0.0-alpha48780"; + descriptor->api_version = "v2.0.0-alpha48841"; descriptor->entry_cpp = (void (*)(void))parquet_duckdb_cpp_init; return 0; } @@ -111,7 +111,7 @@ int32_t duckdb_extension_icu_describe(duckdb_extension_descriptor *descriptor) { descriptor->version = 1; descriptor->name = "icu"; descriptor->extension_version = EXT_VERSION_ICU; - descriptor->api_version = "v2.0.0-alpha48780"; + descriptor->api_version = "v2.0.0-alpha48841"; descriptor->entry_cpp = (void (*)(void))icu_duckdb_cpp_init; return 0; } @@ -144,7 +144,7 @@ int32_t duckdb_extension_json_describe(duckdb_extension_descriptor *descriptor) descriptor->version = 1; descriptor->name = "json"; descriptor->extension_version = EXT_VERSION_JSON; - descriptor->api_version = "v2.0.0-alpha48780"; + descriptor->api_version = "v2.0.0-alpha48841"; descriptor->entry_cpp = (void (*)(void))json_duckdb_cpp_init; return 0; } diff --git a/src/duckdb/src/common/file_system.cpp b/src/duckdb/src/common/file_system.cpp index 5eed10a6f..62a7b2b8f 100644 --- a/src/duckdb/src/common/file_system.cpp +++ b/src/duckdb/src/common/file_system.cpp @@ -288,6 +288,16 @@ string FileSystem::GetWorkingDirectory() { #endif string FileSystem::JoinPath(const string &a, const string &b) { + // A remote URL may carry a "?query" suffix (object version, requester-pays, an SSE-C key, ...). + // Appending a path segment after it would bury the query mid-path and corrupt both the query and + // the object path, so join onto the path without the query and keep the query at the very end. + auto scheme = a.find("://"); + if (scheme != string::npos) { + auto query = a.find('?', scheme + 3); + if (query != string::npos) { + return Path::FromString(a.substr(0, query)).Join(b).ToString() + a.substr(query); + } + } return Path::FromString(a).Join(b).ToString(); } diff --git a/src/duckdb/src/function/scalar/string/like.cpp b/src/duckdb/src/function/scalar/string/like.cpp index 199e00a3f..6ffc841de 100644 --- a/src/duckdb/src/function/scalar/string/like.cpp +++ b/src/duckdb/src/function/scalar/string/like.cpp @@ -40,11 +40,8 @@ static bool GlobMatchesBracket(char s, const char *pattern, idx_t plen, idx_t &p break; } bool matches; - if (pattern[pidx + 1] == '-') { + if (pattern[pidx + 1] == '-' && pidx + 2 < plen && pattern[pidx + 2] != ']') { // range! find the next character in the range - if (pidx + 2 == plen) { - break; - } auto next_char = pattern[pidx + 2]; // check if the current character is within the range matches = s >= p && s <= next_char; diff --git a/src/duckdb/src/function/table/arrow_conversion.cpp b/src/duckdb/src/function/table/arrow_conversion.cpp index b2bbae167..5beb57f2c 100644 --- a/src/duckdb/src/function/table/arrow_conversion.cpp +++ b/src/duckdb/src/function/table/arrow_conversion.cpp @@ -1459,6 +1459,27 @@ static bool CanContainNull(const ArrowArray &array, const ValidityMask *parent_m return parent_mask->CanHaveNull(); } +// Arrow's null type converts to a constant vector, and FlatVector::SetNull needs flat vectors along its recursion +// into STRUCT and ARRAY children, which never reaches LIST contents. +static void FlattenForSetNull(Vector &vector) { + if (vector.GetVectorType() != VectorType::FLAT_VECTOR) { + vector.Flatten(); + return; + } + switch (vector.GetType().InternalType()) { + case PhysicalType::STRUCT: + for (auto &entry : StructVector::GetEntries(vector)) { + FlattenForSetNull(entry); + } + break; + case PhysicalType::ARRAY: + FlattenForSetNull(ArrayVector::GetChildMutable(vector)); + break; + default: + break; + } +} + void ArrowToDuckDBConversion::ColumnArrowToDuckDBDictionary(Vector &vector, ArrowArray &array, idx_t chunk_offset, ArrowArrayScanState &array_state, idx_t size, const ArrowType &arrow_type, int64_t nested_offset, @@ -1476,7 +1497,6 @@ void ArrowToDuckDBConversion::ColumnArrowToDuckDBDictionary(Vector &vector, Arro auto dict_length = NumericCast(array.dictionary->length); auto base_vector = make_uniq(vector.GetType(), dict_length + 1); ArrowToDuckDBConversion::SetValidityMask(*base_vector, *array.dictionary, 0, dict_length, 0, 0, has_nulls); - FlatVector::ValidityMutable(*base_vector).SetInvalid(dict_length); auto &dictionary_type = arrow_type.GetDictionary(); auto arrow_physical_type = dictionary_type.GetPhysicalType(); ; @@ -1502,6 +1522,9 @@ void ArrowToDuckDBConversion::ColumnArrowToDuckDBDictionary(Vector &vector, Arro // dict_length. Re-extend before sizing so the sentinel slot stays in bounds. base_vector->Reserve(dict_length + 1); FlatVector::SetSize(*base_vector, count_t(dict_length + 1)); + // nested children of the sentinel slot hold uninitialized data unless they are marked NULL as well + FlattenForSetNull(*base_vector); + FlatVector::SetNull(*base_vector, dict_length, true); array_state.AddDictionary(std::move(base_vector), array.dictionary); } auto offset_type = arrow_type.GetDuckType(); diff --git a/src/duckdb/src/function/table/system/duckdb_settings.cpp b/src/duckdb/src/function/table/system/duckdb_settings.cpp index 60abe9ce6..b90d72b5f 100644 --- a/src/duckdb/src/function/table/system/duckdb_settings.cpp +++ b/src/duckdb/src/function/table/system/duckdb_settings.cpp @@ -29,6 +29,12 @@ struct DuckDBSettingsData : public GlobalTableFunctionState { struct DuckDBSettingsBindData : public TableFunctionData { bool debug = false; bool deprecated = false; + //! Ignore the debug and deprecated filters + bool include_all = false; + + bool Includes(bool is_debug, bool is_deprecated) const { + return include_all || (debug == is_debug && deprecated == is_deprecated); + } }; static unique_ptr DuckDBSettingsBind(ClientContext &context, TableFunctionBindInput &input, @@ -55,7 +61,7 @@ static unique_ptr DuckDBSettingsBind(ClientContext &context, Table return_types.emplace_back(LogicalType::VARIANT()); auto result = make_uniq(); - for (auto name : {"debug", "deprecated"}) { + for (auto name : {"debug", "deprecated", "include_all"}) { auto it = input.named_parameters.find(name); if (it != input.named_parameters.end() && it->second.IsNull()) { throw InvalidInputException("Cannot use NULL as argument for %s", name); @@ -69,6 +75,14 @@ static unique_ptr DuckDBSettingsBind(ClientContext &context, Table result->deprecated = it->second.GetValue(); } + if (auto it = input.named_parameters.find("include_all"); it != input.named_parameters.end()) { + result->include_all = it->second.GetValue(); + } + auto ¶ms = input.named_parameters; + if (result->include_all && (params.find("debug") != params.end() || params.find("deprecated") != params.end())) { + throw InvalidInputException("Cannot combine include_all := true with the debug or deprecated filters"); + } + return std::move(result); } @@ -87,10 +101,7 @@ unique_ptr DuckDBSettingsInit(ClientContext &context, for (idx_t i = 0; i < options_count; i++) { auto option = DBConfig::GetOptionByIndex(i); D_ASSERT(option); - if (bind_data.debug != option->is_debug) { - continue; - } - if (bind_data.deprecated != option->is_deprecated) { + if (!bind_data.Includes(option->is_debug, option->is_deprecated)) { continue; } DuckDBSettingValue value; @@ -122,10 +133,7 @@ unique_ptr DuckDBSettingsInit(ClientContext &context, result->settings.push_back(std::move(value)); } for (auto &ext_param : config.GetExtensionSettings()) { - if (bind_data.debug != ext_param.second.is_debug) { - continue; - } - if (bind_data.deprecated != ext_param.second.is_deprecated) { + if (!bind_data.Includes(ext_param.second.is_debug, ext_param.second.is_deprecated)) { continue; } Value setting_val; @@ -189,7 +197,9 @@ void DuckDBSettingsFunction(ClientContext &context, TableFunctionInput &data_p, void DuckDBSettingsFun::RegisterFunction(BuiltinFunctions &set) { TableFunction settings_fun("duckdb_settings", {}, DuckDBSettingsFunction, DuckDBSettingsBind, DuckDBSettingsInit); settings_fun.GetSignature().WithTypedKwargs("options", [](TypedKwargs &options) { - options.Add("debug", LogicalType::BOOLEAN).Add("deprecated", LogicalType::BOOLEAN); + options.Add("debug", LogicalType::BOOLEAN) + .Add("deprecated", LogicalType::BOOLEAN) + .Add("include_all", LogicalType::BOOLEAN); }); set.AddFunction(settings_fun); } diff --git a/src/duckdb/src/function/table/version/pragma_version.cpp b/src/duckdb/src/function/table/version/pragma_version.cpp index 471376cba..04d9a7899 100644 --- a/src/duckdb/src/function/table/version/pragma_version.cpp +++ b/src/duckdb/src/function/table/version/pragma_version.cpp @@ -1,5 +1,5 @@ #ifndef DUCKDB_PATCH_VERSION -#define DUCKDB_PATCH_VERSION "0-alpha48780" +#define DUCKDB_PATCH_VERSION "0-alpha48841" #endif #ifndef DUCKDB_MINOR_VERSION #define DUCKDB_MINOR_VERSION 0 @@ -8,10 +8,10 @@ #define DUCKDB_MAJOR_VERSION 2 #endif #ifndef DUCKDB_VERSION -#define DUCKDB_VERSION "v2.0.0-alpha48780" +#define DUCKDB_VERSION "v2.0.0-alpha48841" #endif #ifndef DUCKDB_SOURCE_ID -#define DUCKDB_SOURCE_ID "f8f3f4dcd9" +#define DUCKDB_SOURCE_ID "804b3f2070" #endif #include "duckdb/function/table/system_functions.hpp" #include "duckdb/main/database.hpp" diff --git a/src/duckdb/src/include/duckdb/main/capi_v2/extension_api_v2.hpp b/src/duckdb/src/include/duckdb/main/capi_v2/extension_api_v2.hpp index f749148a5..e466e3d8d 100644 --- a/src/duckdb/src/include/duckdb/main/capi_v2/extension_api_v2.hpp +++ b/src/duckdb/src/include/duckdb/main/capi_v2/extension_api_v2.hpp @@ -1105,6 +1105,51 @@ typedef struct { (duckdb_v2_table_function_handle function, duckdb_v2_table_function_partitioning_callback_fn callback, duckdb_v2_error_info_handle *err); DUCKDB_V2_ERROR (*duckdb_v2_validate_utf8)(const duckdb_v2_str *text, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_connection_register_multi_file_function) + (duckdb_v2_connection_handle conn, duckdb_v2_multi_file_function_handle function, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_copy_to_set_statistics_callback) + (duckdb_v2_copy_function_handle function, duckdb_v2_copy_to_statistics_callback_fn callback, + duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_copy_to_statistics_get_bind_data) + (duckdb_v2_copy_to_statistics_info_handle info, void **data, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_copy_to_statistics_get_init_data) + (duckdb_v2_copy_to_statistics_info_handle info, void **data, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_copy_to_statistics_get_user_data) + (duckdb_v2_copy_to_statistics_info_handle info, void **data, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_copy_to_statistics_set_file_size) + (duckdb_v2_copy_to_statistics_info_handle info, idx_t file_size_bytes, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_copy_to_statistics_set_row_count) + (duckdb_v2_copy_to_statistics_info_handle info, idx_t row_count, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_data_chunk_get_capacity) + (duckdb_v2_data_chunk_handle chunk, idx_t *out_capacity, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_extension_register_multi_file_function) + (duckdb_v2_extension_handle extension, duckdb_v2_multi_file_function_handle function, + duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_multi_file_function_create) + (duckdb_v2_factory_handle factory, duckdb_v2_multi_file_function_handle *function, + duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR (*duckdb_v2_multi_file_function_destroy)(duckdb_v2_multi_file_function_handle *function); + DUCKDB_V2_ERROR(*duckdb_v2_multi_file_function_set_file_extension) + (duckdb_v2_multi_file_function_handle function, duckdb_v2_str *extension, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_multi_file_function_set_name) + (duckdb_v2_multi_file_function_handle function, duckdb_v2_str *name, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_multi_file_function_set_reader_type) + (duckdb_v2_multi_file_function_handle function, duckdb_v2_str *reader_type, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_multi_file_function_set_single_file_function) + (duckdb_v2_multi_file_function_handle function, duckdb_v2_str *name, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_table_function_claim_batch_get_bind_data) + (duckdb_v2_table_function_claim_batch_info_handle info, void **data, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_table_function_claim_batch_get_global_state) + (duckdb_v2_table_function_claim_batch_info_handle info, void **data, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_table_function_claim_batch_get_local_state) + (duckdb_v2_table_function_claim_batch_info_handle info, void **data, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_table_function_claim_batch_get_user_data) + (duckdb_v2_table_function_claim_batch_info_handle info, void **data, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_table_function_claim_batch_set_claimed) + (duckdb_v2_table_function_claim_batch_info_handle info, bool claimed, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_table_function_set_claim_batch_callback) + (duckdb_v2_table_function_handle function, duckdb_v2_table_function_claim_batch_callback_fn callback, + duckdb_v2_error_info_handle *err); DUCKDB_V2_ERROR(*duckdb_v2_function_bind_get_arg_count) (duckdb_v2_function_bind_info_handle info, idx_t *positional_fixed, idx_t *positional_variadic, idx_t *named_fixed, idx_t *named_variadic, duckdb_v2_error_info_handle *err); @@ -1160,6 +1205,19 @@ typedef struct { DUCKDB_V2_ERROR(*duckdb_v2_scalar_function_set_resolve_types_callback) (duckdb_v2_scalar_function_handle function, duckdb_v2_scalar_function_resolve_types_callback_fn callback, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_table_function_get_bind_info_get_bind_data) + (duckdb_v2_table_function_get_bind_info_info_handle info, void **data, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_table_function_get_bind_info_get_user_data) + (duckdb_v2_table_function_get_bind_info_info_handle info, void **data, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_table_function_get_bind_info_set_column_identifier) + (duckdb_v2_table_function_get_bind_info_info_handle info, idx_t column_index, const idx_t *child_path, + idx_t child_path_length, duckdb_v2_value_handle identifier, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_table_function_get_bind_info_set_option) + (duckdb_v2_table_function_get_bind_info_info_handle info, duckdb_v2_str *key, duckdb_v2_value_handle value, + duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_table_function_set_get_bind_info_callback) + (duckdb_v2_table_function_handle function, duckdb_v2_table_function_get_bind_info_callback_fn callback, + duckdb_v2_error_info_handle *err); DUCKDB_V2_ERROR(*duckdb_v2_connection_get_factory) (duckdb_v2_connection_handle conn, duckdb_v2_factory_handle *out_factory, duckdb_v2_error_info_handle *err); DUCKDB_V2_ERROR(*duckdb_v2_context_get_factory) @@ -1205,6 +1263,9 @@ typedef struct { (duckdb_v2_connection_handle conn, duckdb_v2_pragma_function_handle function, duckdb_v2_error_info_handle *err); DUCKDB_V2_ERROR(*duckdb_v2_extension_register_pragma_function) (duckdb_v2_extension_handle extension, duckdb_v2_pragma_function_handle function, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_factory_create_common_type) + (duckdb_v2_factory_handle factory, const duckdb_v2_logical_type_handle *types, idx_t type_count, + duckdb_v2_logical_type_handle *out_type, duckdb_v2_error_info_handle *err); DUCKDB_V2_ERROR(*duckdb_v2_function_docs_add_category) (duckdb_v2_function_docs_handle docs, const duckdb_v2_str *category, duckdb_v2_error_info_handle *err); DUCKDB_V2_ERROR(*duckdb_v2_function_docs_add_example) @@ -1322,6 +1383,10 @@ typedef struct { (duckdb_v2_factory_handle factory, duckdb_v2_vector_handle source, duckdb_v2_vector_handle target, DUCKDB_V2_CAST_MODE mode, bool *out_converted, duckdb_v2_error_info_handle *cast_err, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_connection_enable_profiling) + (duckdb_v2_connection_handle conn, bool enabled, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_connection_get_query_metrics) + (duckdb_v2_connection_handle conn, duckdb_v2_query_metrics_handle *metrics, duckdb_v2_error_info_handle *err); DUCKDB_V2_ERROR(*duckdb_v2_copy_function_set_file_extension) (duckdb_v2_copy_function_handle function, const duckdb_v2_str *extension, duckdb_v2_error_info_handle *err); DUCKDB_V2_ERROR (*duckdb_v2_data_chunk_clear)(duckdb_v2_data_chunk_handle chunk, duckdb_v2_error_info_handle *err); @@ -1334,71 +1399,31 @@ typedef struct { DUCKDB_V2_ERROR(*duckdb_v2_file_system_path_remove) (duckdb_v2_file_system_handle file_system, const duckdb_v2_str *path, bool *out_removed, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_statement_add_collection) - (duckdb_v2_sql_statement_handle statement, const duckdb_v2_identifier_t *name, - duckdb_v2_column_data_collection_handle collection, const duckdb_v2_identifier_t *column_names, idx_t column_count, - duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_connection_register_multi_file_function) - (duckdb_v2_connection_handle conn, duckdb_v2_multi_file_function_handle function, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_copy_to_set_statistics_callback) - (duckdb_v2_copy_function_handle function, duckdb_v2_copy_to_statistics_callback_fn callback, - duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_copy_to_statistics_get_bind_data) - (duckdb_v2_copy_to_statistics_info_handle info, void **data, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_copy_to_statistics_get_init_data) - (duckdb_v2_copy_to_statistics_info_handle info, void **data, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_copy_to_statistics_get_user_data) - (duckdb_v2_copy_to_statistics_info_handle info, void **data, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_copy_to_statistics_set_file_size) - (duckdb_v2_copy_to_statistics_info_handle info, idx_t file_size_bytes, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_copy_to_statistics_set_row_count) - (duckdb_v2_copy_to_statistics_info_handle info, idx_t row_count, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_data_chunk_get_capacity) - (duckdb_v2_data_chunk_handle chunk, idx_t *out_capacity, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_extension_register_multi_file_function) - (duckdb_v2_extension_handle extension, duckdb_v2_multi_file_function_handle function, + DUCKDB_V2_ERROR (*duckdb_v2_query_metrics_destroy)(duckdb_v2_query_metrics_handle *metrics); + DUCKDB_V2_ERROR(*duckdb_v2_query_metrics_get_root) + (duckdb_v2_query_metrics_handle metrics, duckdb_v2_query_metrics_node_handle *node, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_multi_file_function_create) - (duckdb_v2_factory_handle factory, duckdb_v2_multi_file_function_handle *function, + DUCKDB_V2_ERROR(*duckdb_v2_query_metrics_node_get_child) + (duckdb_v2_query_metrics_node_handle node, idx_t index, duckdb_v2_query_metrics_node_handle *child, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR (*duckdb_v2_multi_file_function_destroy)(duckdb_v2_multi_file_function_handle *function); - DUCKDB_V2_ERROR(*duckdb_v2_multi_file_function_set_file_extension) - (duckdb_v2_multi_file_function_handle function, duckdb_v2_str *extension, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_multi_file_function_set_name) - (duckdb_v2_multi_file_function_handle function, duckdb_v2_str *name, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_multi_file_function_set_reader_type) - (duckdb_v2_multi_file_function_handle function, duckdb_v2_str *reader_type, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_multi_file_function_set_single_file_function) - (duckdb_v2_multi_file_function_handle function, duckdb_v2_str *name, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_table_function_claim_batch_get_bind_data) - (duckdb_v2_table_function_claim_batch_info_handle info, void **data, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_table_function_claim_batch_get_global_state) - (duckdb_v2_table_function_claim_batch_info_handle info, void **data, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_table_function_claim_batch_get_local_state) - (duckdb_v2_table_function_claim_batch_info_handle info, void **data, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_table_function_claim_batch_get_user_data) - (duckdb_v2_table_function_claim_batch_info_handle info, void **data, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_table_function_claim_batch_set_claimed) - (duckdb_v2_table_function_claim_batch_info_handle info, bool claimed, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_table_function_set_claim_batch_callback) - (duckdb_v2_table_function_handle function, duckdb_v2_table_function_claim_batch_callback_fn callback, + DUCKDB_V2_ERROR(*duckdb_v2_query_metrics_node_get_child_count) + (duckdb_v2_query_metrics_node_handle node, idx_t *count, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_query_metrics_node_get_metric) + (duckdb_v2_query_metrics_node_handle node, const duckdb_v2_str *name, duckdb_v2_value_handle *value, bool *present, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_table_function_get_bind_info_get_bind_data) - (duckdb_v2_table_function_get_bind_info_info_handle info, void **data, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_table_function_get_bind_info_get_user_data) - (duckdb_v2_table_function_get_bind_info_info_handle info, void **data, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_table_function_get_bind_info_set_column_identifier) - (duckdb_v2_table_function_get_bind_info_info_handle info, idx_t column_index, const idx_t *child_path, - idx_t child_path_length, duckdb_v2_value_handle identifier, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_table_function_get_bind_info_set_option) - (duckdb_v2_table_function_get_bind_info_info_handle info, duckdb_v2_str *key, duckdb_v2_value_handle value, + DUCKDB_V2_ERROR(*duckdb_v2_query_metrics_node_get_metric_count) + (duckdb_v2_query_metrics_node_handle node, idx_t *count, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_query_metrics_node_get_metric_name) + (duckdb_v2_query_metrics_node_handle node, idx_t index, duckdb_v2_str *name, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_query_metrics_node_get_metric_value) + (duckdb_v2_query_metrics_node_handle node, idx_t index, duckdb_v2_value_handle *value, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_table_function_set_get_bind_info_callback) - (duckdb_v2_table_function_handle function, duckdb_v2_table_function_get_bind_info_callback_fn callback, + DUCKDB_V2_ERROR(*duckdb_v2_query_metrics_node_get_name) + (duckdb_v2_query_metrics_node_handle node, duckdb_v2_str *name, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_statement_add_collection) + (duckdb_v2_sql_statement_handle statement, const duckdb_v2_identifier_t *name, + duckdb_v2_column_data_collection_handle collection, const duckdb_v2_identifier_t *column_names, idx_t column_count, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_factory_create_common_type) - (duckdb_v2_factory_handle factory, const duckdb_v2_logical_type_handle *types, idx_t type_count, - duckdb_v2_logical_type_handle *out_type, duckdb_v2_error_info_handle *err); } duckdb_ext_api_v2; //===--------------------------------------------------------------------===// @@ -1917,6 +1942,29 @@ inline duckdb_ext_api_v2 CreateAPIv2(void) { result.duckdb_v2_table_function_set_partition_data_callback = duckdb_v2_table_function_set_partition_data_callback; result.duckdb_v2_table_function_set_partitioning_callback = duckdb_v2_table_function_set_partitioning_callback; result.duckdb_v2_validate_utf8 = duckdb_v2_validate_utf8; + result.duckdb_v2_connection_register_multi_file_function = duckdb_v2_connection_register_multi_file_function; + result.duckdb_v2_copy_to_set_statistics_callback = duckdb_v2_copy_to_set_statistics_callback; + result.duckdb_v2_copy_to_statistics_get_bind_data = duckdb_v2_copy_to_statistics_get_bind_data; + result.duckdb_v2_copy_to_statistics_get_init_data = duckdb_v2_copy_to_statistics_get_init_data; + result.duckdb_v2_copy_to_statistics_get_user_data = duckdb_v2_copy_to_statistics_get_user_data; + result.duckdb_v2_copy_to_statistics_set_file_size = duckdb_v2_copy_to_statistics_set_file_size; + result.duckdb_v2_copy_to_statistics_set_row_count = duckdb_v2_copy_to_statistics_set_row_count; + result.duckdb_v2_data_chunk_get_capacity = duckdb_v2_data_chunk_get_capacity; + result.duckdb_v2_extension_register_multi_file_function = duckdb_v2_extension_register_multi_file_function; + result.duckdb_v2_multi_file_function_create = duckdb_v2_multi_file_function_create; + result.duckdb_v2_multi_file_function_destroy = duckdb_v2_multi_file_function_destroy; + result.duckdb_v2_multi_file_function_set_file_extension = duckdb_v2_multi_file_function_set_file_extension; + result.duckdb_v2_multi_file_function_set_name = duckdb_v2_multi_file_function_set_name; + result.duckdb_v2_multi_file_function_set_reader_type = duckdb_v2_multi_file_function_set_reader_type; + result.duckdb_v2_multi_file_function_set_single_file_function = + duckdb_v2_multi_file_function_set_single_file_function; + result.duckdb_v2_table_function_claim_batch_get_bind_data = duckdb_v2_table_function_claim_batch_get_bind_data; + result.duckdb_v2_table_function_claim_batch_get_global_state = + duckdb_v2_table_function_claim_batch_get_global_state; + result.duckdb_v2_table_function_claim_batch_get_local_state = duckdb_v2_table_function_claim_batch_get_local_state; + result.duckdb_v2_table_function_claim_batch_get_user_data = duckdb_v2_table_function_claim_batch_get_user_data; + result.duckdb_v2_table_function_claim_batch_set_claimed = duckdb_v2_table_function_claim_batch_set_claimed; + result.duckdb_v2_table_function_set_claim_batch_callback = duckdb_v2_table_function_set_claim_batch_callback; result.duckdb_v2_function_bind_get_arg_count = duckdb_v2_function_bind_get_arg_count; result.duckdb_v2_function_bind_get_arg_index = duckdb_v2_function_bind_get_arg_index; result.duckdb_v2_function_bind_get_arg_name = duckdb_v2_function_bind_get_arg_name; @@ -1939,6 +1987,12 @@ inline duckdb_ext_api_v2 CreateAPIv2(void) { result.duckdb_v2_scalar_function_resolve_types_set_return_type = duckdb_v2_scalar_function_resolve_types_set_return_type; result.duckdb_v2_scalar_function_set_resolve_types_callback = duckdb_v2_scalar_function_set_resolve_types_callback; + result.duckdb_v2_table_function_get_bind_info_get_bind_data = duckdb_v2_table_function_get_bind_info_get_bind_data; + result.duckdb_v2_table_function_get_bind_info_get_user_data = duckdb_v2_table_function_get_bind_info_get_user_data; + result.duckdb_v2_table_function_get_bind_info_set_column_identifier = + duckdb_v2_table_function_get_bind_info_set_column_identifier; + result.duckdb_v2_table_function_get_bind_info_set_option = duckdb_v2_table_function_get_bind_info_set_option; + result.duckdb_v2_table_function_set_get_bind_info_callback = duckdb_v2_table_function_set_get_bind_info_callback; result.duckdb_v2_connection_get_factory = duckdb_v2_connection_get_factory; result.duckdb_v2_context_get_factory = duckdb_v2_context_get_factory; result.duckdb_v2_instance_get_factory = duckdb_v2_instance_get_factory; @@ -1958,6 +2012,7 @@ inline duckdb_ext_api_v2 CreateAPIv2(void) { result.duckdb_v2_aggregate_function_get_docs = duckdb_v2_aggregate_function_get_docs; result.duckdb_v2_connection_register_pragma_function = duckdb_v2_connection_register_pragma_function; result.duckdb_v2_extension_register_pragma_function = duckdb_v2_extension_register_pragma_function; + result.duckdb_v2_factory_create_common_type = duckdb_v2_factory_create_common_type; result.duckdb_v2_function_docs_add_category = duckdb_v2_function_docs_add_category; result.duckdb_v2_function_docs_add_example = duckdb_v2_function_docs_add_example; result.duckdb_v2_function_docs_set_description = duckdb_v2_function_docs_set_description; @@ -2012,42 +2067,23 @@ inline duckdb_ext_api_v2 CreateAPIv2(void) { result.duckdb_v2_macro_function_set_body = duckdb_v2_macro_function_set_body; result.duckdb_v2_macro_function_set_name = duckdb_v2_macro_function_set_name; result.duckdb_v2_vector_cast = duckdb_v2_vector_cast; + result.duckdb_v2_connection_enable_profiling = duckdb_v2_connection_enable_profiling; + result.duckdb_v2_connection_get_query_metrics = duckdb_v2_connection_get_query_metrics; result.duckdb_v2_copy_function_set_file_extension = duckdb_v2_copy_function_set_file_extension; result.duckdb_v2_data_chunk_clear = duckdb_v2_data_chunk_clear; result.duckdb_v2_file_system_path_glob = duckdb_v2_file_system_path_glob; result.duckdb_v2_file_system_path_move = duckdb_v2_file_system_path_move; result.duckdb_v2_file_system_path_remove = duckdb_v2_file_system_path_remove; + result.duckdb_v2_query_metrics_destroy = duckdb_v2_query_metrics_destroy; + result.duckdb_v2_query_metrics_get_root = duckdb_v2_query_metrics_get_root; + result.duckdb_v2_query_metrics_node_get_child = duckdb_v2_query_metrics_node_get_child; + result.duckdb_v2_query_metrics_node_get_child_count = duckdb_v2_query_metrics_node_get_child_count; + result.duckdb_v2_query_metrics_node_get_metric = duckdb_v2_query_metrics_node_get_metric; + result.duckdb_v2_query_metrics_node_get_metric_count = duckdb_v2_query_metrics_node_get_metric_count; + result.duckdb_v2_query_metrics_node_get_metric_name = duckdb_v2_query_metrics_node_get_metric_name; + result.duckdb_v2_query_metrics_node_get_metric_value = duckdb_v2_query_metrics_node_get_metric_value; + result.duckdb_v2_query_metrics_node_get_name = duckdb_v2_query_metrics_node_get_name; result.duckdb_v2_statement_add_collection = duckdb_v2_statement_add_collection; - result.duckdb_v2_connection_register_multi_file_function = duckdb_v2_connection_register_multi_file_function; - result.duckdb_v2_copy_to_set_statistics_callback = duckdb_v2_copy_to_set_statistics_callback; - result.duckdb_v2_copy_to_statistics_get_bind_data = duckdb_v2_copy_to_statistics_get_bind_data; - result.duckdb_v2_copy_to_statistics_get_init_data = duckdb_v2_copy_to_statistics_get_init_data; - result.duckdb_v2_copy_to_statistics_get_user_data = duckdb_v2_copy_to_statistics_get_user_data; - result.duckdb_v2_copy_to_statistics_set_file_size = duckdb_v2_copy_to_statistics_set_file_size; - result.duckdb_v2_copy_to_statistics_set_row_count = duckdb_v2_copy_to_statistics_set_row_count; - result.duckdb_v2_data_chunk_get_capacity = duckdb_v2_data_chunk_get_capacity; - result.duckdb_v2_extension_register_multi_file_function = duckdb_v2_extension_register_multi_file_function; - result.duckdb_v2_multi_file_function_create = duckdb_v2_multi_file_function_create; - result.duckdb_v2_multi_file_function_destroy = duckdb_v2_multi_file_function_destroy; - result.duckdb_v2_multi_file_function_set_file_extension = duckdb_v2_multi_file_function_set_file_extension; - result.duckdb_v2_multi_file_function_set_name = duckdb_v2_multi_file_function_set_name; - result.duckdb_v2_multi_file_function_set_reader_type = duckdb_v2_multi_file_function_set_reader_type; - result.duckdb_v2_multi_file_function_set_single_file_function = - duckdb_v2_multi_file_function_set_single_file_function; - result.duckdb_v2_table_function_claim_batch_get_bind_data = duckdb_v2_table_function_claim_batch_get_bind_data; - result.duckdb_v2_table_function_claim_batch_get_global_state = - duckdb_v2_table_function_claim_batch_get_global_state; - result.duckdb_v2_table_function_claim_batch_get_local_state = duckdb_v2_table_function_claim_batch_get_local_state; - result.duckdb_v2_table_function_claim_batch_get_user_data = duckdb_v2_table_function_claim_batch_get_user_data; - result.duckdb_v2_table_function_claim_batch_set_claimed = duckdb_v2_table_function_claim_batch_set_claimed; - result.duckdb_v2_table_function_set_claim_batch_callback = duckdb_v2_table_function_set_claim_batch_callback; - result.duckdb_v2_table_function_get_bind_info_get_bind_data = duckdb_v2_table_function_get_bind_info_get_bind_data; - result.duckdb_v2_table_function_get_bind_info_get_user_data = duckdb_v2_table_function_get_bind_info_get_user_data; - result.duckdb_v2_table_function_get_bind_info_set_column_identifier = - duckdb_v2_table_function_get_bind_info_set_column_identifier; - result.duckdb_v2_table_function_get_bind_info_set_option = duckdb_v2_table_function_get_bind_info_set_option; - result.duckdb_v2_table_function_set_get_bind_info_callback = duckdb_v2_table_function_set_get_bind_info_callback; - result.duckdb_v2_factory_create_common_type = duckdb_v2_factory_create_common_type; return result; } diff --git a/src/duckdb/src/include/duckdb/main/http/http_util.hpp b/src/duckdb/src/include/duckdb/main/http/http_util.hpp index 40385438e..c03b20522 100644 --- a/src/duckdb/src/include/duckdb/main/http/http_util.hpp +++ b/src/duckdb/src/include/duckdb/main/http/http_util.hpp @@ -52,6 +52,9 @@ struct HTTPParams { //! When set, the caller has already checked the url against the file access settings, so the central check in //! HTTPUtil::Request is skipped (used by extension installation, which also allows the official repositories) bool skip_external_access_check = false; + //! The path the request accesses, for file systems that map their own paths onto HTTP urls (e.g. s3://bucket/key). + //! When set, the file access settings are checked against it instead of the url + string access_path; string http_proxy; idx_t http_proxy_port = 0; diff --git a/src/duckdb/src/include/duckdb/main/query_profiler.hpp b/src/duckdb/src/include/duckdb/main/query_profiler.hpp index 9446666a1..d6a335523 100644 --- a/src/duckdb/src/include/duckdb/main/query_profiler.hpp +++ b/src/duckdb/src/include/duckdb/main/query_profiler.hpp @@ -189,6 +189,11 @@ class QueryProfiler { lock_guard guard(lock); callback(root.get()); } + //! Provides access to the finalized metrics and query tree of the last profiled query, both null while a query is + //! running or when there are none, and ensures there are no concurrent modifications + DUCKDB_API void GetFinalizedProfileUnderLock( + const std::function, optional_ptr)> &callback) + const; private: ClientContext &context; diff --git a/src/duckdb/src/include/duckdb_extension_v2.h b/src/duckdb/src/include/duckdb_extension_v2.h index bc3df295e..b77dc115c 100644 --- a/src/duckdb/src/include/duckdb_extension_v2.h +++ b/src/duckdb/src/include/duckdb_extension_v2.h @@ -67,11 +67,18 @@ #error "This version of the extension API header only supports API VERSION v2.x.x" #endif +// No V2 function has been stabilized yet, so without the unstable surface the function pointer struct would be empty. +#if !DUCKDB_V2_API_ALLOW_UNSTABLE +#error \ + "the V2 C API has no stable surface yet: build with build_loadable_extension_capi_unstable or build_static_extension_capi_unstable, which tie the extension to this DuckDB version" +#endif + //===--------------------------------------------------------------------===// // Function pointer struct //===--------------------------------------------------------------------===// typedef struct { // capigen:begin appended +#if DUCKDB_V2_API_ALLOW_UNSTABLE DUCKDB_V2_ERROR(*duckdb_v2_arena_allocate) (duckdb_v2_arena_handle arena, idx_t byte_len, uint8_t **out_ptr, duckdb_v2_error_info_handle *err); DUCKDB_V2_ERROR(*duckdb_v2_bignum_decode) @@ -1170,6 +1177,51 @@ typedef struct { (duckdb_v2_table_function_handle function, duckdb_v2_table_function_partitioning_callback_fn callback, duckdb_v2_error_info_handle *err); DUCKDB_V2_ERROR (*duckdb_v2_validate_utf8)(const duckdb_v2_str *text, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_connection_register_multi_file_function) + (duckdb_v2_connection_handle conn, duckdb_v2_multi_file_function_handle function, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_copy_to_set_statistics_callback) + (duckdb_v2_copy_function_handle function, duckdb_v2_copy_to_statistics_callback_fn callback, + duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_copy_to_statistics_get_bind_data) + (duckdb_v2_copy_to_statistics_info_handle info, void **data, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_copy_to_statistics_get_init_data) + (duckdb_v2_copy_to_statistics_info_handle info, void **data, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_copy_to_statistics_get_user_data) + (duckdb_v2_copy_to_statistics_info_handle info, void **data, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_copy_to_statistics_set_file_size) + (duckdb_v2_copy_to_statistics_info_handle info, idx_t file_size_bytes, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_copy_to_statistics_set_row_count) + (duckdb_v2_copy_to_statistics_info_handle info, idx_t row_count, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_data_chunk_get_capacity) + (duckdb_v2_data_chunk_handle chunk, idx_t *out_capacity, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_extension_register_multi_file_function) + (duckdb_v2_extension_handle extension, duckdb_v2_multi_file_function_handle function, + duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_multi_file_function_create) + (duckdb_v2_factory_handle factory, duckdb_v2_multi_file_function_handle *function, + duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR (*duckdb_v2_multi_file_function_destroy)(duckdb_v2_multi_file_function_handle *function); + DUCKDB_V2_ERROR(*duckdb_v2_multi_file_function_set_file_extension) + (duckdb_v2_multi_file_function_handle function, duckdb_v2_str *extension, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_multi_file_function_set_name) + (duckdb_v2_multi_file_function_handle function, duckdb_v2_str *name, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_multi_file_function_set_reader_type) + (duckdb_v2_multi_file_function_handle function, duckdb_v2_str *reader_type, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_multi_file_function_set_single_file_function) + (duckdb_v2_multi_file_function_handle function, duckdb_v2_str *name, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_table_function_claim_batch_get_bind_data) + (duckdb_v2_table_function_claim_batch_info_handle info, void **data, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_table_function_claim_batch_get_global_state) + (duckdb_v2_table_function_claim_batch_info_handle info, void **data, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_table_function_claim_batch_get_local_state) + (duckdb_v2_table_function_claim_batch_info_handle info, void **data, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_table_function_claim_batch_get_user_data) + (duckdb_v2_table_function_claim_batch_info_handle info, void **data, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_table_function_claim_batch_set_claimed) + (duckdb_v2_table_function_claim_batch_info_handle info, bool claimed, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_table_function_set_claim_batch_callback) + (duckdb_v2_table_function_handle function, duckdb_v2_table_function_claim_batch_callback_fn callback, + duckdb_v2_error_info_handle *err); DUCKDB_V2_ERROR(*duckdb_v2_function_bind_get_arg_count) (duckdb_v2_function_bind_info_handle info, idx_t *positional_fixed, idx_t *positional_variadic, idx_t *named_fixed, idx_t *named_variadic, duckdb_v2_error_info_handle *err); @@ -1225,6 +1277,19 @@ typedef struct { DUCKDB_V2_ERROR(*duckdb_v2_scalar_function_set_resolve_types_callback) (duckdb_v2_scalar_function_handle function, duckdb_v2_scalar_function_resolve_types_callback_fn callback, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_table_function_get_bind_info_get_bind_data) + (duckdb_v2_table_function_get_bind_info_info_handle info, void **data, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_table_function_get_bind_info_get_user_data) + (duckdb_v2_table_function_get_bind_info_info_handle info, void **data, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_table_function_get_bind_info_set_column_identifier) + (duckdb_v2_table_function_get_bind_info_info_handle info, idx_t column_index, const idx_t *child_path, + idx_t child_path_length, duckdb_v2_value_handle identifier, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_table_function_get_bind_info_set_option) + (duckdb_v2_table_function_get_bind_info_info_handle info, duckdb_v2_str *key, duckdb_v2_value_handle value, + duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_table_function_set_get_bind_info_callback) + (duckdb_v2_table_function_handle function, duckdb_v2_table_function_get_bind_info_callback_fn callback, + duckdb_v2_error_info_handle *err); DUCKDB_V2_ERROR(*duckdb_v2_connection_get_factory) (duckdb_v2_connection_handle conn, duckdb_v2_factory_handle *out_factory, duckdb_v2_error_info_handle *err); DUCKDB_V2_ERROR(*duckdb_v2_context_get_factory) @@ -1270,6 +1335,9 @@ typedef struct { (duckdb_v2_connection_handle conn, duckdb_v2_pragma_function_handle function, duckdb_v2_error_info_handle *err); DUCKDB_V2_ERROR(*duckdb_v2_extension_register_pragma_function) (duckdb_v2_extension_handle extension, duckdb_v2_pragma_function_handle function, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_factory_create_common_type) + (duckdb_v2_factory_handle factory, const duckdb_v2_logical_type_handle *types, idx_t type_count, + duckdb_v2_logical_type_handle *out_type, duckdb_v2_error_info_handle *err); DUCKDB_V2_ERROR(*duckdb_v2_function_docs_add_category) (duckdb_v2_function_docs_handle docs, const duckdb_v2_str *category, duckdb_v2_error_info_handle *err); DUCKDB_V2_ERROR(*duckdb_v2_function_docs_add_example) @@ -1387,6 +1455,10 @@ typedef struct { (duckdb_v2_factory_handle factory, duckdb_v2_vector_handle source, duckdb_v2_vector_handle target, DUCKDB_V2_CAST_MODE mode, bool *out_converted, duckdb_v2_error_info_handle *cast_err, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_connection_enable_profiling) + (duckdb_v2_connection_handle conn, bool enabled, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_connection_get_query_metrics) + (duckdb_v2_connection_handle conn, duckdb_v2_query_metrics_handle *metrics, duckdb_v2_error_info_handle *err); DUCKDB_V2_ERROR(*duckdb_v2_copy_function_set_file_extension) (duckdb_v2_copy_function_handle function, const duckdb_v2_str *extension, duckdb_v2_error_info_handle *err); DUCKDB_V2_ERROR (*duckdb_v2_data_chunk_clear)(duckdb_v2_data_chunk_handle chunk, duckdb_v2_error_info_handle *err); @@ -1399,72 +1471,31 @@ typedef struct { DUCKDB_V2_ERROR(*duckdb_v2_file_system_path_remove) (duckdb_v2_file_system_handle file_system, const duckdb_v2_str *path, bool *out_removed, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_statement_add_collection) - (duckdb_v2_sql_statement_handle statement, const duckdb_v2_identifier_t *name, - duckdb_v2_column_data_collection_handle collection, const duckdb_v2_identifier_t *column_names, idx_t column_count, - duckdb_v2_error_info_handle *err); -#if DUCKDB_V2_API_ALLOW_UNSTABLE - DUCKDB_V2_ERROR(*duckdb_v2_connection_register_multi_file_function) - (duckdb_v2_connection_handle conn, duckdb_v2_multi_file_function_handle function, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_copy_to_set_statistics_callback) - (duckdb_v2_copy_function_handle function, duckdb_v2_copy_to_statistics_callback_fn callback, - duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_copy_to_statistics_get_bind_data) - (duckdb_v2_copy_to_statistics_info_handle info, void **data, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_copy_to_statistics_get_init_data) - (duckdb_v2_copy_to_statistics_info_handle info, void **data, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_copy_to_statistics_get_user_data) - (duckdb_v2_copy_to_statistics_info_handle info, void **data, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_copy_to_statistics_set_file_size) - (duckdb_v2_copy_to_statistics_info_handle info, idx_t file_size_bytes, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_copy_to_statistics_set_row_count) - (duckdb_v2_copy_to_statistics_info_handle info, idx_t row_count, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_data_chunk_get_capacity) - (duckdb_v2_data_chunk_handle chunk, idx_t *out_capacity, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_extension_register_multi_file_function) - (duckdb_v2_extension_handle extension, duckdb_v2_multi_file_function_handle function, + DUCKDB_V2_ERROR (*duckdb_v2_query_metrics_destroy)(duckdb_v2_query_metrics_handle *metrics); + DUCKDB_V2_ERROR(*duckdb_v2_query_metrics_get_root) + (duckdb_v2_query_metrics_handle metrics, duckdb_v2_query_metrics_node_handle *node, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_multi_file_function_create) - (duckdb_v2_factory_handle factory, duckdb_v2_multi_file_function_handle *function, + DUCKDB_V2_ERROR(*duckdb_v2_query_metrics_node_get_child) + (duckdb_v2_query_metrics_node_handle node, idx_t index, duckdb_v2_query_metrics_node_handle *child, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR (*duckdb_v2_multi_file_function_destroy)(duckdb_v2_multi_file_function_handle *function); - DUCKDB_V2_ERROR(*duckdb_v2_multi_file_function_set_file_extension) - (duckdb_v2_multi_file_function_handle function, duckdb_v2_str *extension, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_multi_file_function_set_name) - (duckdb_v2_multi_file_function_handle function, duckdb_v2_str *name, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_multi_file_function_set_reader_type) - (duckdb_v2_multi_file_function_handle function, duckdb_v2_str *reader_type, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_multi_file_function_set_single_file_function) - (duckdb_v2_multi_file_function_handle function, duckdb_v2_str *name, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_table_function_claim_batch_get_bind_data) - (duckdb_v2_table_function_claim_batch_info_handle info, void **data, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_table_function_claim_batch_get_global_state) - (duckdb_v2_table_function_claim_batch_info_handle info, void **data, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_table_function_claim_batch_get_local_state) - (duckdb_v2_table_function_claim_batch_info_handle info, void **data, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_table_function_claim_batch_get_user_data) - (duckdb_v2_table_function_claim_batch_info_handle info, void **data, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_table_function_claim_batch_set_claimed) - (duckdb_v2_table_function_claim_batch_info_handle info, bool claimed, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_table_function_set_claim_batch_callback) - (duckdb_v2_table_function_handle function, duckdb_v2_table_function_claim_batch_callback_fn callback, + DUCKDB_V2_ERROR(*duckdb_v2_query_metrics_node_get_child_count) + (duckdb_v2_query_metrics_node_handle node, idx_t *count, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_query_metrics_node_get_metric) + (duckdb_v2_query_metrics_node_handle node, const duckdb_v2_str *name, duckdb_v2_value_handle *value, bool *present, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_table_function_get_bind_info_get_bind_data) - (duckdb_v2_table_function_get_bind_info_info_handle info, void **data, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_table_function_get_bind_info_get_user_data) - (duckdb_v2_table_function_get_bind_info_info_handle info, void **data, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_table_function_get_bind_info_set_column_identifier) - (duckdb_v2_table_function_get_bind_info_info_handle info, idx_t column_index, const idx_t *child_path, - idx_t child_path_length, duckdb_v2_value_handle identifier, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_table_function_get_bind_info_set_option) - (duckdb_v2_table_function_get_bind_info_info_handle info, duckdb_v2_str *key, duckdb_v2_value_handle value, + DUCKDB_V2_ERROR(*duckdb_v2_query_metrics_node_get_metric_count) + (duckdb_v2_query_metrics_node_handle node, idx_t *count, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_query_metrics_node_get_metric_name) + (duckdb_v2_query_metrics_node_handle node, idx_t index, duckdb_v2_str *name, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_query_metrics_node_get_metric_value) + (duckdb_v2_query_metrics_node_handle node, idx_t index, duckdb_v2_value_handle *value, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_table_function_set_get_bind_info_callback) - (duckdb_v2_table_function_handle function, duckdb_v2_table_function_get_bind_info_callback_fn callback, + DUCKDB_V2_ERROR(*duckdb_v2_query_metrics_node_get_name) + (duckdb_v2_query_metrics_node_handle node, duckdb_v2_str *name, duckdb_v2_error_info_handle *err); + DUCKDB_V2_ERROR(*duckdb_v2_statement_add_collection) + (duckdb_v2_sql_statement_handle statement, const duckdb_v2_identifier_t *name, + duckdb_v2_column_data_collection_handle collection, const duckdb_v2_identifier_t *column_names, idx_t column_count, duckdb_v2_error_info_handle *err); - DUCKDB_V2_ERROR(*duckdb_v2_factory_create_common_type) - (duckdb_v2_factory_handle factory, const duckdb_v2_logical_type_handle *types, idx_t type_count, - duckdb_v2_logical_type_handle *out_type, duckdb_v2_error_info_handle *err); #endif // capigen:end appended } duckdb_ext_api_v2; @@ -1476,654 +1507,1515 @@ typedef struct { // The vtable (duckdb_ext_api) is not used - skip these macro redirections. #ifndef DUCKDB_BUILD_STATIC_EXTENSION // capigen:begin appended -#define duckdb_v2_arena_allocate duckdb_ext_api.duckdb_v2_arena_allocate -#define duckdb_v2_bignum_decode duckdb_ext_api.duckdb_v2_bignum_decode -#define duckdb_v2_bignum_encode duckdb_ext_api.duckdb_v2_bignum_encode +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_arena_allocate duckdb_ext_api.duckdb_v2_arena_allocate +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_bignum_decode duckdb_ext_api.duckdb_v2_bignum_decode +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_bignum_encode duckdb_ext_api.duckdb_v2_bignum_encode +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_column_data_collection_append duckdb_ext_api.duckdb_v2_column_data_collection_append +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_column_data_collection_append_state_create \ duckdb_ext_api.duckdb_v2_column_data_collection_append_state_create +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_column_data_collection_append_state_destroy \ duckdb_ext_api.duckdb_v2_column_data_collection_append_state_destroy -#define duckdb_v2_column_data_collection_combine duckdb_ext_api.duckdb_v2_column_data_collection_combine -#define duckdb_v2_column_data_collection_create duckdb_ext_api.duckdb_v2_column_data_collection_create -#define duckdb_v2_column_data_collection_destroy duckdb_ext_api.duckdb_v2_column_data_collection_destroy -#define duckdb_v2_column_data_collection_reset duckdb_ext_api.duckdb_v2_column_data_collection_reset +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_column_data_collection_combine duckdb_ext_api.duckdb_v2_column_data_collection_combine +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_column_data_collection_create duckdb_ext_api.duckdb_v2_column_data_collection_create +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_column_data_collection_destroy duckdb_ext_api.duckdb_v2_column_data_collection_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_column_data_collection_reset duckdb_ext_api.duckdb_v2_column_data_collection_reset +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_column_data_collection_row_count duckdb_ext_api.duckdb_v2_column_data_collection_row_count -#define duckdb_v2_column_data_collection_scan duckdb_ext_api.duckdb_v2_column_data_collection_scan +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_column_data_collection_scan duckdb_ext_api.duckdb_v2_column_data_collection_scan +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_column_data_collection_shared_scan_state_create \ duckdb_ext_api.duckdb_v2_column_data_collection_shared_scan_state_create +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_column_data_collection_shared_scan_state_destroy \ duckdb_ext_api.duckdb_v2_column_data_collection_shared_scan_state_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_column_data_collection_worker_scan_state_create \ duckdb_ext_api.duckdb_v2_column_data_collection_worker_scan_state_create +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_column_data_collection_worker_scan_state_destroy \ duckdb_ext_api.duckdb_v2_column_data_collection_worker_scan_state_destroy -#define duckdb_v2_config_get_option_by_index duckdb_ext_api.duckdb_v2_config_get_option_by_index -#define duckdb_v2_config_get_option_by_name duckdb_ext_api.duckdb_v2_config_get_option_by_name -#define duckdb_v2_config_get_option_count duckdb_ext_api.duckdb_v2_config_get_option_count -#define duckdb_v2_connection_create duckdb_ext_api.duckdb_v2_connection_create -#define duckdb_v2_connection_destroy duckdb_ext_api.duckdb_v2_connection_destroy -#define duckdb_v2_connection_interrupt duckdb_ext_api.duckdb_v2_connection_interrupt -#define duckdb_v2_connection_progress_get duckdb_ext_api.duckdb_v2_connection_progress_get -#define duckdb_v2_data_chunk_copy duckdb_ext_api.duckdb_v2_data_chunk_copy -#define duckdb_v2_data_chunk_create duckdb_ext_api.duckdb_v2_data_chunk_create -#define duckdb_v2_data_chunk_destroy duckdb_ext_api.duckdb_v2_data_chunk_destroy -#define duckdb_v2_data_chunk_get_size duckdb_ext_api.duckdb_v2_data_chunk_get_size -#define duckdb_v2_data_chunk_get_vector duckdb_ext_api.duckdb_v2_data_chunk_get_vector -#define duckdb_v2_data_chunk_get_vector_count duckdb_ext_api.duckdb_v2_data_chunk_get_vector_count -#define duckdb_v2_environment_create duckdb_ext_api.duckdb_v2_environment_create -#define duckdb_v2_environment_destroy duckdb_ext_api.duckdb_v2_environment_destroy -#define duckdb_v2_environment_get_instance_count duckdb_ext_api.duckdb_v2_environment_get_instance_count -#define duckdb_v2_error_info_destroy duckdb_ext_api.duckdb_v2_error_info_destroy -#define duckdb_v2_error_info_get_code duckdb_ext_api.duckdb_v2_error_info_get_code -#define duckdb_v2_error_info_get_raw_text duckdb_ext_api.duckdb_v2_error_info_get_raw_text -#define duckdb_v2_error_info_get_text duckdb_ext_api.duckdb_v2_error_info_get_text -#define duckdb_v2_error_info_set_code duckdb_ext_api.duckdb_v2_error_info_set_code -#define duckdb_v2_error_info_set_text duckdb_ext_api.duckdb_v2_error_info_set_text -#define duckdb_v2_factory_create_type_from_id duckdb_ext_api.duckdb_v2_factory_create_type_from_id -#define duckdb_v2_factory_create_type_from_name duckdb_ext_api.duckdb_v2_factory_create_type_from_name -#define duckdb_v2_factory_create_type_from_text duckdb_ext_api.duckdb_v2_factory_create_type_from_text -#define duckdb_v2_factory_create_type_with_alias duckdb_ext_api.duckdb_v2_factory_create_type_with_alias -#define duckdb_v2_instance_attach duckdb_ext_api.duckdb_v2_instance_attach -#define duckdb_v2_instance_create duckdb_ext_api.duckdb_v2_instance_create -#define duckdb_v2_instance_create_with_options duckdb_ext_api.duckdb_v2_instance_create_with_options -#define duckdb_v2_instance_destroy duckdb_ext_api.duckdb_v2_instance_destroy -#define duckdb_v2_instance_detach duckdb_ext_api.duckdb_v2_instance_detach -#define duckdb_v2_library_version duckdb_ext_api.duckdb_v2_library_version -#define duckdb_v2_logical_type_copy duckdb_ext_api.duckdb_v2_logical_type_copy -#define duckdb_v2_logical_type_destroy duckdb_ext_api.duckdb_v2_logical_type_destroy -#define duckdb_v2_logical_type_get_id duckdb_ext_api.duckdb_v2_logical_type_get_id -#define duckdb_v2_logical_type_get_name duckdb_ext_api.duckdb_v2_logical_type_get_name -#define duckdb_v2_logical_type_get_param duckdb_ext_api.duckdb_v2_logical_type_get_param -#define duckdb_v2_logical_type_get_param_count duckdb_ext_api.duckdb_v2_logical_type_get_param_count -#define duckdb_v2_logical_type_is_equal duckdb_ext_api.duckdb_v2_logical_type_is_equal -#define duckdb_v2_logical_type_to_text duckdb_ext_api.duckdb_v2_logical_type_to_text -#define duckdb_v2_option_destroy duckdb_ext_api.duckdb_v2_option_destroy -#define duckdb_v2_option_get_alias duckdb_ext_api.duckdb_v2_option_get_alias -#define duckdb_v2_option_get_alias_count duckdb_ext_api.duckdb_v2_option_get_alias_count -#define duckdb_v2_option_get_default_value duckdb_ext_api.duckdb_v2_option_get_default_value -#define duckdb_v2_option_get_description duckdb_ext_api.duckdb_v2_option_get_description -#define duckdb_v2_option_get_name duckdb_ext_api.duckdb_v2_option_get_name -#define duckdb_v2_parse_sql duckdb_ext_api.duckdb_v2_parse_sql -#define duckdb_v2_result_destroy duckdb_ext_api.duckdb_v2_result_destroy -#define duckdb_v2_result_drain duckdb_ext_api.duckdb_v2_result_drain -#define duckdb_v2_result_fetch_chunk duckdb_ext_api.duckdb_v2_result_fetch_chunk -#define duckdb_v2_result_get_result_type duckdb_ext_api.duckdb_v2_result_get_result_type -#define duckdb_v2_result_get_schema duckdb_ext_api.duckdb_v2_result_get_schema -#define duckdb_v2_result_get_statement_type duckdb_ext_api.duckdb_v2_result_get_statement_type -#define duckdb_v2_result_render_box duckdb_ext_api.duckdb_v2_result_render_box -#define duckdb_v2_result_step duckdb_ext_api.duckdb_v2_result_step -#define duckdb_v2_result_wait duckdb_ext_api.duckdb_v2_result_wait -#define duckdb_v2_schema_destroy duckdb_ext_api.duckdb_v2_schema_destroy -#define duckdb_v2_schema_get_count duckdb_ext_api.duckdb_v2_schema_get_count -#define duckdb_v2_schema_get_field duckdb_ext_api.duckdb_v2_schema_get_field -#define duckdb_v2_sql_statement_destroy duckdb_ext_api.duckdb_v2_sql_statement_destroy -#define duckdb_v2_statement_bind duckdb_ext_api.duckdb_v2_statement_bind -#define duckdb_v2_statement_execute duckdb_ext_api.duckdb_v2_statement_execute -#define duckdb_v2_statement_iterator_destroy duckdb_ext_api.duckdb_v2_statement_iterator_destroy -#define duckdb_v2_statement_iterator_next duckdb_ext_api.duckdb_v2_statement_iterator_next -#define duckdb_v2_value_cast duckdb_ext_api.duckdb_v2_value_cast -#define duckdb_v2_value_create_array duckdb_ext_api.duckdb_v2_value_create_array -#define duckdb_v2_value_create_bigint duckdb_ext_api.duckdb_v2_value_create_bigint -#define duckdb_v2_value_create_bignum duckdb_ext_api.duckdb_v2_value_create_bignum -#define duckdb_v2_value_create_bit duckdb_ext_api.duckdb_v2_value_create_bit -#define duckdb_v2_value_create_blob duckdb_ext_api.duckdb_v2_value_create_blob -#define duckdb_v2_value_create_bool duckdb_ext_api.duckdb_v2_value_create_bool -#define duckdb_v2_value_create_date duckdb_ext_api.duckdb_v2_value_create_date -#define duckdb_v2_value_create_decimal duckdb_ext_api.duckdb_v2_value_create_decimal -#define duckdb_v2_value_create_double duckdb_ext_api.duckdb_v2_value_create_double -#define duckdb_v2_value_create_float duckdb_ext_api.duckdb_v2_value_create_float -#define duckdb_v2_value_create_hugeint duckdb_ext_api.duckdb_v2_value_create_hugeint -#define duckdb_v2_value_create_int duckdb_ext_api.duckdb_v2_value_create_int -#define duckdb_v2_value_create_interval duckdb_ext_api.duckdb_v2_value_create_interval -#define duckdb_v2_value_create_list duckdb_ext_api.duckdb_v2_value_create_list -#define duckdb_v2_value_create_map duckdb_ext_api.duckdb_v2_value_create_map -#define duckdb_v2_value_create_null duckdb_ext_api.duckdb_v2_value_create_null -#define duckdb_v2_value_create_smallint duckdb_ext_api.duckdb_v2_value_create_smallint -#define duckdb_v2_value_create_struct duckdb_ext_api.duckdb_v2_value_create_struct -#define duckdb_v2_value_create_time duckdb_ext_api.duckdb_v2_value_create_time -#define duckdb_v2_value_create_time_ns duckdb_ext_api.duckdb_v2_value_create_time_ns -#define duckdb_v2_value_create_time_tz duckdb_ext_api.duckdb_v2_value_create_time_tz -#define duckdb_v2_value_create_timestamp duckdb_ext_api.duckdb_v2_value_create_timestamp -#define duckdb_v2_value_create_timestamp_ms duckdb_ext_api.duckdb_v2_value_create_timestamp_ms -#define duckdb_v2_value_create_timestamp_ns duckdb_ext_api.duckdb_v2_value_create_timestamp_ns -#define duckdb_v2_value_create_timestamp_sec duckdb_ext_api.duckdb_v2_value_create_timestamp_sec -#define duckdb_v2_value_create_timestamp_tz duckdb_ext_api.duckdb_v2_value_create_timestamp_tz -#define duckdb_v2_value_create_timestamp_tz_ns duckdb_ext_api.duckdb_v2_value_create_timestamp_tz_ns -#define duckdb_v2_value_create_tinyint duckdb_ext_api.duckdb_v2_value_create_tinyint -#define duckdb_v2_value_create_tuple duckdb_ext_api.duckdb_v2_value_create_tuple -#define duckdb_v2_value_create_type duckdb_ext_api.duckdb_v2_value_create_type -#define duckdb_v2_value_create_ubigint duckdb_ext_api.duckdb_v2_value_create_ubigint -#define duckdb_v2_value_create_uhugeint duckdb_ext_api.duckdb_v2_value_create_uhugeint -#define duckdb_v2_value_create_uint duckdb_ext_api.duckdb_v2_value_create_uint -#define duckdb_v2_value_create_usmallint duckdb_ext_api.duckdb_v2_value_create_usmallint -#define duckdb_v2_value_create_utinyint duckdb_ext_api.duckdb_v2_value_create_utinyint -#define duckdb_v2_value_create_uuid duckdb_ext_api.duckdb_v2_value_create_uuid -#define duckdb_v2_value_create_varchar duckdb_ext_api.duckdb_v2_value_create_varchar -#define duckdb_v2_value_destroy duckdb_ext_api.duckdb_v2_value_destroy -#define duckdb_v2_value_get_bigint duckdb_ext_api.duckdb_v2_value_get_bigint -#define duckdb_v2_value_get_blob duckdb_ext_api.duckdb_v2_value_get_blob -#define duckdb_v2_value_get_bool duckdb_ext_api.duckdb_v2_value_get_bool -#define duckdb_v2_value_get_child duckdb_ext_api.duckdb_v2_value_get_child -#define duckdb_v2_value_get_child_count duckdb_ext_api.duckdb_v2_value_get_child_count -#define duckdb_v2_value_get_date duckdb_ext_api.duckdb_v2_value_get_date -#define duckdb_v2_value_get_decimal duckdb_ext_api.duckdb_v2_value_get_decimal -#define duckdb_v2_value_get_double duckdb_ext_api.duckdb_v2_value_get_double -#define duckdb_v2_value_get_float duckdb_ext_api.duckdb_v2_value_get_float -#define duckdb_v2_value_get_hugeint duckdb_ext_api.duckdb_v2_value_get_hugeint -#define duckdb_v2_value_get_int duckdb_ext_api.duckdb_v2_value_get_int -#define duckdb_v2_value_get_interval duckdb_ext_api.duckdb_v2_value_get_interval -#define duckdb_v2_value_get_logical_type duckdb_ext_api.duckdb_v2_value_get_logical_type -#define duckdb_v2_value_get_smallint duckdb_ext_api.duckdb_v2_value_get_smallint -#define duckdb_v2_value_get_time duckdb_ext_api.duckdb_v2_value_get_time -#define duckdb_v2_value_get_time_ns duckdb_ext_api.duckdb_v2_value_get_time_ns -#define duckdb_v2_value_get_time_tz duckdb_ext_api.duckdb_v2_value_get_time_tz -#define duckdb_v2_value_get_timestamp duckdb_ext_api.duckdb_v2_value_get_timestamp -#define duckdb_v2_value_get_timestamp_ms duckdb_ext_api.duckdb_v2_value_get_timestamp_ms -#define duckdb_v2_value_get_timestamp_ns duckdb_ext_api.duckdb_v2_value_get_timestamp_ns -#define duckdb_v2_value_get_timestamp_sec duckdb_ext_api.duckdb_v2_value_get_timestamp_sec -#define duckdb_v2_value_get_timestamp_tz duckdb_ext_api.duckdb_v2_value_get_timestamp_tz -#define duckdb_v2_value_get_timestamp_tz_ns duckdb_ext_api.duckdb_v2_value_get_timestamp_tz_ns -#define duckdb_v2_value_get_tinyint duckdb_ext_api.duckdb_v2_value_get_tinyint -#define duckdb_v2_value_get_type duckdb_ext_api.duckdb_v2_value_get_type -#define duckdb_v2_value_get_ubigint duckdb_ext_api.duckdb_v2_value_get_ubigint -#define duckdb_v2_value_get_uhugeint duckdb_ext_api.duckdb_v2_value_get_uhugeint -#define duckdb_v2_value_get_uint duckdb_ext_api.duckdb_v2_value_get_uint -#define duckdb_v2_value_get_usmallint duckdb_ext_api.duckdb_v2_value_get_usmallint -#define duckdb_v2_value_get_utinyint duckdb_ext_api.duckdb_v2_value_get_utinyint -#define duckdb_v2_value_get_uuid duckdb_ext_api.duckdb_v2_value_get_uuid -#define duckdb_v2_value_get_varchar duckdb_ext_api.duckdb_v2_value_get_varchar -#define duckdb_v2_value_is_null duckdb_ext_api.duckdb_v2_value_is_null -#define duckdb_v2_value_to_string duckdb_ext_api.duckdb_v2_value_to_string -#define duckdb_v2_vector_constant_set_valid duckdb_ext_api.duckdb_v2_vector_constant_set_valid -#define duckdb_v2_vector_flat_get_validity_mutable duckdb_ext_api.duckdb_v2_vector_flat_get_validity_mutable -#define duckdb_v2_vector_flatten duckdb_ext_api.duckdb_v2_vector_flatten -#define duckdb_v2_vector_get_arena duckdb_ext_api.duckdb_v2_vector_get_arena -#define duckdb_v2_vector_get_child duckdb_ext_api.duckdb_v2_vector_get_child -#define duckdb_v2_vector_get_child_count duckdb_ext_api.duckdb_v2_vector_get_child_count -#define duckdb_v2_vector_get_data_mutable duckdb_ext_api.duckdb_v2_vector_get_data_mutable -#define duckdb_v2_vector_get_logical_type duckdb_ext_api.duckdb_v2_vector_get_logical_type -#define duckdb_v2_vector_get_size duckdb_ext_api.duckdb_v2_vector_get_size -#define duckdb_v2_vector_get_value duckdb_ext_api.duckdb_v2_vector_get_value -#define duckdb_v2_vector_get_vector_type duckdb_ext_api.duckdb_v2_vector_get_vector_type -#define duckdb_v2_vector_get_view duckdb_ext_api.duckdb_v2_vector_get_view -#define duckdb_v2_vector_make_constant duckdb_ext_api.duckdb_v2_vector_make_constant -#define duckdb_v2_vector_make_sequence duckdb_ext_api.duckdb_v2_vector_make_sequence -#define duckdb_v2_vector_reference duckdb_ext_api.duckdb_v2_vector_reference -#define duckdb_v2_vector_set_null duckdb_ext_api.duckdb_v2_vector_set_null -#define duckdb_v2_vector_set_size duckdb_ext_api.duckdb_v2_vector_set_size -#define duckdb_v2_vector_set_value duckdb_ext_api.duckdb_v2_vector_set_value -#define duckdb_v2_connection_register_scalar_function duckdb_ext_api.duckdb_v2_connection_register_scalar_function -#define duckdb_v2_context_log duckdb_ext_api.duckdb_v2_context_log -#define duckdb_v2_extension_register_scalar_function duckdb_ext_api.duckdb_v2_extension_register_scalar_function -#define duckdb_v2_function_signature_add_parameter duckdb_ext_api.duckdb_v2_function_signature_add_parameter -#define duckdb_v2_function_signature_set_return_type duckdb_ext_api.duckdb_v2_function_signature_set_return_type -#define duckdb_v2_scalar_function_create duckdb_ext_api.duckdb_v2_scalar_function_create -#define duckdb_v2_scalar_function_destroy duckdb_ext_api.duckdb_v2_scalar_function_destroy -#define duckdb_v2_scalar_function_exec_get_arg duckdb_ext_api.duckdb_v2_scalar_function_exec_get_arg -#define duckdb_v2_scalar_function_exec_get_arg_count duckdb_ext_api.duckdb_v2_scalar_function_exec_get_arg_count -#define duckdb_v2_scalar_function_exec_get_bind_data duckdb_ext_api.duckdb_v2_scalar_function_exec_get_bind_data -#define duckdb_v2_scalar_function_exec_get_init_data duckdb_ext_api.duckdb_v2_scalar_function_exec_get_init_data -#define duckdb_v2_scalar_function_exec_get_result duckdb_ext_api.duckdb_v2_scalar_function_exec_get_result -#define duckdb_v2_scalar_function_exec_get_row_count duckdb_ext_api.duckdb_v2_scalar_function_exec_get_row_count -#define duckdb_v2_scalar_function_exec_get_user_data duckdb_ext_api.duckdb_v2_scalar_function_exec_get_user_data -#define duckdb_v2_scalar_function_get_signature duckdb_ext_api.duckdb_v2_scalar_function_get_signature -#define duckdb_v2_scalar_function_init_get_bind_data duckdb_ext_api.duckdb_v2_scalar_function_init_get_bind_data -#define duckdb_v2_scalar_function_init_get_user_data duckdb_ext_api.duckdb_v2_scalar_function_init_get_user_data -#define duckdb_v2_scalar_function_init_set_init_data duckdb_ext_api.duckdb_v2_scalar_function_init_set_init_data -#define duckdb_v2_scalar_function_set_bind_callback duckdb_ext_api.duckdb_v2_scalar_function_set_bind_callback -#define duckdb_v2_scalar_function_set_exec_callback duckdb_ext_api.duckdb_v2_scalar_function_set_exec_callback -#define duckdb_v2_scalar_function_set_init_callback duckdb_ext_api.duckdb_v2_scalar_function_set_init_callback -#define duckdb_v2_scalar_function_set_name duckdb_ext_api.duckdb_v2_scalar_function_set_name -#define duckdb_v2_scalar_function_set_user_data duckdb_ext_api.duckdb_v2_scalar_function_set_user_data -#define duckdb_v2_aggregate_function_bind_set_return_type \ - duckdb_ext_api.duckdb_v2_aggregate_function_bind_set_return_type -#define duckdb_v2_aggregate_function_combine_get_bind_data \ - duckdb_ext_api.duckdb_v2_aggregate_function_combine_get_bind_data -#define duckdb_v2_aggregate_function_combine_get_sources duckdb_ext_api.duckdb_v2_aggregate_function_combine_get_sources -#define duckdb_v2_aggregate_function_combine_get_state_count \ - duckdb_ext_api.duckdb_v2_aggregate_function_combine_get_state_count -#define duckdb_v2_aggregate_function_combine_get_targets duckdb_ext_api.duckdb_v2_aggregate_function_combine_get_targets -#define duckdb_v2_aggregate_function_combine_get_user_data \ - duckdb_ext_api.duckdb_v2_aggregate_function_combine_get_user_data -#define duckdb_v2_aggregate_function_create duckdb_ext_api.duckdb_v2_aggregate_function_create -#define duckdb_v2_aggregate_function_destroy duckdb_ext_api.duckdb_v2_aggregate_function_destroy -#define duckdb_v2_aggregate_function_destroy_get_bind_data \ - duckdb_ext_api.duckdb_v2_aggregate_function_destroy_get_bind_data -#define duckdb_v2_aggregate_function_destroy_get_state_count \ - duckdb_ext_api.duckdb_v2_aggregate_function_destroy_get_state_count -#define duckdb_v2_aggregate_function_destroy_get_states duckdb_ext_api.duckdb_v2_aggregate_function_destroy_get_states -#define duckdb_v2_aggregate_function_destroy_get_user_data \ - duckdb_ext_api.duckdb_v2_aggregate_function_destroy_get_user_data -#define duckdb_v2_aggregate_function_finalize_get_bind_data \ - duckdb_ext_api.duckdb_v2_aggregate_function_finalize_get_bind_data -#define duckdb_v2_aggregate_function_finalize_get_result duckdb_ext_api.duckdb_v2_aggregate_function_finalize_get_result -#define duckdb_v2_aggregate_function_finalize_get_result_offset \ - duckdb_ext_api.duckdb_v2_aggregate_function_finalize_get_result_offset -#define duckdb_v2_aggregate_function_finalize_get_state_count \ - duckdb_ext_api.duckdb_v2_aggregate_function_finalize_get_state_count -#define duckdb_v2_aggregate_function_finalize_get_states duckdb_ext_api.duckdb_v2_aggregate_function_finalize_get_states -#define duckdb_v2_aggregate_function_finalize_get_user_data \ - duckdb_ext_api.duckdb_v2_aggregate_function_finalize_get_user_data -#define duckdb_v2_aggregate_function_get_signature duckdb_ext_api.duckdb_v2_aggregate_function_get_signature -#define duckdb_v2_aggregate_function_init_get_bind_data duckdb_ext_api.duckdb_v2_aggregate_function_init_get_bind_data -#define duckdb_v2_aggregate_function_init_get_state_count \ - duckdb_ext_api.duckdb_v2_aggregate_function_init_get_state_count -#define duckdb_v2_aggregate_function_init_get_states duckdb_ext_api.duckdb_v2_aggregate_function_init_get_states -#define duckdb_v2_aggregate_function_init_get_user_data duckdb_ext_api.duckdb_v2_aggregate_function_init_get_user_data -#define duckdb_v2_aggregate_function_set_bind_callback duckdb_ext_api.duckdb_v2_aggregate_function_set_bind_callback -#define duckdb_v2_aggregate_function_set_combine_callback \ - duckdb_ext_api.duckdb_v2_aggregate_function_set_combine_callback -#define duckdb_v2_aggregate_function_set_destroy_callback \ - duckdb_ext_api.duckdb_v2_aggregate_function_set_destroy_callback -#define duckdb_v2_aggregate_function_set_finalize_callback \ - duckdb_ext_api.duckdb_v2_aggregate_function_set_finalize_callback -#define duckdb_v2_aggregate_function_set_init_callback duckdb_ext_api.duckdb_v2_aggregate_function_set_init_callback -#define duckdb_v2_aggregate_function_set_name duckdb_ext_api.duckdb_v2_aggregate_function_set_name -#define duckdb_v2_aggregate_function_set_size_callback duckdb_ext_api.duckdb_v2_aggregate_function_set_size_callback -#define duckdb_v2_aggregate_function_set_update_callback duckdb_ext_api.duckdb_v2_aggregate_function_set_update_callback -#define duckdb_v2_aggregate_function_set_user_data duckdb_ext_api.duckdb_v2_aggregate_function_set_user_data -#define duckdb_v2_aggregate_function_size_get_bind_data duckdb_ext_api.duckdb_v2_aggregate_function_size_get_bind_data -#define duckdb_v2_aggregate_function_size_get_user_data duckdb_ext_api.duckdb_v2_aggregate_function_size_get_user_data -#define duckdb_v2_aggregate_function_size_set_state_size duckdb_ext_api.duckdb_v2_aggregate_function_size_set_state_size -#define duckdb_v2_aggregate_function_update_get_arg duckdb_ext_api.duckdb_v2_aggregate_function_update_get_arg -#define duckdb_v2_aggregate_function_update_get_arg_count \ - duckdb_ext_api.duckdb_v2_aggregate_function_update_get_arg_count -#define duckdb_v2_aggregate_function_update_get_bind_data \ - duckdb_ext_api.duckdb_v2_aggregate_function_update_get_bind_data -#define duckdb_v2_aggregate_function_update_get_row_count \ - duckdb_ext_api.duckdb_v2_aggregate_function_update_get_row_count -#define duckdb_v2_aggregate_function_update_get_states duckdb_ext_api.duckdb_v2_aggregate_function_update_get_states -#define duckdb_v2_aggregate_function_update_get_user_data \ - duckdb_ext_api.duckdb_v2_aggregate_function_update_get_user_data -#define duckdb_v2_connection_register_aggregate_function duckdb_ext_api.duckdb_v2_connection_register_aggregate_function -#define duckdb_v2_extension_register_aggregate_function duckdb_ext_api.duckdb_v2_extension_register_aggregate_function -#define duckdb_v2_aggregate_function_set_property duckdb_ext_api.duckdb_v2_aggregate_function_set_property -#define duckdb_v2_scalar_function_set_property duckdb_ext_api.duckdb_v2_scalar_function_set_property -#define duckdb_v2_connection_register_table_function duckdb_ext_api.duckdb_v2_connection_register_table_function -#define duckdb_v2_extension_register_table_function duckdb_ext_api.duckdb_v2_extension_register_table_function -#define duckdb_v2_table_function_bind_add_result_column duckdb_ext_api.duckdb_v2_table_function_bind_add_result_column -#define duckdb_v2_table_function_bind_set_cardinality duckdb_ext_api.duckdb_v2_table_function_bind_set_cardinality -#define duckdb_v2_table_function_create duckdb_ext_api.duckdb_v2_table_function_create -#define duckdb_v2_table_function_destroy duckdb_ext_api.duckdb_v2_table_function_destroy -#define duckdb_v2_table_function_exec_get_bind_data duckdb_ext_api.duckdb_v2_table_function_exec_get_bind_data -#define duckdb_v2_table_function_exec_get_global_state duckdb_ext_api.duckdb_v2_table_function_exec_get_global_state -#define duckdb_v2_table_function_exec_get_local_state duckdb_ext_api.duckdb_v2_table_function_exec_get_local_state -#define duckdb_v2_table_function_exec_get_output_chunk duckdb_ext_api.duckdb_v2_table_function_exec_get_output_chunk -#define duckdb_v2_table_function_exec_get_user_data duckdb_ext_api.duckdb_v2_table_function_exec_get_user_data -#define duckdb_v2_table_function_get_signature duckdb_ext_api.duckdb_v2_table_function_get_signature -#define duckdb_v2_table_function_init_global_get_bind_data \ - duckdb_ext_api.duckdb_v2_table_function_init_global_get_bind_data -#define duckdb_v2_table_function_init_global_get_user_data \ - duckdb_ext_api.duckdb_v2_table_function_init_global_get_user_data -#define duckdb_v2_table_function_init_global_set_global_state \ - duckdb_ext_api.duckdb_v2_table_function_init_global_set_global_state -#define duckdb_v2_table_function_init_global_set_max_threads \ - duckdb_ext_api.duckdb_v2_table_function_init_global_set_max_threads -#define duckdb_v2_table_function_init_local_get_bind_data \ - duckdb_ext_api.duckdb_v2_table_function_init_local_get_bind_data -#define duckdb_v2_table_function_init_local_get_global_state \ - duckdb_ext_api.duckdb_v2_table_function_init_local_get_global_state -#define duckdb_v2_table_function_init_local_get_user_data \ - duckdb_ext_api.duckdb_v2_table_function_init_local_get_user_data -#define duckdb_v2_table_function_init_local_set_local_state \ - duckdb_ext_api.duckdb_v2_table_function_init_local_set_local_state -#define duckdb_v2_table_function_progress_get_bind_data duckdb_ext_api.duckdb_v2_table_function_progress_get_bind_data -#define duckdb_v2_table_function_progress_get_global_state \ - duckdb_ext_api.duckdb_v2_table_function_progress_get_global_state -#define duckdb_v2_table_function_progress_get_user_data duckdb_ext_api.duckdb_v2_table_function_progress_get_user_data -#define duckdb_v2_table_function_progress_set_progress duckdb_ext_api.duckdb_v2_table_function_progress_set_progress -#define duckdb_v2_table_function_set_bind_callback duckdb_ext_api.duckdb_v2_table_function_set_bind_callback -#define duckdb_v2_table_function_set_exec_callback duckdb_ext_api.duckdb_v2_table_function_set_exec_callback -#define duckdb_v2_table_function_set_init_global_callback \ - duckdb_ext_api.duckdb_v2_table_function_set_init_global_callback -#define duckdb_v2_table_function_set_init_local_callback duckdb_ext_api.duckdb_v2_table_function_set_init_local_callback -#define duckdb_v2_table_function_set_name duckdb_ext_api.duckdb_v2_table_function_set_name -#define duckdb_v2_table_function_set_progress_callback duckdb_ext_api.duckdb_v2_table_function_set_progress_callback -#define duckdb_v2_table_function_set_user_data duckdb_ext_api.duckdb_v2_table_function_set_user_data -#define duckdb_v2_cast_function_create duckdb_ext_api.duckdb_v2_cast_function_create -#define duckdb_v2_cast_function_destroy duckdb_ext_api.duckdb_v2_cast_function_destroy -#define duckdb_v2_cast_function_exec_get_input duckdb_ext_api.duckdb_v2_cast_function_exec_get_input -#define duckdb_v2_cast_function_exec_get_mode duckdb_ext_api.duckdb_v2_cast_function_exec_get_mode -#define duckdb_v2_cast_function_exec_get_output duckdb_ext_api.duckdb_v2_cast_function_exec_get_output -#define duckdb_v2_cast_function_exec_get_row_count duckdb_ext_api.duckdb_v2_cast_function_exec_get_row_count -#define duckdb_v2_cast_function_exec_get_user_data duckdb_ext_api.duckdb_v2_cast_function_exec_get_user_data -#define duckdb_v2_cast_function_set_exec_callback duckdb_ext_api.duckdb_v2_cast_function_set_exec_callback -#define duckdb_v2_cast_function_set_implicit_cast_cost duckdb_ext_api.duckdb_v2_cast_function_set_implicit_cast_cost -#define duckdb_v2_cast_function_set_source_type duckdb_ext_api.duckdb_v2_cast_function_set_source_type -#define duckdb_v2_cast_function_set_target_type duckdb_ext_api.duckdb_v2_cast_function_set_target_type -#define duckdb_v2_cast_function_set_user_data duckdb_ext_api.duckdb_v2_cast_function_set_user_data -#define duckdb_v2_column_data_collection_clear duckdb_ext_api.duckdb_v2_column_data_collection_clear -#define duckdb_v2_connection_register_cast_function duckdb_ext_api.duckdb_v2_connection_register_cast_function -#define duckdb_v2_connection_register_custom_type duckdb_ext_api.duckdb_v2_connection_register_custom_type -#define duckdb_v2_connection_register_replacement_scan duckdb_ext_api.duckdb_v2_connection_register_replacement_scan -#define duckdb_v2_context_get_file_system duckdb_ext_api.duckdb_v2_context_get_file_system -#define duckdb_v2_custom_type_create duckdb_ext_api.duckdb_v2_custom_type_create -#define duckdb_v2_custom_type_destroy duckdb_ext_api.duckdb_v2_custom_type_destroy -#define duckdb_v2_custom_type_set_base_type duckdb_ext_api.duckdb_v2_custom_type_set_base_type -#define duckdb_v2_custom_type_set_name duckdb_ext_api.duckdb_v2_custom_type_set_name -#define duckdb_v2_extension_register_cast_function duckdb_ext_api.duckdb_v2_extension_register_cast_function -#define duckdb_v2_extension_register_custom_type duckdb_ext_api.duckdb_v2_extension_register_custom_type -#define duckdb_v2_extension_register_replacement_scan duckdb_ext_api.duckdb_v2_extension_register_replacement_scan -#define duckdb_v2_file_close duckdb_ext_api.duckdb_v2_file_close -#define duckdb_v2_file_destroy duckdb_ext_api.duckdb_v2_file_destroy -#define duckdb_v2_file_open_options_create duckdb_ext_api.duckdb_v2_file_open_options_create -#define duckdb_v2_file_open_options_destroy duckdb_ext_api.duckdb_v2_file_open_options_destroy -#define duckdb_v2_file_open_options_set_flag duckdb_ext_api.duckdb_v2_file_open_options_set_flag -#define duckdb_v2_file_open_options_set_value duckdb_ext_api.duckdb_v2_file_open_options_set_value -#define duckdb_v2_file_read duckdb_ext_api.duckdb_v2_file_read -#define duckdb_v2_file_read_at duckdb_ext_api.duckdb_v2_file_read_at -#define duckdb_v2_file_seek duckdb_ext_api.duckdb_v2_file_seek -#define duckdb_v2_file_size duckdb_ext_api.duckdb_v2_file_size -#define duckdb_v2_file_sync duckdb_ext_api.duckdb_v2_file_sync -#define duckdb_v2_file_system_open duckdb_ext_api.duckdb_v2_file_system_open -#define duckdb_v2_file_tell duckdb_ext_api.duckdb_v2_file_tell -#define duckdb_v2_file_write duckdb_ext_api.duckdb_v2_file_write -#define duckdb_v2_file_write_at duckdb_ext_api.duckdb_v2_file_write_at -#define duckdb_v2_instance_register_replacement_scan duckdb_ext_api.duckdb_v2_instance_register_replacement_scan -#define duckdb_v2_qname_create duckdb_ext_api.duckdb_v2_qname_create -#define duckdb_v2_qname_destroy duckdb_ext_api.duckdb_v2_qname_destroy -#define duckdb_v2_qname_equals duckdb_ext_api.duckdb_v2_qname_equals -#define duckdb_v2_qname_get_part duckdb_ext_api.duckdb_v2_qname_get_part -#define duckdb_v2_qname_get_part_count duckdb_ext_api.duckdb_v2_qname_get_part_count -#define duckdb_v2_qname_hash duckdb_ext_api.duckdb_v2_qname_hash -#define duckdb_v2_qname_parse duckdb_ext_api.duckdb_v2_qname_parse -#define duckdb_v2_qname_render duckdb_ext_api.duckdb_v2_qname_render -#define duckdb_v2_replacement_scan_add_argument duckdb_ext_api.duckdb_v2_replacement_scan_add_argument -#define duckdb_v2_replacement_scan_add_named_argument duckdb_ext_api.duckdb_v2_replacement_scan_add_named_argument -#define duckdb_v2_replacement_scan_create duckdb_ext_api.duckdb_v2_replacement_scan_create -#define duckdb_v2_replacement_scan_destroy duckdb_ext_api.duckdb_v2_replacement_scan_destroy -#define duckdb_v2_replacement_scan_get_name duckdb_ext_api.duckdb_v2_replacement_scan_get_name -#define duckdb_v2_replacement_scan_get_user_data duckdb_ext_api.duckdb_v2_replacement_scan_get_user_data -#define duckdb_v2_replacement_scan_set_alias duckdb_ext_api.duckdb_v2_replacement_scan_set_alias -#define duckdb_v2_replacement_scan_set_callback duckdb_ext_api.duckdb_v2_replacement_scan_set_callback -#define duckdb_v2_replacement_scan_set_collection duckdb_ext_api.duckdb_v2_replacement_scan_set_collection -#define duckdb_v2_replacement_scan_set_function_name duckdb_ext_api.duckdb_v2_replacement_scan_set_function_name -#define duckdb_v2_replacement_scan_set_subquery duckdb_ext_api.duckdb_v2_replacement_scan_set_subquery -#define duckdb_v2_replacement_scan_set_user_data duckdb_ext_api.duckdb_v2_replacement_scan_set_user_data -#define duckdb_v2_arrow_exporter_append duckdb_ext_api.duckdb_v2_arrow_exporter_append -#define duckdb_v2_arrow_exporter_create duckdb_ext_api.duckdb_v2_arrow_exporter_create -#define duckdb_v2_arrow_exporter_destroy duckdb_ext_api.duckdb_v2_arrow_exporter_destroy -#define duckdb_v2_arrow_exporter_get_schema duckdb_ext_api.duckdb_v2_arrow_exporter_get_schema -#define duckdb_v2_arrow_exporter_next_array duckdb_ext_api.duckdb_v2_arrow_exporter_next_array -#define duckdb_v2_arrow_importer_append duckdb_ext_api.duckdb_v2_arrow_importer_append -#define duckdb_v2_arrow_importer_create duckdb_ext_api.duckdb_v2_arrow_importer_create -#define duckdb_v2_arrow_importer_destroy duckdb_ext_api.duckdb_v2_arrow_importer_destroy -#define duckdb_v2_arrow_importer_get_schema duckdb_ext_api.duckdb_v2_arrow_importer_get_schema -#define duckdb_v2_arrow_importer_next_chunk duckdb_ext_api.duckdb_v2_arrow_importer_next_chunk -#define duckdb_v2_column_description_destroy duckdb_ext_api.duckdb_v2_column_description_destroy -#define duckdb_v2_column_description_get_name duckdb_ext_api.duckdb_v2_column_description_get_name -#define duckdb_v2_column_description_get_type duckdb_ext_api.duckdb_v2_column_description_get_type -#define duckdb_v2_column_description_has_default duckdb_ext_api.duckdb_v2_column_description_has_default -#define duckdb_v2_column_description_has_generated duckdb_ext_api.duckdb_v2_column_description_has_generated -#define duckdb_v2_connection_describe_table duckdb_ext_api.duckdb_v2_connection_describe_table -#define duckdb_v2_connection_register_copy_function duckdb_ext_api.duckdb_v2_connection_register_copy_function -#define duckdb_v2_copy_from_bind_get_column_count duckdb_ext_api.duckdb_v2_copy_from_bind_get_column_count -#define duckdb_v2_copy_from_bind_get_column_name duckdb_ext_api.duckdb_v2_copy_from_bind_get_column_name -#define duckdb_v2_copy_from_bind_get_column_type duckdb_ext_api.duckdb_v2_copy_from_bind_get_column_type -#define duckdb_v2_copy_from_bind_get_file_path duckdb_ext_api.duckdb_v2_copy_from_bind_get_file_path -#define duckdb_v2_copy_from_bind_get_option_count duckdb_ext_api.duckdb_v2_copy_from_bind_get_option_count -#define duckdb_v2_copy_from_bind_get_option_name duckdb_ext_api.duckdb_v2_copy_from_bind_get_option_name -#define duckdb_v2_copy_from_bind_get_option_value duckdb_ext_api.duckdb_v2_copy_from_bind_get_option_value -#define duckdb_v2_copy_from_bind_get_user_data duckdb_ext_api.duckdb_v2_copy_from_bind_get_user_data -#define duckdb_v2_copy_from_bind_set_bind_data duckdb_ext_api.duckdb_v2_copy_from_bind_set_bind_data -#define duckdb_v2_copy_from_bind_set_cardinality duckdb_ext_api.duckdb_v2_copy_from_bind_set_cardinality -#define duckdb_v2_copy_from_exec_get_bind_data duckdb_ext_api.duckdb_v2_copy_from_exec_get_bind_data -#define duckdb_v2_copy_from_exec_get_global_state duckdb_ext_api.duckdb_v2_copy_from_exec_get_global_state -#define duckdb_v2_copy_from_exec_get_local_state duckdb_ext_api.duckdb_v2_copy_from_exec_get_local_state -#define duckdb_v2_copy_from_exec_get_output_chunk duckdb_ext_api.duckdb_v2_copy_from_exec_get_output_chunk -#define duckdb_v2_copy_from_exec_get_user_data duckdb_ext_api.duckdb_v2_copy_from_exec_get_user_data -#define duckdb_v2_copy_from_init_global_get_bind_data duckdb_ext_api.duckdb_v2_copy_from_init_global_get_bind_data -#define duckdb_v2_copy_from_init_global_get_user_data duckdb_ext_api.duckdb_v2_copy_from_init_global_get_user_data -#define duckdb_v2_copy_from_init_global_set_global_state duckdb_ext_api.duckdb_v2_copy_from_init_global_set_global_state -#define duckdb_v2_copy_from_init_global_set_max_threads duckdb_ext_api.duckdb_v2_copy_from_init_global_set_max_threads -#define duckdb_v2_copy_from_init_local_get_bind_data duckdb_ext_api.duckdb_v2_copy_from_init_local_get_bind_data -#define duckdb_v2_copy_from_init_local_get_global_state duckdb_ext_api.duckdb_v2_copy_from_init_local_get_global_state -#define duckdb_v2_copy_from_init_local_get_user_data duckdb_ext_api.duckdb_v2_copy_from_init_local_get_user_data -#define duckdb_v2_copy_from_init_local_set_local_state duckdb_ext_api.duckdb_v2_copy_from_init_local_set_local_state -#define duckdb_v2_copy_from_progress_get_bind_data duckdb_ext_api.duckdb_v2_copy_from_progress_get_bind_data -#define duckdb_v2_copy_from_progress_get_global_state duckdb_ext_api.duckdb_v2_copy_from_progress_get_global_state -#define duckdb_v2_copy_from_progress_get_user_data duckdb_ext_api.duckdb_v2_copy_from_progress_get_user_data -#define duckdb_v2_copy_from_progress_set_progress duckdb_ext_api.duckdb_v2_copy_from_progress_set_progress -#define duckdb_v2_copy_from_set_bind_callback duckdb_ext_api.duckdb_v2_copy_from_set_bind_callback -#define duckdb_v2_copy_from_set_exec_callback duckdb_ext_api.duckdb_v2_copy_from_set_exec_callback -#define duckdb_v2_copy_from_set_init_global_callback duckdb_ext_api.duckdb_v2_copy_from_set_init_global_callback -#define duckdb_v2_copy_from_set_init_local_callback duckdb_ext_api.duckdb_v2_copy_from_set_init_local_callback -#define duckdb_v2_copy_from_set_progress_callback duckdb_ext_api.duckdb_v2_copy_from_set_progress_callback -#define duckdb_v2_copy_function_create duckdb_ext_api.duckdb_v2_copy_function_create -#define duckdb_v2_copy_function_destroy duckdb_ext_api.duckdb_v2_copy_function_destroy -#define duckdb_v2_copy_function_set_name duckdb_ext_api.duckdb_v2_copy_function_set_name -#define duckdb_v2_copy_function_set_user_data duckdb_ext_api.duckdb_v2_copy_function_set_user_data -#define duckdb_v2_copy_to_batch_get_bind_data duckdb_ext_api.duckdb_v2_copy_to_batch_get_bind_data -#define duckdb_v2_copy_to_batch_get_init_data duckdb_ext_api.duckdb_v2_copy_to_batch_get_init_data -#define duckdb_v2_copy_to_batch_get_user_data duckdb_ext_api.duckdb_v2_copy_to_batch_get_user_data -#define duckdb_v2_copy_to_batch_set_batch_data duckdb_ext_api.duckdb_v2_copy_to_batch_set_batch_data -#define duckdb_v2_copy_to_batch_size_get_bind_data duckdb_ext_api.duckdb_v2_copy_to_batch_size_get_bind_data -#define duckdb_v2_copy_to_batch_size_get_user_data duckdb_ext_api.duckdb_v2_copy_to_batch_size_get_user_data -#define duckdb_v2_copy_to_batch_size_set_target duckdb_ext_api.duckdb_v2_copy_to_batch_size_set_target -#define duckdb_v2_copy_to_batch_take_input duckdb_ext_api.duckdb_v2_copy_to_batch_take_input -#define duckdb_v2_copy_to_bind_get_column_count duckdb_ext_api.duckdb_v2_copy_to_bind_get_column_count -#define duckdb_v2_copy_to_bind_get_column_name duckdb_ext_api.duckdb_v2_copy_to_bind_get_column_name -#define duckdb_v2_copy_to_bind_get_column_type duckdb_ext_api.duckdb_v2_copy_to_bind_get_column_type -#define duckdb_v2_copy_to_bind_get_file_path duckdb_ext_api.duckdb_v2_copy_to_bind_get_file_path -#define duckdb_v2_copy_to_bind_get_option_count duckdb_ext_api.duckdb_v2_copy_to_bind_get_option_count -#define duckdb_v2_copy_to_bind_get_option_name duckdb_ext_api.duckdb_v2_copy_to_bind_get_option_name -#define duckdb_v2_copy_to_bind_get_option_value duckdb_ext_api.duckdb_v2_copy_to_bind_get_option_value -#define duckdb_v2_copy_to_bind_get_user_data duckdb_ext_api.duckdb_v2_copy_to_bind_get_user_data -#define duckdb_v2_copy_to_bind_set_bind_data duckdb_ext_api.duckdb_v2_copy_to_bind_set_bind_data -#define duckdb_v2_copy_to_finalize_get_bind_data duckdb_ext_api.duckdb_v2_copy_to_finalize_get_bind_data -#define duckdb_v2_copy_to_finalize_get_init_data duckdb_ext_api.duckdb_v2_copy_to_finalize_get_init_data -#define duckdb_v2_copy_to_finalize_get_user_data duckdb_ext_api.duckdb_v2_copy_to_finalize_get_user_data -#define duckdb_v2_copy_to_flush_get_batch_data duckdb_ext_api.duckdb_v2_copy_to_flush_get_batch_data -#define duckdb_v2_copy_to_flush_get_bind_data duckdb_ext_api.duckdb_v2_copy_to_flush_get_bind_data -#define duckdb_v2_copy_to_flush_get_init_data duckdb_ext_api.duckdb_v2_copy_to_flush_get_init_data -#define duckdb_v2_copy_to_flush_get_user_data duckdb_ext_api.duckdb_v2_copy_to_flush_get_user_data -#define duckdb_v2_copy_to_init_get_bind_data duckdb_ext_api.duckdb_v2_copy_to_init_get_bind_data -#define duckdb_v2_copy_to_init_get_file_path duckdb_ext_api.duckdb_v2_copy_to_init_get_file_path -#define duckdb_v2_copy_to_init_get_user_data duckdb_ext_api.duckdb_v2_copy_to_init_get_user_data -#define duckdb_v2_copy_to_init_set_init_data duckdb_ext_api.duckdb_v2_copy_to_init_set_init_data -#define duckdb_v2_copy_to_set_batch_callback duckdb_ext_api.duckdb_v2_copy_to_set_batch_callback -#define duckdb_v2_copy_to_set_batch_size_callback duckdb_ext_api.duckdb_v2_copy_to_set_batch_size_callback -#define duckdb_v2_copy_to_set_bind_callback duckdb_ext_api.duckdb_v2_copy_to_set_bind_callback -#define duckdb_v2_copy_to_set_finalize_callback duckdb_ext_api.duckdb_v2_copy_to_set_finalize_callback -#define duckdb_v2_copy_to_set_flush_callback duckdb_ext_api.duckdb_v2_copy_to_set_flush_callback -#define duckdb_v2_copy_to_set_init_callback duckdb_ext_api.duckdb_v2_copy_to_set_init_callback -#define duckdb_v2_expression_cast_get_mode duckdb_ext_api.duckdb_v2_expression_cast_get_mode -#define duckdb_v2_expression_column_ref_get_index duckdb_ext_api.duckdb_v2_expression_column_ref_get_index -#define duckdb_v2_expression_constant_get_value duckdb_ext_api.duckdb_v2_expression_constant_get_value -#define duckdb_v2_expression_function_get_name duckdb_ext_api.duckdb_v2_expression_function_get_name -#define duckdb_v2_expression_function_get_qname duckdb_ext_api.duckdb_v2_expression_function_get_qname -#define duckdb_v2_expression_get_child duckdb_ext_api.duckdb_v2_expression_get_child -#define duckdb_v2_expression_get_child_count duckdb_ext_api.duckdb_v2_expression_get_child_count -#define duckdb_v2_expression_get_return_type duckdb_ext_api.duckdb_v2_expression_get_return_type -#define duckdb_v2_expression_get_type duckdb_ext_api.duckdb_v2_expression_get_type -#define duckdb_v2_extension_register_copy_function duckdb_ext_api.duckdb_v2_extension_register_copy_function -#define duckdb_v2_identifier_render_quoted duckdb_ext_api.duckdb_v2_identifier_render_quoted -#define duckdb_v2_prepared_statement_create duckdb_ext_api.duckdb_v2_prepared_statement_create -#define duckdb_v2_prepared_statement_destroy duckdb_ext_api.duckdb_v2_prepared_statement_destroy -#define duckdb_v2_prepared_statement_execute duckdb_ext_api.duckdb_v2_prepared_statement_execute -#define duckdb_v2_prepared_statement_reuses_plan duckdb_ext_api.duckdb_v2_prepared_statement_reuses_plan -#define duckdb_v2_table_description_destroy duckdb_ext_api.duckdb_v2_table_description_destroy -#define duckdb_v2_table_description_get_column duckdb_ext_api.duckdb_v2_table_description_get_column -#define duckdb_v2_table_description_get_column_count duckdb_ext_api.duckdb_v2_table_description_get_column_count -#define duckdb_v2_table_description_get_qname duckdb_ext_api.duckdb_v2_table_description_get_qname -#define duckdb_v2_table_description_is_readonly duckdb_ext_api.duckdb_v2_table_description_is_readonly -#define duckdb_v2_table_function_exec_get_column_count duckdb_ext_api.duckdb_v2_table_function_exec_get_column_count -#define duckdb_v2_table_function_exec_get_column_index duckdb_ext_api.duckdb_v2_table_function_exec_get_column_index -#define duckdb_v2_table_function_filter_pushdown_accept duckdb_ext_api.duckdb_v2_table_function_filter_pushdown_accept -#define duckdb_v2_table_function_filter_pushdown_get_bind_data \ - duckdb_ext_api.duckdb_v2_table_function_filter_pushdown_get_bind_data -#define duckdb_v2_table_function_filter_pushdown_get_column_count \ - duckdb_ext_api.duckdb_v2_table_function_filter_pushdown_get_column_count -#define duckdb_v2_table_function_filter_pushdown_get_column_index \ - duckdb_ext_api.duckdb_v2_table_function_filter_pushdown_get_column_index -#define duckdb_v2_table_function_filter_pushdown_get_filter \ - duckdb_ext_api.duckdb_v2_table_function_filter_pushdown_get_filter -#define duckdb_v2_table_function_filter_pushdown_get_filter_count \ - duckdb_ext_api.duckdb_v2_table_function_filter_pushdown_get_filter_count -#define duckdb_v2_table_function_filter_pushdown_get_user_data \ - duckdb_ext_api.duckdb_v2_table_function_filter_pushdown_get_user_data -#define duckdb_v2_table_function_init_global_get_column_count \ - duckdb_ext_api.duckdb_v2_table_function_init_global_get_column_count -#define duckdb_v2_table_function_init_global_get_column_index \ - duckdb_ext_api.duckdb_v2_table_function_init_global_get_column_index -#define duckdb_v2_table_function_init_local_get_column_count \ - duckdb_ext_api.duckdb_v2_table_function_init_local_get_column_count -#define duckdb_v2_table_function_init_local_get_column_index \ - duckdb_ext_api.duckdb_v2_table_function_init_local_get_column_index -#define duckdb_v2_table_function_set_filter_pushdown_callback \ - duckdb_ext_api.duckdb_v2_table_function_set_filter_pushdown_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_config_get_option_by_index duckdb_ext_api.duckdb_v2_config_get_option_by_index +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_config_get_option_by_name duckdb_ext_api.duckdb_v2_config_get_option_by_name +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_config_get_option_count duckdb_ext_api.duckdb_v2_config_get_option_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_connection_create duckdb_ext_api.duckdb_v2_connection_create +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_connection_destroy duckdb_ext_api.duckdb_v2_connection_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_connection_interrupt duckdb_ext_api.duckdb_v2_connection_interrupt +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_connection_progress_get duckdb_ext_api.duckdb_v2_connection_progress_get +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_data_chunk_copy duckdb_ext_api.duckdb_v2_data_chunk_copy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_data_chunk_create duckdb_ext_api.duckdb_v2_data_chunk_create +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_data_chunk_destroy duckdb_ext_api.duckdb_v2_data_chunk_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_data_chunk_get_size duckdb_ext_api.duckdb_v2_data_chunk_get_size +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_data_chunk_get_vector duckdb_ext_api.duckdb_v2_data_chunk_get_vector +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_data_chunk_get_vector_count duckdb_ext_api.duckdb_v2_data_chunk_get_vector_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_environment_create duckdb_ext_api.duckdb_v2_environment_create +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_environment_destroy duckdb_ext_api.duckdb_v2_environment_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_environment_get_instance_count duckdb_ext_api.duckdb_v2_environment_get_instance_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_error_info_destroy duckdb_ext_api.duckdb_v2_error_info_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_error_info_get_code duckdb_ext_api.duckdb_v2_error_info_get_code +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_error_info_get_raw_text duckdb_ext_api.duckdb_v2_error_info_get_raw_text +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_error_info_get_text duckdb_ext_api.duckdb_v2_error_info_get_text +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_error_info_set_code duckdb_ext_api.duckdb_v2_error_info_set_code +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_error_info_set_text duckdb_ext_api.duckdb_v2_error_info_set_text +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_factory_create_type_from_id duckdb_ext_api.duckdb_v2_factory_create_type_from_id +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_factory_create_type_from_name duckdb_ext_api.duckdb_v2_factory_create_type_from_name +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_factory_create_type_from_text duckdb_ext_api.duckdb_v2_factory_create_type_from_text +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_factory_create_type_with_alias duckdb_ext_api.duckdb_v2_factory_create_type_with_alias +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_instance_attach duckdb_ext_api.duckdb_v2_instance_attach +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_instance_create duckdb_ext_api.duckdb_v2_instance_create +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_instance_create_with_options duckdb_ext_api.duckdb_v2_instance_create_with_options +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_instance_destroy duckdb_ext_api.duckdb_v2_instance_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_instance_detach duckdb_ext_api.duckdb_v2_instance_detach +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_library_version duckdb_ext_api.duckdb_v2_library_version +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_logical_type_copy duckdb_ext_api.duckdb_v2_logical_type_copy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_logical_type_destroy duckdb_ext_api.duckdb_v2_logical_type_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_logical_type_get_id duckdb_ext_api.duckdb_v2_logical_type_get_id +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_logical_type_get_name duckdb_ext_api.duckdb_v2_logical_type_get_name +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_logical_type_get_param duckdb_ext_api.duckdb_v2_logical_type_get_param +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_logical_type_get_param_count duckdb_ext_api.duckdb_v2_logical_type_get_param_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_logical_type_is_equal duckdb_ext_api.duckdb_v2_logical_type_is_equal +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_logical_type_to_text duckdb_ext_api.duckdb_v2_logical_type_to_text +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_option_destroy duckdb_ext_api.duckdb_v2_option_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_option_get_alias duckdb_ext_api.duckdb_v2_option_get_alias +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_option_get_alias_count duckdb_ext_api.duckdb_v2_option_get_alias_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_option_get_default_value duckdb_ext_api.duckdb_v2_option_get_default_value +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_option_get_description duckdb_ext_api.duckdb_v2_option_get_description +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_option_get_name duckdb_ext_api.duckdb_v2_option_get_name +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_parse_sql duckdb_ext_api.duckdb_v2_parse_sql +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_result_destroy duckdb_ext_api.duckdb_v2_result_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_result_drain duckdb_ext_api.duckdb_v2_result_drain +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_result_fetch_chunk duckdb_ext_api.duckdb_v2_result_fetch_chunk +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_result_get_result_type duckdb_ext_api.duckdb_v2_result_get_result_type +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_result_get_schema duckdb_ext_api.duckdb_v2_result_get_schema +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_result_get_statement_type duckdb_ext_api.duckdb_v2_result_get_statement_type +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_result_render_box duckdb_ext_api.duckdb_v2_result_render_box +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_result_step duckdb_ext_api.duckdb_v2_result_step +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_result_wait duckdb_ext_api.duckdb_v2_result_wait +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_schema_destroy duckdb_ext_api.duckdb_v2_schema_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_schema_get_count duckdb_ext_api.duckdb_v2_schema_get_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_schema_get_field duckdb_ext_api.duckdb_v2_schema_get_field +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_sql_statement_destroy duckdb_ext_api.duckdb_v2_sql_statement_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_statement_bind duckdb_ext_api.duckdb_v2_statement_bind +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_statement_execute duckdb_ext_api.duckdb_v2_statement_execute +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_statement_iterator_destroy duckdb_ext_api.duckdb_v2_statement_iterator_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_statement_iterator_next duckdb_ext_api.duckdb_v2_statement_iterator_next +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_cast duckdb_ext_api.duckdb_v2_value_cast +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_array duckdb_ext_api.duckdb_v2_value_create_array +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_bigint duckdb_ext_api.duckdb_v2_value_create_bigint +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_bignum duckdb_ext_api.duckdb_v2_value_create_bignum +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_bit duckdb_ext_api.duckdb_v2_value_create_bit +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_blob duckdb_ext_api.duckdb_v2_value_create_blob +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_bool duckdb_ext_api.duckdb_v2_value_create_bool +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_date duckdb_ext_api.duckdb_v2_value_create_date +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_decimal duckdb_ext_api.duckdb_v2_value_create_decimal +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_double duckdb_ext_api.duckdb_v2_value_create_double +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_float duckdb_ext_api.duckdb_v2_value_create_float +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_hugeint duckdb_ext_api.duckdb_v2_value_create_hugeint +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_int duckdb_ext_api.duckdb_v2_value_create_int +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_interval duckdb_ext_api.duckdb_v2_value_create_interval +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_list duckdb_ext_api.duckdb_v2_value_create_list +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_map duckdb_ext_api.duckdb_v2_value_create_map +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_null duckdb_ext_api.duckdb_v2_value_create_null +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_smallint duckdb_ext_api.duckdb_v2_value_create_smallint +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_struct duckdb_ext_api.duckdb_v2_value_create_struct +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_time duckdb_ext_api.duckdb_v2_value_create_time +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_time_ns duckdb_ext_api.duckdb_v2_value_create_time_ns +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_time_tz duckdb_ext_api.duckdb_v2_value_create_time_tz +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_timestamp duckdb_ext_api.duckdb_v2_value_create_timestamp +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_timestamp_ms duckdb_ext_api.duckdb_v2_value_create_timestamp_ms +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_timestamp_ns duckdb_ext_api.duckdb_v2_value_create_timestamp_ns +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_timestamp_sec duckdb_ext_api.duckdb_v2_value_create_timestamp_sec +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_timestamp_tz duckdb_ext_api.duckdb_v2_value_create_timestamp_tz +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_timestamp_tz_ns duckdb_ext_api.duckdb_v2_value_create_timestamp_tz_ns +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_tinyint duckdb_ext_api.duckdb_v2_value_create_tinyint +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_tuple duckdb_ext_api.duckdb_v2_value_create_tuple +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_type duckdb_ext_api.duckdb_v2_value_create_type +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_ubigint duckdb_ext_api.duckdb_v2_value_create_ubigint +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_uhugeint duckdb_ext_api.duckdb_v2_value_create_uhugeint +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_uint duckdb_ext_api.duckdb_v2_value_create_uint +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_usmallint duckdb_ext_api.duckdb_v2_value_create_usmallint +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_utinyint duckdb_ext_api.duckdb_v2_value_create_utinyint +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_uuid duckdb_ext_api.duckdb_v2_value_create_uuid +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_create_varchar duckdb_ext_api.duckdb_v2_value_create_varchar +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_destroy duckdb_ext_api.duckdb_v2_value_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_bigint duckdb_ext_api.duckdb_v2_value_get_bigint +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_blob duckdb_ext_api.duckdb_v2_value_get_blob +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_bool duckdb_ext_api.duckdb_v2_value_get_bool +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_child duckdb_ext_api.duckdb_v2_value_get_child +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_child_count duckdb_ext_api.duckdb_v2_value_get_child_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_date duckdb_ext_api.duckdb_v2_value_get_date +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_decimal duckdb_ext_api.duckdb_v2_value_get_decimal +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_double duckdb_ext_api.duckdb_v2_value_get_double +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_float duckdb_ext_api.duckdb_v2_value_get_float +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_hugeint duckdb_ext_api.duckdb_v2_value_get_hugeint +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_int duckdb_ext_api.duckdb_v2_value_get_int +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_interval duckdb_ext_api.duckdb_v2_value_get_interval +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_logical_type duckdb_ext_api.duckdb_v2_value_get_logical_type +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_smallint duckdb_ext_api.duckdb_v2_value_get_smallint +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_time duckdb_ext_api.duckdb_v2_value_get_time +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_time_ns duckdb_ext_api.duckdb_v2_value_get_time_ns +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_time_tz duckdb_ext_api.duckdb_v2_value_get_time_tz +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_timestamp duckdb_ext_api.duckdb_v2_value_get_timestamp +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_timestamp_ms duckdb_ext_api.duckdb_v2_value_get_timestamp_ms +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_timestamp_ns duckdb_ext_api.duckdb_v2_value_get_timestamp_ns +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_timestamp_sec duckdb_ext_api.duckdb_v2_value_get_timestamp_sec +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_timestamp_tz duckdb_ext_api.duckdb_v2_value_get_timestamp_tz +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_timestamp_tz_ns duckdb_ext_api.duckdb_v2_value_get_timestamp_tz_ns +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_tinyint duckdb_ext_api.duckdb_v2_value_get_tinyint +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_type duckdb_ext_api.duckdb_v2_value_get_type +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_ubigint duckdb_ext_api.duckdb_v2_value_get_ubigint +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_uhugeint duckdb_ext_api.duckdb_v2_value_get_uhugeint +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_uint duckdb_ext_api.duckdb_v2_value_get_uint +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_usmallint duckdb_ext_api.duckdb_v2_value_get_usmallint +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_utinyint duckdb_ext_api.duckdb_v2_value_get_utinyint +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_uuid duckdb_ext_api.duckdb_v2_value_get_uuid +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_get_varchar duckdb_ext_api.duckdb_v2_value_get_varchar +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_is_null duckdb_ext_api.duckdb_v2_value_is_null +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_value_to_string duckdb_ext_api.duckdb_v2_value_to_string +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_vector_constant_set_valid duckdb_ext_api.duckdb_v2_vector_constant_set_valid +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_vector_flat_get_validity_mutable duckdb_ext_api.duckdb_v2_vector_flat_get_validity_mutable +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_vector_flatten duckdb_ext_api.duckdb_v2_vector_flatten +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_vector_get_arena duckdb_ext_api.duckdb_v2_vector_get_arena +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_vector_get_child duckdb_ext_api.duckdb_v2_vector_get_child +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_vector_get_child_count duckdb_ext_api.duckdb_v2_vector_get_child_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_vector_get_data_mutable duckdb_ext_api.duckdb_v2_vector_get_data_mutable +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_vector_get_logical_type duckdb_ext_api.duckdb_v2_vector_get_logical_type +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_vector_get_size duckdb_ext_api.duckdb_v2_vector_get_size +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_vector_get_value duckdb_ext_api.duckdb_v2_vector_get_value +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_vector_get_vector_type duckdb_ext_api.duckdb_v2_vector_get_vector_type +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_vector_get_view duckdb_ext_api.duckdb_v2_vector_get_view +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_vector_make_constant duckdb_ext_api.duckdb_v2_vector_make_constant +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_vector_make_sequence duckdb_ext_api.duckdb_v2_vector_make_sequence +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_vector_reference duckdb_ext_api.duckdb_v2_vector_reference +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_vector_set_null duckdb_ext_api.duckdb_v2_vector_set_null +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_vector_set_size duckdb_ext_api.duckdb_v2_vector_set_size +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_vector_set_value duckdb_ext_api.duckdb_v2_vector_set_value +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_connection_register_scalar_function duckdb_ext_api.duckdb_v2_connection_register_scalar_function +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_context_log duckdb_ext_api.duckdb_v2_context_log +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_extension_register_scalar_function duckdb_ext_api.duckdb_v2_extension_register_scalar_function +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_function_signature_add_parameter duckdb_ext_api.duckdb_v2_function_signature_add_parameter +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_function_signature_set_return_type duckdb_ext_api.duckdb_v2_function_signature_set_return_type +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_scalar_function_create duckdb_ext_api.duckdb_v2_scalar_function_create +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_scalar_function_destroy duckdb_ext_api.duckdb_v2_scalar_function_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_scalar_function_exec_get_arg duckdb_ext_api.duckdb_v2_scalar_function_exec_get_arg +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_scalar_function_exec_get_arg_count duckdb_ext_api.duckdb_v2_scalar_function_exec_get_arg_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_scalar_function_exec_get_bind_data duckdb_ext_api.duckdb_v2_scalar_function_exec_get_bind_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_scalar_function_exec_get_init_data duckdb_ext_api.duckdb_v2_scalar_function_exec_get_init_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_scalar_function_exec_get_result duckdb_ext_api.duckdb_v2_scalar_function_exec_get_result +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_scalar_function_exec_get_row_count duckdb_ext_api.duckdb_v2_scalar_function_exec_get_row_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_scalar_function_exec_get_user_data duckdb_ext_api.duckdb_v2_scalar_function_exec_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_scalar_function_get_signature duckdb_ext_api.duckdb_v2_scalar_function_get_signature +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_scalar_function_init_get_bind_data duckdb_ext_api.duckdb_v2_scalar_function_init_get_bind_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_scalar_function_init_get_user_data duckdb_ext_api.duckdb_v2_scalar_function_init_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_scalar_function_init_set_init_data duckdb_ext_api.duckdb_v2_scalar_function_init_set_init_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_scalar_function_set_bind_callback duckdb_ext_api.duckdb_v2_scalar_function_set_bind_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_scalar_function_set_exec_callback duckdb_ext_api.duckdb_v2_scalar_function_set_exec_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_scalar_function_set_init_callback duckdb_ext_api.duckdb_v2_scalar_function_set_init_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_scalar_function_set_name duckdb_ext_api.duckdb_v2_scalar_function_set_name +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_scalar_function_set_user_data duckdb_ext_api.duckdb_v2_scalar_function_set_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_bind_set_return_type \ + duckdb_ext_api.duckdb_v2_aggregate_function_bind_set_return_type +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_combine_get_bind_data \ + duckdb_ext_api.duckdb_v2_aggregate_function_combine_get_bind_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_combine_get_sources duckdb_ext_api.duckdb_v2_aggregate_function_combine_get_sources +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_combine_get_state_count \ + duckdb_ext_api.duckdb_v2_aggregate_function_combine_get_state_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_combine_get_targets duckdb_ext_api.duckdb_v2_aggregate_function_combine_get_targets +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_combine_get_user_data \ + duckdb_ext_api.duckdb_v2_aggregate_function_combine_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_create duckdb_ext_api.duckdb_v2_aggregate_function_create +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_destroy duckdb_ext_api.duckdb_v2_aggregate_function_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_destroy_get_bind_data \ + duckdb_ext_api.duckdb_v2_aggregate_function_destroy_get_bind_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_destroy_get_state_count \ + duckdb_ext_api.duckdb_v2_aggregate_function_destroy_get_state_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_destroy_get_states duckdb_ext_api.duckdb_v2_aggregate_function_destroy_get_states +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_destroy_get_user_data \ + duckdb_ext_api.duckdb_v2_aggregate_function_destroy_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_finalize_get_bind_data \ + duckdb_ext_api.duckdb_v2_aggregate_function_finalize_get_bind_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_finalize_get_result duckdb_ext_api.duckdb_v2_aggregate_function_finalize_get_result +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_finalize_get_result_offset \ + duckdb_ext_api.duckdb_v2_aggregate_function_finalize_get_result_offset +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_finalize_get_state_count \ + duckdb_ext_api.duckdb_v2_aggregate_function_finalize_get_state_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_finalize_get_states duckdb_ext_api.duckdb_v2_aggregate_function_finalize_get_states +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_finalize_get_user_data \ + duckdb_ext_api.duckdb_v2_aggregate_function_finalize_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_get_signature duckdb_ext_api.duckdb_v2_aggregate_function_get_signature +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_init_get_bind_data duckdb_ext_api.duckdb_v2_aggregate_function_init_get_bind_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_init_get_state_count \ + duckdb_ext_api.duckdb_v2_aggregate_function_init_get_state_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_init_get_states duckdb_ext_api.duckdb_v2_aggregate_function_init_get_states +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_init_get_user_data duckdb_ext_api.duckdb_v2_aggregate_function_init_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_set_bind_callback duckdb_ext_api.duckdb_v2_aggregate_function_set_bind_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_set_combine_callback \ + duckdb_ext_api.duckdb_v2_aggregate_function_set_combine_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_set_destroy_callback \ + duckdb_ext_api.duckdb_v2_aggregate_function_set_destroy_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_set_finalize_callback \ + duckdb_ext_api.duckdb_v2_aggregate_function_set_finalize_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_set_init_callback duckdb_ext_api.duckdb_v2_aggregate_function_set_init_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_set_name duckdb_ext_api.duckdb_v2_aggregate_function_set_name +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_set_size_callback duckdb_ext_api.duckdb_v2_aggregate_function_set_size_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_set_update_callback duckdb_ext_api.duckdb_v2_aggregate_function_set_update_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_set_user_data duckdb_ext_api.duckdb_v2_aggregate_function_set_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_size_get_bind_data duckdb_ext_api.duckdb_v2_aggregate_function_size_get_bind_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_size_get_user_data duckdb_ext_api.duckdb_v2_aggregate_function_size_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_size_set_state_size duckdb_ext_api.duckdb_v2_aggregate_function_size_set_state_size +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_update_get_arg duckdb_ext_api.duckdb_v2_aggregate_function_update_get_arg +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_update_get_arg_count \ + duckdb_ext_api.duckdb_v2_aggregate_function_update_get_arg_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_update_get_bind_data \ + duckdb_ext_api.duckdb_v2_aggregate_function_update_get_bind_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_update_get_row_count \ + duckdb_ext_api.duckdb_v2_aggregate_function_update_get_row_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_update_get_states duckdb_ext_api.duckdb_v2_aggregate_function_update_get_states +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_update_get_user_data \ + duckdb_ext_api.duckdb_v2_aggregate_function_update_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_connection_register_aggregate_function duckdb_ext_api.duckdb_v2_connection_register_aggregate_function +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_extension_register_aggregate_function duckdb_ext_api.duckdb_v2_extension_register_aggregate_function +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_set_property duckdb_ext_api.duckdb_v2_aggregate_function_set_property +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_scalar_function_set_property duckdb_ext_api.duckdb_v2_scalar_function_set_property +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_connection_register_table_function duckdb_ext_api.duckdb_v2_connection_register_table_function +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_extension_register_table_function duckdb_ext_api.duckdb_v2_extension_register_table_function +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_bind_add_result_column duckdb_ext_api.duckdb_v2_table_function_bind_add_result_column +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_bind_set_cardinality duckdb_ext_api.duckdb_v2_table_function_bind_set_cardinality +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_create duckdb_ext_api.duckdb_v2_table_function_create +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_destroy duckdb_ext_api.duckdb_v2_table_function_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_exec_get_bind_data duckdb_ext_api.duckdb_v2_table_function_exec_get_bind_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_exec_get_global_state duckdb_ext_api.duckdb_v2_table_function_exec_get_global_state +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_exec_get_local_state duckdb_ext_api.duckdb_v2_table_function_exec_get_local_state +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_exec_get_output_chunk duckdb_ext_api.duckdb_v2_table_function_exec_get_output_chunk +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_exec_get_user_data duckdb_ext_api.duckdb_v2_table_function_exec_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_get_signature duckdb_ext_api.duckdb_v2_table_function_get_signature +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_init_global_get_bind_data \ + duckdb_ext_api.duckdb_v2_table_function_init_global_get_bind_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_init_global_get_user_data \ + duckdb_ext_api.duckdb_v2_table_function_init_global_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_init_global_set_global_state \ + duckdb_ext_api.duckdb_v2_table_function_init_global_set_global_state +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_init_global_set_max_threads \ + duckdb_ext_api.duckdb_v2_table_function_init_global_set_max_threads +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_init_local_get_bind_data \ + duckdb_ext_api.duckdb_v2_table_function_init_local_get_bind_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_init_local_get_global_state \ + duckdb_ext_api.duckdb_v2_table_function_init_local_get_global_state +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_init_local_get_user_data \ + duckdb_ext_api.duckdb_v2_table_function_init_local_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_init_local_set_local_state \ + duckdb_ext_api.duckdb_v2_table_function_init_local_set_local_state +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_progress_get_bind_data duckdb_ext_api.duckdb_v2_table_function_progress_get_bind_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_progress_get_global_state \ + duckdb_ext_api.duckdb_v2_table_function_progress_get_global_state +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_progress_get_user_data duckdb_ext_api.duckdb_v2_table_function_progress_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_progress_set_progress duckdb_ext_api.duckdb_v2_table_function_progress_set_progress +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_set_bind_callback duckdb_ext_api.duckdb_v2_table_function_set_bind_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_set_exec_callback duckdb_ext_api.duckdb_v2_table_function_set_exec_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_set_init_global_callback \ + duckdb_ext_api.duckdb_v2_table_function_set_init_global_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_set_init_local_callback duckdb_ext_api.duckdb_v2_table_function_set_init_local_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_set_name duckdb_ext_api.duckdb_v2_table_function_set_name +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_set_progress_callback duckdb_ext_api.duckdb_v2_table_function_set_progress_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_set_user_data duckdb_ext_api.duckdb_v2_table_function_set_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_cast_function_create duckdb_ext_api.duckdb_v2_cast_function_create +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_cast_function_destroy duckdb_ext_api.duckdb_v2_cast_function_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_cast_function_exec_get_input duckdb_ext_api.duckdb_v2_cast_function_exec_get_input +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_cast_function_exec_get_mode duckdb_ext_api.duckdb_v2_cast_function_exec_get_mode +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_cast_function_exec_get_output duckdb_ext_api.duckdb_v2_cast_function_exec_get_output +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_cast_function_exec_get_row_count duckdb_ext_api.duckdb_v2_cast_function_exec_get_row_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_cast_function_exec_get_user_data duckdb_ext_api.duckdb_v2_cast_function_exec_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_cast_function_set_exec_callback duckdb_ext_api.duckdb_v2_cast_function_set_exec_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_cast_function_set_implicit_cast_cost duckdb_ext_api.duckdb_v2_cast_function_set_implicit_cast_cost +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_cast_function_set_source_type duckdb_ext_api.duckdb_v2_cast_function_set_source_type +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_cast_function_set_target_type duckdb_ext_api.duckdb_v2_cast_function_set_target_type +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_cast_function_set_user_data duckdb_ext_api.duckdb_v2_cast_function_set_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_column_data_collection_clear duckdb_ext_api.duckdb_v2_column_data_collection_clear +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_connection_register_cast_function duckdb_ext_api.duckdb_v2_connection_register_cast_function +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_connection_register_custom_type duckdb_ext_api.duckdb_v2_connection_register_custom_type +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_connection_register_replacement_scan duckdb_ext_api.duckdb_v2_connection_register_replacement_scan +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_context_get_file_system duckdb_ext_api.duckdb_v2_context_get_file_system +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_custom_type_create duckdb_ext_api.duckdb_v2_custom_type_create +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_custom_type_destroy duckdb_ext_api.duckdb_v2_custom_type_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_custom_type_set_base_type duckdb_ext_api.duckdb_v2_custom_type_set_base_type +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_custom_type_set_name duckdb_ext_api.duckdb_v2_custom_type_set_name +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_extension_register_cast_function duckdb_ext_api.duckdb_v2_extension_register_cast_function +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_extension_register_custom_type duckdb_ext_api.duckdb_v2_extension_register_custom_type +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_extension_register_replacement_scan duckdb_ext_api.duckdb_v2_extension_register_replacement_scan +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_file_close duckdb_ext_api.duckdb_v2_file_close +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_file_destroy duckdb_ext_api.duckdb_v2_file_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_file_open_options_create duckdb_ext_api.duckdb_v2_file_open_options_create +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_file_open_options_destroy duckdb_ext_api.duckdb_v2_file_open_options_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_file_open_options_set_flag duckdb_ext_api.duckdb_v2_file_open_options_set_flag +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_file_open_options_set_value duckdb_ext_api.duckdb_v2_file_open_options_set_value +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_file_read duckdb_ext_api.duckdb_v2_file_read +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_file_read_at duckdb_ext_api.duckdb_v2_file_read_at +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_file_seek duckdb_ext_api.duckdb_v2_file_seek +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_file_size duckdb_ext_api.duckdb_v2_file_size +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_file_sync duckdb_ext_api.duckdb_v2_file_sync +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_file_system_open duckdb_ext_api.duckdb_v2_file_system_open +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_file_tell duckdb_ext_api.duckdb_v2_file_tell +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_file_write duckdb_ext_api.duckdb_v2_file_write +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_file_write_at duckdb_ext_api.duckdb_v2_file_write_at +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_instance_register_replacement_scan duckdb_ext_api.duckdb_v2_instance_register_replacement_scan +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_qname_create duckdb_ext_api.duckdb_v2_qname_create +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_qname_destroy duckdb_ext_api.duckdb_v2_qname_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_qname_equals duckdb_ext_api.duckdb_v2_qname_equals +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_qname_get_part duckdb_ext_api.duckdb_v2_qname_get_part +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_qname_get_part_count duckdb_ext_api.duckdb_v2_qname_get_part_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_qname_hash duckdb_ext_api.duckdb_v2_qname_hash +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_qname_parse duckdb_ext_api.duckdb_v2_qname_parse +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_qname_render duckdb_ext_api.duckdb_v2_qname_render +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_replacement_scan_add_argument duckdb_ext_api.duckdb_v2_replacement_scan_add_argument +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_replacement_scan_add_named_argument duckdb_ext_api.duckdb_v2_replacement_scan_add_named_argument +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_replacement_scan_create duckdb_ext_api.duckdb_v2_replacement_scan_create +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_replacement_scan_destroy duckdb_ext_api.duckdb_v2_replacement_scan_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_replacement_scan_get_name duckdb_ext_api.duckdb_v2_replacement_scan_get_name +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_replacement_scan_get_user_data duckdb_ext_api.duckdb_v2_replacement_scan_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_replacement_scan_set_alias duckdb_ext_api.duckdb_v2_replacement_scan_set_alias +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_replacement_scan_set_callback duckdb_ext_api.duckdb_v2_replacement_scan_set_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_replacement_scan_set_collection duckdb_ext_api.duckdb_v2_replacement_scan_set_collection +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_replacement_scan_set_function_name duckdb_ext_api.duckdb_v2_replacement_scan_set_function_name +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_replacement_scan_set_subquery duckdb_ext_api.duckdb_v2_replacement_scan_set_subquery +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_replacement_scan_set_user_data duckdb_ext_api.duckdb_v2_replacement_scan_set_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_arrow_exporter_append duckdb_ext_api.duckdb_v2_arrow_exporter_append +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_arrow_exporter_create duckdb_ext_api.duckdb_v2_arrow_exporter_create +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_arrow_exporter_destroy duckdb_ext_api.duckdb_v2_arrow_exporter_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_arrow_exporter_get_schema duckdb_ext_api.duckdb_v2_arrow_exporter_get_schema +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_arrow_exporter_next_array duckdb_ext_api.duckdb_v2_arrow_exporter_next_array +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_arrow_importer_append duckdb_ext_api.duckdb_v2_arrow_importer_append +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_arrow_importer_create duckdb_ext_api.duckdb_v2_arrow_importer_create +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_arrow_importer_destroy duckdb_ext_api.duckdb_v2_arrow_importer_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_arrow_importer_get_schema duckdb_ext_api.duckdb_v2_arrow_importer_get_schema +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_arrow_importer_next_chunk duckdb_ext_api.duckdb_v2_arrow_importer_next_chunk +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_column_description_destroy duckdb_ext_api.duckdb_v2_column_description_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_column_description_get_name duckdb_ext_api.duckdb_v2_column_description_get_name +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_column_description_get_type duckdb_ext_api.duckdb_v2_column_description_get_type +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_column_description_has_default duckdb_ext_api.duckdb_v2_column_description_has_default +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_column_description_has_generated duckdb_ext_api.duckdb_v2_column_description_has_generated +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_connection_describe_table duckdb_ext_api.duckdb_v2_connection_describe_table +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_connection_register_copy_function duckdb_ext_api.duckdb_v2_connection_register_copy_function +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_bind_get_column_count duckdb_ext_api.duckdb_v2_copy_from_bind_get_column_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_bind_get_column_name duckdb_ext_api.duckdb_v2_copy_from_bind_get_column_name +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_bind_get_column_type duckdb_ext_api.duckdb_v2_copy_from_bind_get_column_type +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_bind_get_file_path duckdb_ext_api.duckdb_v2_copy_from_bind_get_file_path +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_bind_get_option_count duckdb_ext_api.duckdb_v2_copy_from_bind_get_option_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_bind_get_option_name duckdb_ext_api.duckdb_v2_copy_from_bind_get_option_name +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_bind_get_option_value duckdb_ext_api.duckdb_v2_copy_from_bind_get_option_value +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_bind_get_user_data duckdb_ext_api.duckdb_v2_copy_from_bind_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_bind_set_bind_data duckdb_ext_api.duckdb_v2_copy_from_bind_set_bind_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_bind_set_cardinality duckdb_ext_api.duckdb_v2_copy_from_bind_set_cardinality +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_exec_get_bind_data duckdb_ext_api.duckdb_v2_copy_from_exec_get_bind_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_exec_get_global_state duckdb_ext_api.duckdb_v2_copy_from_exec_get_global_state +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_exec_get_local_state duckdb_ext_api.duckdb_v2_copy_from_exec_get_local_state +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_exec_get_output_chunk duckdb_ext_api.duckdb_v2_copy_from_exec_get_output_chunk +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_exec_get_user_data duckdb_ext_api.duckdb_v2_copy_from_exec_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_init_global_get_bind_data duckdb_ext_api.duckdb_v2_copy_from_init_global_get_bind_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_init_global_get_user_data duckdb_ext_api.duckdb_v2_copy_from_init_global_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_init_global_set_global_state duckdb_ext_api.duckdb_v2_copy_from_init_global_set_global_state +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_init_global_set_max_threads duckdb_ext_api.duckdb_v2_copy_from_init_global_set_max_threads +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_init_local_get_bind_data duckdb_ext_api.duckdb_v2_copy_from_init_local_get_bind_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_init_local_get_global_state duckdb_ext_api.duckdb_v2_copy_from_init_local_get_global_state +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_init_local_get_user_data duckdb_ext_api.duckdb_v2_copy_from_init_local_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_init_local_set_local_state duckdb_ext_api.duckdb_v2_copy_from_init_local_set_local_state +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_progress_get_bind_data duckdb_ext_api.duckdb_v2_copy_from_progress_get_bind_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_progress_get_global_state duckdb_ext_api.duckdb_v2_copy_from_progress_get_global_state +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_progress_get_user_data duckdb_ext_api.duckdb_v2_copy_from_progress_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_progress_set_progress duckdb_ext_api.duckdb_v2_copy_from_progress_set_progress +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_set_bind_callback duckdb_ext_api.duckdb_v2_copy_from_set_bind_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_set_exec_callback duckdb_ext_api.duckdb_v2_copy_from_set_exec_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_set_init_global_callback duckdb_ext_api.duckdb_v2_copy_from_set_init_global_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_set_init_local_callback duckdb_ext_api.duckdb_v2_copy_from_set_init_local_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_from_set_progress_callback duckdb_ext_api.duckdb_v2_copy_from_set_progress_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_function_create duckdb_ext_api.duckdb_v2_copy_function_create +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_function_destroy duckdb_ext_api.duckdb_v2_copy_function_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_function_set_name duckdb_ext_api.duckdb_v2_copy_function_set_name +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_function_set_user_data duckdb_ext_api.duckdb_v2_copy_function_set_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_batch_get_bind_data duckdb_ext_api.duckdb_v2_copy_to_batch_get_bind_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_batch_get_init_data duckdb_ext_api.duckdb_v2_copy_to_batch_get_init_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_batch_get_user_data duckdb_ext_api.duckdb_v2_copy_to_batch_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_batch_set_batch_data duckdb_ext_api.duckdb_v2_copy_to_batch_set_batch_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_batch_size_get_bind_data duckdb_ext_api.duckdb_v2_copy_to_batch_size_get_bind_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_batch_size_get_user_data duckdb_ext_api.duckdb_v2_copy_to_batch_size_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_batch_size_set_target duckdb_ext_api.duckdb_v2_copy_to_batch_size_set_target +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_batch_take_input duckdb_ext_api.duckdb_v2_copy_to_batch_take_input +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_bind_get_column_count duckdb_ext_api.duckdb_v2_copy_to_bind_get_column_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_bind_get_column_name duckdb_ext_api.duckdb_v2_copy_to_bind_get_column_name +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_bind_get_column_type duckdb_ext_api.duckdb_v2_copy_to_bind_get_column_type +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_bind_get_file_path duckdb_ext_api.duckdb_v2_copy_to_bind_get_file_path +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_bind_get_option_count duckdb_ext_api.duckdb_v2_copy_to_bind_get_option_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_bind_get_option_name duckdb_ext_api.duckdb_v2_copy_to_bind_get_option_name +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_bind_get_option_value duckdb_ext_api.duckdb_v2_copy_to_bind_get_option_value +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_bind_get_user_data duckdb_ext_api.duckdb_v2_copy_to_bind_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_bind_set_bind_data duckdb_ext_api.duckdb_v2_copy_to_bind_set_bind_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_finalize_get_bind_data duckdb_ext_api.duckdb_v2_copy_to_finalize_get_bind_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_finalize_get_init_data duckdb_ext_api.duckdb_v2_copy_to_finalize_get_init_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_finalize_get_user_data duckdb_ext_api.duckdb_v2_copy_to_finalize_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_flush_get_batch_data duckdb_ext_api.duckdb_v2_copy_to_flush_get_batch_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_flush_get_bind_data duckdb_ext_api.duckdb_v2_copy_to_flush_get_bind_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_flush_get_init_data duckdb_ext_api.duckdb_v2_copy_to_flush_get_init_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_flush_get_user_data duckdb_ext_api.duckdb_v2_copy_to_flush_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_init_get_bind_data duckdb_ext_api.duckdb_v2_copy_to_init_get_bind_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_init_get_file_path duckdb_ext_api.duckdb_v2_copy_to_init_get_file_path +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_init_get_user_data duckdb_ext_api.duckdb_v2_copy_to_init_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_init_set_init_data duckdb_ext_api.duckdb_v2_copy_to_init_set_init_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_set_batch_callback duckdb_ext_api.duckdb_v2_copy_to_set_batch_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_set_batch_size_callback duckdb_ext_api.duckdb_v2_copy_to_set_batch_size_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_set_bind_callback duckdb_ext_api.duckdb_v2_copy_to_set_bind_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_set_finalize_callback duckdb_ext_api.duckdb_v2_copy_to_set_finalize_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_set_flush_callback duckdb_ext_api.duckdb_v2_copy_to_set_flush_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_to_set_init_callback duckdb_ext_api.duckdb_v2_copy_to_set_init_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_expression_cast_get_mode duckdb_ext_api.duckdb_v2_expression_cast_get_mode +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_expression_column_ref_get_index duckdb_ext_api.duckdb_v2_expression_column_ref_get_index +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_expression_constant_get_value duckdb_ext_api.duckdb_v2_expression_constant_get_value +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_expression_function_get_name duckdb_ext_api.duckdb_v2_expression_function_get_name +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_expression_function_get_qname duckdb_ext_api.duckdb_v2_expression_function_get_qname +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_expression_get_child duckdb_ext_api.duckdb_v2_expression_get_child +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_expression_get_child_count duckdb_ext_api.duckdb_v2_expression_get_child_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_expression_get_return_type duckdb_ext_api.duckdb_v2_expression_get_return_type +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_expression_get_type duckdb_ext_api.duckdb_v2_expression_get_type +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_extension_register_copy_function duckdb_ext_api.duckdb_v2_extension_register_copy_function +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_identifier_render_quoted duckdb_ext_api.duckdb_v2_identifier_render_quoted +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_prepared_statement_create duckdb_ext_api.duckdb_v2_prepared_statement_create +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_prepared_statement_destroy duckdb_ext_api.duckdb_v2_prepared_statement_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_prepared_statement_execute duckdb_ext_api.duckdb_v2_prepared_statement_execute +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_prepared_statement_reuses_plan duckdb_ext_api.duckdb_v2_prepared_statement_reuses_plan +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_description_destroy duckdb_ext_api.duckdb_v2_table_description_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_description_get_column duckdb_ext_api.duckdb_v2_table_description_get_column +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_description_get_column_count duckdb_ext_api.duckdb_v2_table_description_get_column_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_description_get_qname duckdb_ext_api.duckdb_v2_table_description_get_qname +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_description_is_readonly duckdb_ext_api.duckdb_v2_table_description_is_readonly +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_exec_get_column_count duckdb_ext_api.duckdb_v2_table_function_exec_get_column_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_exec_get_column_index duckdb_ext_api.duckdb_v2_table_function_exec_get_column_index +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_filter_pushdown_accept duckdb_ext_api.duckdb_v2_table_function_filter_pushdown_accept +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_filter_pushdown_get_bind_data \ + duckdb_ext_api.duckdb_v2_table_function_filter_pushdown_get_bind_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_filter_pushdown_get_column_count \ + duckdb_ext_api.duckdb_v2_table_function_filter_pushdown_get_column_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_filter_pushdown_get_column_index \ + duckdb_ext_api.duckdb_v2_table_function_filter_pushdown_get_column_index +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_filter_pushdown_get_filter \ + duckdb_ext_api.duckdb_v2_table_function_filter_pushdown_get_filter +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_filter_pushdown_get_filter_count \ + duckdb_ext_api.duckdb_v2_table_function_filter_pushdown_get_filter_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_filter_pushdown_get_user_data \ + duckdb_ext_api.duckdb_v2_table_function_filter_pushdown_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_init_global_get_column_count \ + duckdb_ext_api.duckdb_v2_table_function_init_global_get_column_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_init_global_get_column_index \ + duckdb_ext_api.duckdb_v2_table_function_init_global_get_column_index +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_init_local_get_column_count \ + duckdb_ext_api.duckdb_v2_table_function_init_local_get_column_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_init_local_get_column_index \ + duckdb_ext_api.duckdb_v2_table_function_init_local_get_column_index +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_set_filter_pushdown_callback \ + duckdb_ext_api.duckdb_v2_table_function_set_filter_pushdown_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_table_function_set_projection_pushdown duckdb_ext_api.duckdb_v2_table_function_set_projection_pushdown -#define duckdb_v2_sql_statement_get_parameter_count duckdb_ext_api.duckdb_v2_sql_statement_get_parameter_count -#define duckdb_v2_sql_statement_get_parameter_name duckdb_ext_api.duckdb_v2_sql_statement_get_parameter_name -#define duckdb_v2_sql_statement_get_text duckdb_ext_api.duckdb_v2_sql_statement_get_text -#define duckdb_v2_sql_statement_get_type duckdb_ext_api.duckdb_v2_sql_statement_get_type -#define duckdb_v2_token_iterator_destroy duckdb_ext_api.duckdb_v2_token_iterator_destroy -#define duckdb_v2_token_iterator_ends_unterminated duckdb_ext_api.duckdb_v2_token_iterator_ends_unterminated -#define duckdb_v2_token_iterator_next duckdb_ext_api.duckdb_v2_token_iterator_next -#define duckdb_v2_tokenize_sql duckdb_ext_api.duckdb_v2_tokenize_sql -#define duckdb_v2_attach_options_create duckdb_ext_api.duckdb_v2_attach_options_create -#define duckdb_v2_attach_options_destroy duckdb_ext_api.duckdb_v2_attach_options_destroy -#define duckdb_v2_attach_options_set duckdb_ext_api.duckdb_v2_attach_options_set -#define duckdb_v2_instance_set_default duckdb_ext_api.duckdb_v2_instance_set_default +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_sql_statement_get_parameter_count duckdb_ext_api.duckdb_v2_sql_statement_get_parameter_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_sql_statement_get_parameter_name duckdb_ext_api.duckdb_v2_sql_statement_get_parameter_name +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_sql_statement_get_text duckdb_ext_api.duckdb_v2_sql_statement_get_text +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_sql_statement_get_type duckdb_ext_api.duckdb_v2_sql_statement_get_type +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_token_iterator_destroy duckdb_ext_api.duckdb_v2_token_iterator_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_token_iterator_ends_unterminated duckdb_ext_api.duckdb_v2_token_iterator_ends_unterminated +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_token_iterator_next duckdb_ext_api.duckdb_v2_token_iterator_next +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_tokenize_sql duckdb_ext_api.duckdb_v2_tokenize_sql +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_attach_options_create duckdb_ext_api.duckdb_v2_attach_options_create +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_attach_options_destroy duckdb_ext_api.duckdb_v2_attach_options_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_attach_options_set duckdb_ext_api.duckdb_v2_attach_options_set +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_instance_set_default duckdb_ext_api.duckdb_v2_instance_set_default +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_table_function_partition_data_get_bind_data \ duckdb_ext_api.duckdb_v2_table_function_partition_data_get_bind_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_table_function_partition_data_get_global_state \ duckdb_ext_api.duckdb_v2_table_function_partition_data_get_global_state +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_table_function_partition_data_get_local_state \ duckdb_ext_api.duckdb_v2_table_function_partition_data_get_local_state +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_table_function_partition_data_get_partition_column_count \ duckdb_ext_api.duckdb_v2_table_function_partition_data_get_partition_column_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_table_function_partition_data_get_partition_column_index \ duckdb_ext_api.duckdb_v2_table_function_partition_data_get_partition_column_index +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_table_function_partition_data_get_user_data \ duckdb_ext_api.duckdb_v2_table_function_partition_data_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_table_function_partition_data_requires_batch_index \ duckdb_ext_api.duckdb_v2_table_function_partition_data_requires_batch_index +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_table_function_partition_data_requires_partition_columns \ duckdb_ext_api.duckdb_v2_table_function_partition_data_requires_partition_columns +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_table_function_partition_data_set_batch_index \ duckdb_ext_api.duckdb_v2_table_function_partition_data_set_batch_index +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_table_function_partition_data_set_partition_value \ duckdb_ext_api.duckdb_v2_table_function_partition_data_set_partition_value +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_table_function_partitioning_get_bind_data \ duckdb_ext_api.duckdb_v2_table_function_partitioning_get_bind_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_table_function_partitioning_get_partition_column_count \ duckdb_ext_api.duckdb_v2_table_function_partitioning_get_partition_column_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_table_function_partitioning_get_partition_column_index \ duckdb_ext_api.duckdb_v2_table_function_partitioning_get_partition_column_index +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_table_function_partitioning_get_user_data \ duckdb_ext_api.duckdb_v2_table_function_partitioning_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_table_function_partitioning_set_partition_info \ duckdb_ext_api.duckdb_v2_table_function_partitioning_set_partition_info +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_table_function_set_partition_data_callback \ duckdb_ext_api.duckdb_v2_table_function_set_partition_data_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_table_function_set_partitioning_callback \ duckdb_ext_api.duckdb_v2_table_function_set_partitioning_callback -#define duckdb_v2_validate_utf8 duckdb_ext_api.duckdb_v2_validate_utf8 -#define duckdb_v2_function_bind_get_arg_count duckdb_ext_api.duckdb_v2_function_bind_get_arg_count -#define duckdb_v2_function_bind_get_arg_index duckdb_ext_api.duckdb_v2_function_bind_get_arg_index -#define duckdb_v2_function_bind_get_arg_name duckdb_ext_api.duckdb_v2_function_bind_get_arg_name -#define duckdb_v2_function_bind_get_arg_type duckdb_ext_api.duckdb_v2_function_bind_get_arg_type -#define duckdb_v2_function_bind_get_arg_value duckdb_ext_api.duckdb_v2_function_bind_get_arg_value -#define duckdb_v2_function_bind_get_user_data duckdb_ext_api.duckdb_v2_function_bind_get_user_data -#define duckdb_v2_function_bind_set_bind_data duckdb_ext_api.duckdb_v2_function_bind_set_bind_data -#define duckdb_v2_table_function_bind_set_order_preservation \ - duckdb_ext_api.duckdb_v2_table_function_bind_set_order_preservation -#define duckdb_v2_arrow_result_destroy duckdb_ext_api.duckdb_v2_arrow_result_destroy -#define duckdb_v2_arrow_result_drain duckdb_ext_api.duckdb_v2_arrow_result_drain -#define duckdb_v2_arrow_result_fetch_array duckdb_ext_api.duckdb_v2_arrow_result_fetch_array -#define duckdb_v2_arrow_result_get_result_type duckdb_ext_api.duckdb_v2_arrow_result_get_result_type -#define duckdb_v2_arrow_result_get_schema duckdb_ext_api.duckdb_v2_arrow_result_get_schema -#define duckdb_v2_arrow_result_get_statement_type duckdb_ext_api.duckdb_v2_arrow_result_get_statement_type -#define duckdb_v2_arrow_result_step duckdb_ext_api.duckdb_v2_arrow_result_step -#define duckdb_v2_arrow_result_to_arrow_c_stream duckdb_ext_api.duckdb_v2_arrow_result_to_arrow_c_stream -#define duckdb_v2_arrow_result_wait duckdb_ext_api.duckdb_v2_arrow_result_wait -#define duckdb_v2_prepared_statement_execute_arrow duckdb_ext_api.duckdb_v2_prepared_statement_execute_arrow -#define duckdb_v2_statement_execute_arrow duckdb_ext_api.duckdb_v2_statement_execute_arrow -#define duckdb_v2_scalar_function_resolve_types_set_return_type \ - duckdb_ext_api.duckdb_v2_scalar_function_resolve_types_set_return_type -#define duckdb_v2_scalar_function_set_resolve_types_callback \ - duckdb_ext_api.duckdb_v2_scalar_function_set_resolve_types_callback -#define duckdb_v2_connection_get_factory duckdb_ext_api.duckdb_v2_connection_get_factory -#define duckdb_v2_context_get_factory duckdb_ext_api.duckdb_v2_context_get_factory -#define duckdb_v2_instance_get_factory duckdb_ext_api.duckdb_v2_instance_get_factory -#define duckdb_v2_scalar_function_bind_set_bind_data duckdb_ext_api.duckdb_v2_scalar_function_bind_set_bind_data -#define duckdb_v2_config_get_option_value duckdb_ext_api.duckdb_v2_config_get_option_value -#define duckdb_v2_config_set_option_text duckdb_ext_api.duckdb_v2_config_set_option_text -#define duckdb_v2_config_set_option_value duckdb_ext_api.duckdb_v2_config_set_option_value -#define duckdb_v2_connection_get_config duckdb_ext_api.duckdb_v2_connection_get_config -#define duckdb_v2_connection_get_file_system duckdb_ext_api.duckdb_v2_connection_get_file_system -#define duckdb_v2_connection_log duckdb_ext_api.duckdb_v2_connection_log -#define duckdb_v2_context_get_config duckdb_ext_api.duckdb_v2_context_get_config -#define duckdb_v2_instance_get_config duckdb_ext_api.duckdb_v2_instance_get_config -#define duckdb_v2_instance_get_file_system duckdb_ext_api.duckdb_v2_instance_get_file_system -#define duckdb_v2_instance_log duckdb_ext_api.duckdb_v2_instance_log -#define duckdb_v2_option_get_default_scope duckdb_ext_api.duckdb_v2_option_get_default_scope -#define duckdb_v2_option_supports_scope duckdb_ext_api.duckdb_v2_option_supports_scope -#define duckdb_v2_aggregate_function_get_docs duckdb_ext_api.duckdb_v2_aggregate_function_get_docs -#define duckdb_v2_connection_register_pragma_function duckdb_ext_api.duckdb_v2_connection_register_pragma_function -#define duckdb_v2_extension_register_pragma_function duckdb_ext_api.duckdb_v2_extension_register_pragma_function -#define duckdb_v2_function_docs_add_category duckdb_ext_api.duckdb_v2_function_docs_add_category -#define duckdb_v2_function_docs_add_example duckdb_ext_api.duckdb_v2_function_docs_add_example -#define duckdb_v2_function_docs_set_description duckdb_ext_api.duckdb_v2_function_docs_set_description -#define duckdb_v2_pragma_function_create duckdb_ext_api.duckdb_v2_pragma_function_create -#define duckdb_v2_pragma_function_destroy duckdb_ext_api.duckdb_v2_pragma_function_destroy -#define duckdb_v2_pragma_function_get_docs duckdb_ext_api.duckdb_v2_pragma_function_get_docs -#define duckdb_v2_pragma_function_get_signature duckdb_ext_api.duckdb_v2_pragma_function_get_signature -#define duckdb_v2_pragma_function_query_set_query duckdb_ext_api.duckdb_v2_pragma_function_query_set_query -#define duckdb_v2_pragma_function_set_exec_callback duckdb_ext_api.duckdb_v2_pragma_function_set_exec_callback -#define duckdb_v2_pragma_function_set_name duckdb_ext_api.duckdb_v2_pragma_function_set_name -#define duckdb_v2_pragma_function_set_query_callback duckdb_ext_api.duckdb_v2_pragma_function_set_query_callback -#define duckdb_v2_pragma_function_set_user_data duckdb_ext_api.duckdb_v2_pragma_function_set_user_data -#define duckdb_v2_scalar_function_get_docs duckdb_ext_api.duckdb_v2_scalar_function_get_docs -#define duckdb_v2_table_function_get_docs duckdb_ext_api.duckdb_v2_table_function_get_docs -#define duckdb_v2_connection_register_custom_option duckdb_ext_api.duckdb_v2_connection_register_custom_option -#define duckdb_v2_custom_option_create duckdb_ext_api.duckdb_v2_custom_option_create -#define duckdb_v2_custom_option_destroy duckdb_ext_api.duckdb_v2_custom_option_destroy -#define duckdb_v2_custom_option_set_default_scope duckdb_ext_api.duckdb_v2_custom_option_set_default_scope -#define duckdb_v2_custom_option_set_default_value duckdb_ext_api.duckdb_v2_custom_option_set_default_value -#define duckdb_v2_custom_option_set_description duckdb_ext_api.duckdb_v2_custom_option_set_description -#define duckdb_v2_custom_option_set_name duckdb_ext_api.duckdb_v2_custom_option_set_name -#define duckdb_v2_custom_option_set_supports_scope duckdb_ext_api.duckdb_v2_custom_option_set_supports_scope -#define duckdb_v2_custom_option_set_type duckdb_ext_api.duckdb_v2_custom_option_set_type -#define duckdb_v2_custom_option_set_update_callback duckdb_ext_api.duckdb_v2_custom_option_set_update_callback -#define duckdb_v2_custom_option_set_user_data duckdb_ext_api.duckdb_v2_custom_option_set_user_data -#define duckdb_v2_custom_option_update_get_scope duckdb_ext_api.duckdb_v2_custom_option_update_get_scope -#define duckdb_v2_custom_option_update_get_user_data duckdb_ext_api.duckdb_v2_custom_option_update_get_user_data -#define duckdb_v2_custom_option_update_get_value duckdb_ext_api.duckdb_v2_custom_option_update_get_value -#define duckdb_v2_custom_option_update_is_reset duckdb_ext_api.duckdb_v2_custom_option_update_is_reset -#define duckdb_v2_custom_option_update_set_value duckdb_ext_api.duckdb_v2_custom_option_update_set_value -#define duckdb_v2_extension_register_custom_option duckdb_ext_api.duckdb_v2_extension_register_custom_option -#define duckdb_v2_extension_register_log_sink duckdb_ext_api.duckdb_v2_extension_register_log_sink -#define duckdb_v2_extension_register_macro_function duckdb_ext_api.duckdb_v2_extension_register_macro_function -#define duckdb_v2_file_system_path_exists duckdb_ext_api.duckdb_v2_file_system_path_exists -#define duckdb_v2_file_system_path_expand duckdb_ext_api.duckdb_v2_file_system_path_expand -#define duckdb_v2_file_system_path_is_remote duckdb_ext_api.duckdb_v2_file_system_path_is_remote -#define duckdb_v2_instance_register_log_sink duckdb_ext_api.duckdb_v2_instance_register_log_sink -#define duckdb_v2_log_sink_create duckdb_ext_api.duckdb_v2_log_sink_create -#define duckdb_v2_log_sink_destroy duckdb_ext_api.duckdb_v2_log_sink_destroy -#define duckdb_v2_log_sink_set_flush_callback duckdb_ext_api.duckdb_v2_log_sink_set_flush_callback -#define duckdb_v2_log_sink_set_name duckdb_ext_api.duckdb_v2_log_sink_set_name -#define duckdb_v2_log_sink_set_user_data duckdb_ext_api.duckdb_v2_log_sink_set_user_data -#define duckdb_v2_log_sink_set_write_callback duckdb_ext_api.duckdb_v2_log_sink_set_write_callback -#define duckdb_v2_log_sink_write_info_get_connection_id duckdb_ext_api.duckdb_v2_log_sink_write_info_get_connection_id -#define duckdb_v2_log_sink_write_info_get_query_id duckdb_ext_api.duckdb_v2_log_sink_write_info_get_query_id -#define duckdb_v2_log_sink_write_info_get_thread_id duckdb_ext_api.duckdb_v2_log_sink_write_info_get_thread_id -#define duckdb_v2_log_sink_write_info_get_transaction_id duckdb_ext_api.duckdb_v2_log_sink_write_info_get_transaction_id -#define duckdb_v2_macro_function_create duckdb_ext_api.duckdb_v2_macro_function_create -#define duckdb_v2_macro_function_destroy duckdb_ext_api.duckdb_v2_macro_function_destroy -#define duckdb_v2_macro_function_get_docs duckdb_ext_api.duckdb_v2_macro_function_get_docs -#define duckdb_v2_macro_function_get_signature duckdb_ext_api.duckdb_v2_macro_function_get_signature -#define duckdb_v2_macro_function_set_body duckdb_ext_api.duckdb_v2_macro_function_set_body -#define duckdb_v2_macro_function_set_name duckdb_ext_api.duckdb_v2_macro_function_set_name -#define duckdb_v2_vector_cast duckdb_ext_api.duckdb_v2_vector_cast -#define duckdb_v2_copy_function_set_file_extension duckdb_ext_api.duckdb_v2_copy_function_set_file_extension -#define duckdb_v2_data_chunk_clear duckdb_ext_api.duckdb_v2_data_chunk_clear -#define duckdb_v2_file_system_path_glob duckdb_ext_api.duckdb_v2_file_system_path_glob -#define duckdb_v2_file_system_path_move duckdb_ext_api.duckdb_v2_file_system_path_move -#define duckdb_v2_file_system_path_remove duckdb_ext_api.duckdb_v2_file_system_path_remove -#define duckdb_v2_statement_add_collection duckdb_ext_api.duckdb_v2_statement_add_collection +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_validate_utf8 duckdb_ext_api.duckdb_v2_validate_utf8 +#endif #if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_connection_register_multi_file_function \ duckdb_ext_api.duckdb_v2_connection_register_multi_file_function @@ -2195,6 +3087,72 @@ typedef struct { duckdb_ext_api.duckdb_v2_table_function_set_claim_batch_callback #endif #if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_function_bind_get_arg_count duckdb_ext_api.duckdb_v2_function_bind_get_arg_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_function_bind_get_arg_index duckdb_ext_api.duckdb_v2_function_bind_get_arg_index +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_function_bind_get_arg_name duckdb_ext_api.duckdb_v2_function_bind_get_arg_name +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_function_bind_get_arg_type duckdb_ext_api.duckdb_v2_function_bind_get_arg_type +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_function_bind_get_arg_value duckdb_ext_api.duckdb_v2_function_bind_get_arg_value +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_function_bind_get_user_data duckdb_ext_api.duckdb_v2_function_bind_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_function_bind_set_bind_data duckdb_ext_api.duckdb_v2_function_bind_set_bind_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_bind_set_order_preservation \ + duckdb_ext_api.duckdb_v2_table_function_bind_set_order_preservation +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_arrow_result_destroy duckdb_ext_api.duckdb_v2_arrow_result_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_arrow_result_drain duckdb_ext_api.duckdb_v2_arrow_result_drain +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_arrow_result_fetch_array duckdb_ext_api.duckdb_v2_arrow_result_fetch_array +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_arrow_result_get_result_type duckdb_ext_api.duckdb_v2_arrow_result_get_result_type +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_arrow_result_get_schema duckdb_ext_api.duckdb_v2_arrow_result_get_schema +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_arrow_result_get_statement_type duckdb_ext_api.duckdb_v2_arrow_result_get_statement_type +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_arrow_result_step duckdb_ext_api.duckdb_v2_arrow_result_step +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_arrow_result_to_arrow_c_stream duckdb_ext_api.duckdb_v2_arrow_result_to_arrow_c_stream +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_arrow_result_wait duckdb_ext_api.duckdb_v2_arrow_result_wait +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_prepared_statement_execute_arrow duckdb_ext_api.duckdb_v2_prepared_statement_execute_arrow +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_statement_execute_arrow duckdb_ext_api.duckdb_v2_statement_execute_arrow +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_scalar_function_resolve_types_set_return_type \ + duckdb_ext_api.duckdb_v2_scalar_function_resolve_types_set_return_type +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_scalar_function_set_resolve_types_callback \ + duckdb_ext_api.duckdb_v2_scalar_function_set_resolve_types_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_table_function_get_bind_info_get_bind_data \ duckdb_ext_api.duckdb_v2_table_function_get_bind_info_get_bind_data #endif @@ -2215,8 +3173,278 @@ typedef struct { duckdb_ext_api.duckdb_v2_table_function_set_get_bind_info_callback #endif #if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_connection_get_factory duckdb_ext_api.duckdb_v2_connection_get_factory +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_context_get_factory duckdb_ext_api.duckdb_v2_context_get_factory +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_instance_get_factory duckdb_ext_api.duckdb_v2_instance_get_factory +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_scalar_function_bind_set_bind_data duckdb_ext_api.duckdb_v2_scalar_function_bind_set_bind_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_config_get_option_value duckdb_ext_api.duckdb_v2_config_get_option_value +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_config_set_option_text duckdb_ext_api.duckdb_v2_config_set_option_text +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_config_set_option_value duckdb_ext_api.duckdb_v2_config_set_option_value +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_connection_get_config duckdb_ext_api.duckdb_v2_connection_get_config +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_connection_get_file_system duckdb_ext_api.duckdb_v2_connection_get_file_system +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_connection_log duckdb_ext_api.duckdb_v2_connection_log +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_context_get_config duckdb_ext_api.duckdb_v2_context_get_config +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_instance_get_config duckdb_ext_api.duckdb_v2_instance_get_config +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_instance_get_file_system duckdb_ext_api.duckdb_v2_instance_get_file_system +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_instance_log duckdb_ext_api.duckdb_v2_instance_log +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_option_get_default_scope duckdb_ext_api.duckdb_v2_option_get_default_scope +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_option_supports_scope duckdb_ext_api.duckdb_v2_option_supports_scope +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_aggregate_function_get_docs duckdb_ext_api.duckdb_v2_aggregate_function_get_docs +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_connection_register_pragma_function duckdb_ext_api.duckdb_v2_connection_register_pragma_function +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_extension_register_pragma_function duckdb_ext_api.duckdb_v2_extension_register_pragma_function +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE #define duckdb_v2_factory_create_common_type duckdb_ext_api.duckdb_v2_factory_create_common_type #endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_function_docs_add_category duckdb_ext_api.duckdb_v2_function_docs_add_category +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_function_docs_add_example duckdb_ext_api.duckdb_v2_function_docs_add_example +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_function_docs_set_description duckdb_ext_api.duckdb_v2_function_docs_set_description +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_pragma_function_create duckdb_ext_api.duckdb_v2_pragma_function_create +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_pragma_function_destroy duckdb_ext_api.duckdb_v2_pragma_function_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_pragma_function_get_docs duckdb_ext_api.duckdb_v2_pragma_function_get_docs +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_pragma_function_get_signature duckdb_ext_api.duckdb_v2_pragma_function_get_signature +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_pragma_function_query_set_query duckdb_ext_api.duckdb_v2_pragma_function_query_set_query +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_pragma_function_set_exec_callback duckdb_ext_api.duckdb_v2_pragma_function_set_exec_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_pragma_function_set_name duckdb_ext_api.duckdb_v2_pragma_function_set_name +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_pragma_function_set_query_callback duckdb_ext_api.duckdb_v2_pragma_function_set_query_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_pragma_function_set_user_data duckdb_ext_api.duckdb_v2_pragma_function_set_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_scalar_function_get_docs duckdb_ext_api.duckdb_v2_scalar_function_get_docs +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_table_function_get_docs duckdb_ext_api.duckdb_v2_table_function_get_docs +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_connection_register_custom_option duckdb_ext_api.duckdb_v2_connection_register_custom_option +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_custom_option_create duckdb_ext_api.duckdb_v2_custom_option_create +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_custom_option_destroy duckdb_ext_api.duckdb_v2_custom_option_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_custom_option_set_default_scope duckdb_ext_api.duckdb_v2_custom_option_set_default_scope +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_custom_option_set_default_value duckdb_ext_api.duckdb_v2_custom_option_set_default_value +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_custom_option_set_description duckdb_ext_api.duckdb_v2_custom_option_set_description +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_custom_option_set_name duckdb_ext_api.duckdb_v2_custom_option_set_name +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_custom_option_set_supports_scope duckdb_ext_api.duckdb_v2_custom_option_set_supports_scope +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_custom_option_set_type duckdb_ext_api.duckdb_v2_custom_option_set_type +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_custom_option_set_update_callback duckdb_ext_api.duckdb_v2_custom_option_set_update_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_custom_option_set_user_data duckdb_ext_api.duckdb_v2_custom_option_set_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_custom_option_update_get_scope duckdb_ext_api.duckdb_v2_custom_option_update_get_scope +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_custom_option_update_get_user_data duckdb_ext_api.duckdb_v2_custom_option_update_get_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_custom_option_update_get_value duckdb_ext_api.duckdb_v2_custom_option_update_get_value +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_custom_option_update_is_reset duckdb_ext_api.duckdb_v2_custom_option_update_is_reset +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_custom_option_update_set_value duckdb_ext_api.duckdb_v2_custom_option_update_set_value +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_extension_register_custom_option duckdb_ext_api.duckdb_v2_extension_register_custom_option +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_extension_register_log_sink duckdb_ext_api.duckdb_v2_extension_register_log_sink +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_extension_register_macro_function duckdb_ext_api.duckdb_v2_extension_register_macro_function +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_file_system_path_exists duckdb_ext_api.duckdb_v2_file_system_path_exists +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_file_system_path_expand duckdb_ext_api.duckdb_v2_file_system_path_expand +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_file_system_path_is_remote duckdb_ext_api.duckdb_v2_file_system_path_is_remote +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_instance_register_log_sink duckdb_ext_api.duckdb_v2_instance_register_log_sink +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_log_sink_create duckdb_ext_api.duckdb_v2_log_sink_create +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_log_sink_destroy duckdb_ext_api.duckdb_v2_log_sink_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_log_sink_set_flush_callback duckdb_ext_api.duckdb_v2_log_sink_set_flush_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_log_sink_set_name duckdb_ext_api.duckdb_v2_log_sink_set_name +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_log_sink_set_user_data duckdb_ext_api.duckdb_v2_log_sink_set_user_data +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_log_sink_set_write_callback duckdb_ext_api.duckdb_v2_log_sink_set_write_callback +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_log_sink_write_info_get_connection_id duckdb_ext_api.duckdb_v2_log_sink_write_info_get_connection_id +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_log_sink_write_info_get_query_id duckdb_ext_api.duckdb_v2_log_sink_write_info_get_query_id +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_log_sink_write_info_get_thread_id duckdb_ext_api.duckdb_v2_log_sink_write_info_get_thread_id +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_log_sink_write_info_get_transaction_id duckdb_ext_api.duckdb_v2_log_sink_write_info_get_transaction_id +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_macro_function_create duckdb_ext_api.duckdb_v2_macro_function_create +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_macro_function_destroy duckdb_ext_api.duckdb_v2_macro_function_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_macro_function_get_docs duckdb_ext_api.duckdb_v2_macro_function_get_docs +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_macro_function_get_signature duckdb_ext_api.duckdb_v2_macro_function_get_signature +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_macro_function_set_body duckdb_ext_api.duckdb_v2_macro_function_set_body +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_macro_function_set_name duckdb_ext_api.duckdb_v2_macro_function_set_name +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_vector_cast duckdb_ext_api.duckdb_v2_vector_cast +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_connection_enable_profiling duckdb_ext_api.duckdb_v2_connection_enable_profiling +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_connection_get_query_metrics duckdb_ext_api.duckdb_v2_connection_get_query_metrics +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_copy_function_set_file_extension duckdb_ext_api.duckdb_v2_copy_function_set_file_extension +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_data_chunk_clear duckdb_ext_api.duckdb_v2_data_chunk_clear +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_file_system_path_glob duckdb_ext_api.duckdb_v2_file_system_path_glob +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_file_system_path_move duckdb_ext_api.duckdb_v2_file_system_path_move +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_file_system_path_remove duckdb_ext_api.duckdb_v2_file_system_path_remove +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_query_metrics_destroy duckdb_ext_api.duckdb_v2_query_metrics_destroy +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_query_metrics_get_root duckdb_ext_api.duckdb_v2_query_metrics_get_root +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_query_metrics_node_get_child duckdb_ext_api.duckdb_v2_query_metrics_node_get_child +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_query_metrics_node_get_child_count duckdb_ext_api.duckdb_v2_query_metrics_node_get_child_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_query_metrics_node_get_metric duckdb_ext_api.duckdb_v2_query_metrics_node_get_metric +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_query_metrics_node_get_metric_count duckdb_ext_api.duckdb_v2_query_metrics_node_get_metric_count +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_query_metrics_node_get_metric_name duckdb_ext_api.duckdb_v2_query_metrics_node_get_metric_name +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_query_metrics_node_get_metric_value duckdb_ext_api.duckdb_v2_query_metrics_node_get_metric_value +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_query_metrics_node_get_name duckdb_ext_api.duckdb_v2_query_metrics_node_get_name +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE +#define duckdb_v2_statement_add_collection duckdb_ext_api.duckdb_v2_statement_add_collection +#endif // capigen:end appended #endif // DUCKDB_BUILD_STATIC_EXTENSION diff --git a/src/duckdb/src/include/duckdb_v2.h b/src/duckdb/src/include/duckdb_v2.h index 2cede3650..c36fe3ac3 100644 --- a/src/duckdb/src/include/duckdb_v2.h +++ b/src/duckdb/src/include/duckdb_v2.h @@ -802,6 +802,7 @@ typedef enum DUCKDB_V2_FUNCTION_PROPERTY_VALUE { /* --- Functions for arena --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Allocate `byte_len` bytes from the arena. * @@ -811,7 +812,7 @@ typedef enum DUCKDB_V2_FUNCTION_PROPERTY_VALUE { * pointer themselves. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param arena The arena to allocate from. * @param byte_len Number of bytes to reserve. May be 0. @@ -821,6 +822,7 @@ typedef enum DUCKDB_V2_FUNCTION_PROPERTY_VALUE { */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arena_allocate(duckdb_v2_arena_handle arena, idx_t byte_len, uint8_t **out_ptr, duckdb_v2_error_info_handle *err); +#endif /* --- Struct definitions for arena --- */ @@ -882,6 +884,7 @@ typedef void (*duckdb_v2_cast_function_exec_callback_fn)(duckdb_v2_cast_function /* --- Functions for cast --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a new cast function through a factory. * @@ -894,7 +897,7 @@ typedef void (*duckdb_v2_cast_function_exec_callback_fn)(duckdb_v2_cast_function * The cast function can only be registered on the database the factory belongs to. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create the cast function through. * @param function On success, receives the newly created cast function. Owned by the caller. @@ -905,7 +908,9 @@ typedef void (*duckdb_v2_cast_function_exec_callback_fn)(duckdb_v2_cast_function DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_create(duckdb_v2_factory_handle factory, duckdb_v2_cast_function_handle *function, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the type the cast converts from. * @@ -913,7 +918,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_create(duckdb_v2_factory_ha * before registration, and it must be a fully defined concrete type. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the source type of. * @param source_type The type to cast from. Borrowed for the call only. @@ -924,7 +929,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_create(duckdb_v2_factory_ha DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_set_source_type(duckdb_v2_cast_function_handle function, duckdb_v2_logical_type_handle source_type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the type the cast converts to. * @@ -932,7 +939,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_set_source_type(duckdb_v2_c * before registration, and it must be a fully defined concrete type. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the target type of. * @param target_type The type to cast to. Borrowed for the call only. @@ -943,7 +950,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_set_source_type(duckdb_v2_c DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_set_target_type(duckdb_v2_cast_function_handle function, duckdb_v2_logical_type_handle target_type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets what it costs to apply this cast implicitly. * @@ -953,7 +962,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_set_target_type(duckdb_v2_c * reached only through an explicit CAST or TRY_CAST. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the implicit cast cost of. * @param cost The cost. Negative disables implicit casting. @@ -964,7 +973,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_set_target_type(duckdb_v2_c DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_set_implicit_cast_cost(duckdb_v2_cast_function_handle function, int64_t cost, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets arbitrary user data on the cast function. * @@ -974,7 +985,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_set_implicit_cast_cost(duck * every thread running the cast. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the user data of. * @param data Opaque handle bundling the user data pointer plus an optional destructor. @@ -985,7 +996,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_set_implicit_cast_cost(duck DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_set_user_data(duckdb_v2_cast_function_handle function, duckdb_v2_opaque *data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the exec callback of the cast function. * @@ -993,7 +1006,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_set_user_data(duckdb_v2_cas * must fill the output vector. An exec callback must be set before registration. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the exec callback of. * @param callback The exec callback to set. @@ -1004,12 +1017,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_set_user_data(duckdb_v2_cas DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_set_exec_callback( duckdb_v2_cast_function_handle function, duckdb_v2_cast_function_exec_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_cast_function_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The exec info handle. * @param data Receives the user data pointer, or null if none was set. @@ -1019,7 +1034,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_set_exec_callback( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_exec_get_user_data(duckdb_v2_cast_function_exec_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns how many rows this execution must convert. * @@ -1028,7 +1045,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_exec_get_user_data(duckdb_v * expanded by the engine. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The exec info handle. * @param count Receives the number of rows. @@ -1038,7 +1055,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_exec_get_user_data(duckdb_v */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_exec_get_row_count(duckdb_v2_cast_function_exec_info_handle info, idx_t *count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the input vector holding the values to convert. * @@ -1046,7 +1065,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_exec_get_row_count(duckdb_v * for the number of rows. Borrowed; valid only for the duration of the callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The exec info handle. * @param vector Receives the borrowed input vector. @@ -1057,7 +1076,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_exec_get_row_count(duckdb_v DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_exec_get_input(duckdb_v2_cast_function_exec_info_handle info, duckdb_v2_vector_handle *vector, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the output vector the exec callback must write into. * @@ -1065,7 +1086,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_exec_get_input(duckdb_v2_ca * rows. Borrowed; valid only for the duration of the callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The exec info handle. * @param vector Receives the borrowed output vector to write into. @@ -1076,7 +1097,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_exec_get_input(duckdb_v2_ca DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_exec_get_output(duckdb_v2_cast_function_exec_info_handle info, duckdb_v2_vector_handle *vector, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the mode the cast is being executed in. * @@ -1084,7 +1107,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_exec_get_output(duckdb_v2_c * through the error slot, since the engine discards the error and keeps whatever the callback left in the output. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The exec info handle. * @param mode Receives the cast mode. @@ -1095,7 +1118,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_exec_get_output(duckdb_v2_c DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_exec_get_mode(duckdb_v2_cast_function_exec_info_handle info, DUCKDB_V2_CAST_MODE *mode, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Registers the cast function, making it available to CAST and TRY_CAST. * @@ -1107,7 +1132,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_exec_get_mode(duckdb_v2_cas * affect the registered function. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param conn The connection to register on. * @param function The cast function to register. @@ -1118,7 +1143,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_exec_get_mode(duckdb_v2_cas DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_register_cast_function(duckdb_v2_connection_handle conn, duckdb_v2_cast_function_handle function, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Registers the cast function, making it available to CAST and TRY_CAST. * @@ -1129,7 +1156,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_register_cast_function(duckdb_ * `duckdb_v2_cast_function_destroy()`, which does not affect the registered function. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param extension The loading extension. * @param function The cast function to register. @@ -1140,7 +1167,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_register_cast_function(duckdb_ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_extension_register_cast_function(duckdb_v2_extension_handle extension, duckdb_v2_cast_function_handle function, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys the cast function, releasing its resources. * @@ -1148,12 +1177,13 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_extension_register_cast_function(duckdb_v * double-destruction. Destroying the handle after registration does not affect the registered function. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_cast_function_destroy(duckdb_v2_cast_function_handle *function); +#endif /* --- Struct definitions for cast --- */ @@ -1214,6 +1244,7 @@ typedef struct _duckdb_v2_column_data_collection_append_state { /* --- Functions for column_data_collection --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates an empty column data collection from a factory. * @@ -1222,7 +1253,7 @@ typedef struct _duckdb_v2_column_data_collection_append_state { * array is rejected with INVALID_INPUT. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param types_array Pointer to an array of logical_type handles, one per column. This defines the schema for the @@ -1236,7 +1267,9 @@ typedef struct _duckdb_v2_column_data_collection_append_state { DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_create( duckdb_v2_factory_handle factory, const duckdb_v2_logical_type_handle *types_array, idx_t types_count, duckdb_v2_column_data_collection_handle *out_collection, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Drops all buffered rows, keeping the column types. * @@ -1245,7 +1278,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_create( * instead to keep the memory for the next appends. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param collection The collection to reset. * @param err Optional. On failure, receives an opaque info handle the caller must destroy via error_info_destroy. @@ -1253,7 +1286,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_create( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_reset(duckdb_v2_column_data_collection_handle collection, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Drops all buffered rows, keeping the column types and the memory. * @@ -1263,7 +1298,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_reset(duckdb_v2_co * invalidated. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param collection The collection to clear. * @param err Optional. On failure, receives an opaque info handle the caller must destroy via error_info_destroy. @@ -1271,7 +1306,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_reset(duckdb_v2_co */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_clear(duckdb_v2_column_data_collection_handle collection, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys a column data collection and all its chunks. * @@ -1279,14 +1316,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_clear(duckdb_v2_co * handle to NULL. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param collection The collection to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_destroy(duckdb_v2_column_data_collection_handle *collection); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Merges the source collection into the target collection, consuming the source in the process. * @@ -1296,7 +1335,7 @@ duckdb_v2_column_data_collection_destroy(duckdb_v2_column_data_collection_handle * from different databases would tie the target to a buffer manager it does not own. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param target The collection to merge into. After the call, this collection will contain all chunks from both * collections. @@ -1308,7 +1347,9 @@ duckdb_v2_column_data_collection_destroy(duckdb_v2_column_data_collection_handle DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_combine(duckdb_v2_column_data_collection_handle target, duckdb_v2_column_data_collection_handle *source, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the total number of rows across all chunks in the collection. * @@ -1316,7 +1357,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_combine(duckdb_v2_ * which may be more than the number of rows in any individual chunk. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param collection The collection to inspect. * @param out_row_count Receives the total row count. @@ -1325,7 +1366,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_combine(duckdb_v2_ */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_row_count( duckdb_v2_column_data_collection_handle collection, idx_t *out_row_count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Initializes an append state for the collection. * @@ -1333,7 +1376,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_row_count( * state across calls. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param collection The collection to prepare for appending. * @param out_state Receives the new append state handle. @@ -1343,21 +1386,25 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_row_count( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_append_state_create( duckdb_v2_column_data_collection_handle collection, duckdb_v2_column_data_collection_append_state_handle *out_state, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys an append state handle. * * Cleans up any resources associated with the append state. After this call, the state handle must not be used again. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param state The append state to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_append_state_destroy(duckdb_v2_column_data_collection_append_state_handle *state); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Appends a data chunk to the collection. * @@ -1367,7 +1414,7 @@ duckdb_v2_column_data_collection_append_state_destroy(duckdb_v2_column_data_coll * the copy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param collection The collection to append to. * @param state The append state to use this append operation. @@ -1378,7 +1425,9 @@ duckdb_v2_column_data_collection_append_state_destroy(duckdb_v2_column_data_coll DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_append( duckdb_v2_column_data_collection_handle collection, duckdb_v2_column_data_collection_append_state_handle state, duckdb_v2_data_chunk_handle chunk, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Initializes a shared scan state for the collection. * @@ -1386,7 +1435,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_append( * Caller owns the returned state and must destroy it via column_data_collection_shared_scan_state_destroy when done. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param collection The collection to prepare for shared scanning. * @param out_state Receives the new shared scan state handle. @@ -1396,7 +1445,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_append( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_shared_scan_state_create( duckdb_v2_column_data_collection_handle collection, duckdb_v2_column_data_collection_shared_scan_state_handle *out_state, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys a shared scan state handle. * @@ -1404,14 +1455,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_shared_scan_state_ * again. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param state The shared scan state to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_shared_scan_state_destroy( duckdb_v2_column_data_collection_shared_scan_state_handle *state); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Initializes a worker scan state for the collection. * @@ -1420,7 +1473,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_shared_scan_state_ * with other threads via the shared scan state. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param collection The collection to prepare for worker scanning. * @param out_state Receives the new worker scan state handle. @@ -1430,7 +1483,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_shared_scan_state_ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_worker_scan_state_create( duckdb_v2_column_data_collection_handle collection, duckdb_v2_column_data_collection_worker_scan_state_handle *out_state, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys a worker scan state handle. * @@ -1438,14 +1493,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_worker_scan_state_ * again. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param state The worker scan state to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_worker_scan_state_destroy( duckdb_v2_column_data_collection_worker_scan_state_handle *state); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Scans the collection to retrieve the next data chunk, using shared state for coordination across threads and * worker-local state for individual progress tracking. @@ -1460,7 +1517,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_worker_scan_state_ * it to another collection) before continuing the scan if it must outlive that window. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param collection The collection to scan. * @param shared_state The shared scan state to use for coordinating across threads. @@ -1476,6 +1533,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_data_collection_scan( duckdb_v2_column_data_collection_shared_scan_state_handle shared_state, duckdb_v2_column_data_collection_worker_scan_state_handle worker_state, duckdb_v2_data_chunk_handle out_chunk, bool *did_produce_chunk, duckdb_v2_error_info_handle *err); +#endif /* --- Struct definitions for column_data_collection --- */ @@ -1514,6 +1572,7 @@ typedef enum DUCKDB_V2_SETTING_SCOPE { /* --- Functions for configuration --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Borrows the config of an instance: the GLOBAL scope. * @@ -1522,7 +1581,7 @@ typedef enum DUCKDB_V2_SETTING_SCOPE { * The returned handle is borrowed: it is valid for as long as the instance is, and must not be destroyed. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param instance The instance. * @param out_config Receives the borrowed config. @@ -1533,7 +1592,9 @@ typedef enum DUCKDB_V2_SETTING_SCOPE { DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_get_config(duckdb_v2_instance_handle instance, duckdb_v2_config_handle *out_config, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Borrows the config of a connection. * @@ -1542,7 +1603,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_get_config(duckdb_v2_instance_ha * connection is, and must not be destroyed. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param conn The connection. * @param out_config Receives the borrowed config. @@ -1553,7 +1614,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_get_config(duckdb_v2_instance_ha DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_get_config(duckdb_v2_connection_handle conn, duckdb_v2_config_handle *out_config, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Borrows the config of a context. * @@ -1561,7 +1624,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_get_config(duckdb_v2_connectio * borrowed: it is valid for as long as the context is, and must not be destroyed. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param ctx The context. * @param out_config Receives the borrowed config. @@ -1572,7 +1635,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_get_config(duckdb_v2_connectio DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_context_get_config(duckdb_v2_context_handle ctx, duckdb_v2_config_handle *out_config, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Reads the effective value of an option in this config, and the scope it came from. * @@ -1580,7 +1645,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_context_get_config(duckdb_v2_context_hand * value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param config The config to read from. * @param name Option name (canonical or alias). @@ -1595,7 +1660,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_config_get_option_value(duckdb_v2_config_ duckdb_v2_value_handle *out_value, DUCKDB_V2_SETTING_SCOPE *out_scope, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Writes an option in this config. * @@ -1609,7 +1676,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_config_get_option_value(duckdb_v2_config_ * rejected: pass it to `duckdb_v2_instance_create_with_options()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param config The config to write to. * @param name Option name (canonical or alias). @@ -1624,7 +1691,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_config_set_option_value(duckdb_v2_config_ duckdb_v2_value_handle value, DUCKDB_V2_SETTING_SCOPE scope, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Writes an option in this config from text, the form SQL `SET` accepts. * @@ -1633,7 +1702,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_config_set_option_value(duckdb_v2_config_ * and errors are `duckdb_v2_config_set_option_value()`'s. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param config The config to write to. * @param name Option name (canonical or alias). @@ -1648,7 +1717,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_config_set_option_text(duckdb_v2_config_h const duckdb_v2_str *setting, DUCKDB_V2_SETTING_SCOPE scope, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Describes a config option registered on this config's instance, by name. * @@ -1658,7 +1729,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_config_set_option_text(duckdb_v2_config_h * loaded yet. The caller destroys the returned option. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param config The config whose instance registered the options. * @param name Option name (canonical or alias). @@ -1671,7 +1742,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_config_get_option_by_name(duckdb_v2_confi const duckdb_v2_identifier_t *name, duckdb_v2_option_handle *out_option, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the number of config options registered on this config's instance. * @@ -1679,7 +1752,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_config_get_option_by_name(duckdb_v2_confi * one is reachable through its canonical option's alias array. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param config The config whose instance registered the options. * @param out_count Receives the option count. @@ -1689,7 +1762,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_config_get_option_by_name(duckdb_v2_confi */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_config_get_option_count(duckdb_v2_config_handle config, idx_t *out_count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Describes the config option at the given index on this config's instance. * @@ -1698,7 +1773,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_config_get_option_count(duckdb_v2_config_ * the returned option. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param config The config whose instance registered the options. * @param index The option index, in [0, option_count). @@ -1710,7 +1785,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_config_get_option_count(duckdb_v2_config_ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_config_get_option_by_index(duckdb_v2_config_handle config, idx_t index, duckdb_v2_option_handle *out_option, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys an option descriptor. * @@ -1718,13 +1795,15 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_config_get_option_by_index(duckdb_v2_conf * slot. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param option The option handle to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_option_destroy(duckdb_v2_option_handle *option); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Borrows the option's canonical name. * @@ -1732,7 +1811,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_option_destroy(duckdb_v2_option_handle *o * `duckdb_v2_option_get_alias()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param option The option. * @param out_name Receives a borrowed view of the option name. Valid until the option is destroyed. @@ -1742,14 +1821,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_option_destroy(duckdb_v2_option_handle *o */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_option_get_name(duckdb_v2_option_handle option, duckdb_v2_identifier_t *out_name, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the option's static default, as a value of the option's type. * * A NULL value for an option whose declaration has no default. The caller destroys the returned value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param option The option. * @param out_value Receives the default value. @@ -1760,12 +1841,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_option_get_name(duckdb_v2_option_handle o DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_option_get_default_value(duckdb_v2_option_handle option, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Borrows the option's human-readable description. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param option The option. * @param out_description Receives a borrowed view of the description. Valid until the option is destroyed. @@ -1776,7 +1859,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_option_get_default_value(duckdb_v2_option DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_option_get_description(duckdb_v2_option_handle option, duckdb_v2_str *out_description, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Reports whether the option may be written at a scope. * @@ -1784,7 +1869,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_option_get_description(duckdb_v2_option_h * an unsupported scope returns ERROR_INPUT_INVALID. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param option The option. * @param scope The scope to ask about. @@ -1796,12 +1881,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_option_get_description(duckdb_v2_option_h DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_option_supports_scope(duckdb_v2_option_handle option, DUCKDB_V2_SETTING_SCOPE scope, bool *out_supported, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the scope a DEFAULT write of the option goes to: GLOBAL or SESSION. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param option The option. * @param out_scope Receives the default scope. @@ -1812,14 +1899,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_option_supports_scope(duckdb_v2_option_ha DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_option_get_default_scope(duckdb_v2_option_handle option, DUCKDB_V2_SETTING_SCOPE *out_scope, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the number of aliases registered for this option. * * Zero for an extension option; extension options carry no aliases. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param option The option. * @param out_count Receives the alias count. @@ -1829,14 +1918,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_option_get_default_scope(duckdb_v2_option */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_option_get_alias_count(duckdb_v2_option_handle option, idx_t *out_count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Borrows the alias name at the given index. * * An out-of-range index returns ERROR_INPUT_INVALID. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param option The option. * @param index The alias index, in [0, alias_count). @@ -1848,6 +1939,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_option_get_alias_count(duckdb_v2_option_h DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_option_get_alias(duckdb_v2_option_handle option, idx_t index, duckdb_v2_identifier_t *out_alias, duckdb_v2_error_info_handle *err); +#endif /* --- Struct definitions for configuration --- */ @@ -1867,6 +1959,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_option_get_alias(duckdb_v2_option_handle /* --- Functions for connection --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Opens a connection to an instance. * @@ -1876,7 +1969,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_option_get_alias(duckdb_v2_option_handle * destroys it via `duckdb_v2_connection_destroy()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param instance The instance to connect to. * @param out_conn Receives the new connection handle. @@ -1887,7 +1980,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_option_get_alias(duckdb_v2_option_handle DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_create(duckdb_v2_instance_handle instance, duckdb_v2_connection_handle *out_conn, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys the connection. * @@ -1895,13 +1990,15 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_create(duckdb_v2_instance_hand * as anything else still references it. On success the handle is set to null. Safe to call on an already-null slot. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param conn The connection to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_destroy(duckdb_v2_connection_handle *conn); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Interrupts the query currently executing on the connection. * @@ -1911,7 +2008,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_destroy(duckdb_v2_connection_h * (`duckdb_v2_result_step()`), or as ERROR_RUNTIME_INTERRUPT (`duckdb_v2_result_fetch_chunk()`). * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param conn The connection whose active query to interrupt. * @param err Optional. On failure, receives an opaque info handle the caller must destroy via @@ -1920,7 +2017,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_destroy(duckdb_v2_connection_h */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_interrupt(duckdb_v2_connection_handle conn, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Captures a snapshot of the active query's execution progress. * @@ -1932,7 +2031,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_interrupt(duckdb_v2_connection * active, or no progress has been published yet. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param conn The connection. * @param out_percentage Receives the percentage complete in [0, 100], -1 if tracking is disabled, no query is active, @@ -1947,6 +2046,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_progress_get(duckdb_v2_connect uint64_t *out_rows_processed, uint64_t *out_total_rows_to_process, duckdb_v2_error_info_handle *err); +#endif /* --- Struct definitions for connection --- */ @@ -1976,6 +2076,7 @@ typedef struct _duckdb_v2_custom_type { /* --- Functions for custom type --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a new custom type through a factory. * @@ -1987,7 +2088,7 @@ typedef struct _duckdb_v2_custom_type { * The custom type can only be registered on the database the factory belongs to. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create the custom type through. * @param type On success, receives the newly created custom type. Owned by the caller. @@ -1998,7 +2099,9 @@ typedef struct _duckdb_v2_custom_type { DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_type_create(duckdb_v2_factory_handle factory, duckdb_v2_custom_type_handle *type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the name of the custom type. * @@ -2006,7 +2109,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_type_create(duckdb_v2_factory_hand * name is borrowed and copied. Calling this again replaces the previous name. A name must be set before registration. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param type The type to set the name of. * @param name The name to set. Borrowed and copied. @@ -2017,7 +2120,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_type_create(duckdb_v2_factory_hand DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_type_set_name(duckdb_v2_custom_type_handle type, const duckdb_v2_identifier_t *name, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the base type of the custom type. * @@ -2027,7 +2132,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_type_set_name(duckdb_v2_custom_typ * something a registered type can be built on. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param type The type to set the base type of. * @param base_type The logical type to base the custom type on. Borrowed for the call only. @@ -2038,7 +2143,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_type_set_name(duckdb_v2_custom_typ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_type_set_base_type(duckdb_v2_custom_type_handle type, duckdb_v2_logical_type_handle base_type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Registers the custom type, making it available for use in SQL queries. * @@ -2049,7 +2156,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_type_set_base_type(duckdb_v2_custo * `duckdb_v2_custom_type_destroy()`, which does not affect the registered type. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param conn The connection to register on. * @param type The custom type to register. @@ -2060,7 +2167,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_type_set_base_type(duckdb_v2_custo DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_register_custom_type(duckdb_v2_connection_handle conn, duckdb_v2_custom_type_handle type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Registers the custom type, making it available for use in SQL queries. * @@ -2070,7 +2179,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_register_custom_type(duckdb_v2 * it with `duckdb_v2_custom_type_destroy()`, which does not affect the registered type. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param extension The loading extension. * @param type The custom type to register. @@ -2081,7 +2190,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_register_custom_type(duckdb_v2 DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_extension_register_custom_type(duckdb_v2_extension_handle extension, duckdb_v2_custom_type_handle type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys the custom type, releasing its resources. * @@ -2089,12 +2200,13 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_extension_register_custom_type(duckdb_v2_ * double-destruction. Destroying the handle after registration does not affect the registered type. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param type The type to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_type_destroy(duckdb_v2_custom_type_handle *type); +#endif /* --- Struct definitions for custom type --- */ @@ -2114,6 +2226,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_type_destroy(duckdb_v2_custom_type /* --- Functions for data_chunk --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates an empty data chunk with the given column types, drawing its allocator from a factory. * @@ -2123,7 +2236,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_type_destroy(duckdb_v2_custom_type * data_chunk_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param types Pointer to an array of logical_type handles, one per column. @@ -2136,7 +2249,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_data_chunk_create(duckdb_v2_factory_handl const duckdb_v2_logical_type_handle *types, idx_t column_count, duckdb_v2_data_chunk_handle *out_chunk, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a deep copy of a data chunk, drawing its allocator from a factory. * @@ -2146,7 +2261,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_data_chunk_create(duckdb_v2_factory_handl * via data_chunk_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param chunk The chunk to copy. Left unchanged. @@ -2158,7 +2273,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_data_chunk_copy(duckdb_v2_factory_handle duckdb_v2_data_chunk_handle chunk, duckdb_v2_data_chunk_handle *out_chunk, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys a data chunk handle. * @@ -2166,13 +2283,15 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_data_chunk_copy(duckdb_v2_factory_handle * vector previously borrowed from this chunk becomes invalid. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param chunk The chunk to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_data_chunk_destroy(duckdb_v2_data_chunk_handle *chunk); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Empties a data chunk so it can be filled again. * @@ -2182,7 +2301,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_data_chunk_destroy(duckdb_v2_data_chunk_h * callback for reading. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param chunk The chunk to clear. * @param err Optional. On failure, receives an opaque info handle the caller must destroy via error_info_destroy. @@ -2190,12 +2309,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_data_chunk_destroy(duckdb_v2_data_chunk_h */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_data_chunk_clear(duckdb_v2_data_chunk_handle chunk, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the row count of a data chunk. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param chunk The chunk. * @param out_size Receives the row count. @@ -2204,6 +2325,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_data_chunk_clear(duckdb_v2_data_chunk_han */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_data_chunk_get_size(duckdb_v2_data_chunk_handle chunk, idx_t *out_size, duckdb_v2_error_info_handle *err); +#endif #if DUCKDB_V2_API_ALLOW_UNSTABLE /*! @@ -2222,13 +2344,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_data_chunk_get_capacity(duckdb_v2_data_ch duckdb_v2_error_info_handle *err); #endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the number of vectors in a data chunk. * * Equals the column count of the producing result. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param chunk The chunk. * @param out_count Receives the vector count. @@ -2237,7 +2360,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_data_chunk_get_capacity(duckdb_v2_data_ch */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_data_chunk_get_vector_count(duckdb_v2_data_chunk_handle chunk, idx_t *out_count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Borrows the vector at the given index in a data chunk. * @@ -2245,7 +2370,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_data_chunk_get_vector_count(duckdb_v2_dat * returns ERROR_INPUT_INVALID. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param chunk The chunk. * @param index The vector index, in [0, vector_count). @@ -2256,6 +2381,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_data_chunk_get_vector_count(duckdb_v2_dat DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_data_chunk_get_vector(duckdb_v2_data_chunk_handle chunk, idx_t index, duckdb_v2_vector_handle *out_vector, duckdb_v2_error_info_handle *err); +#endif /* --- Struct definitions for data_chunk --- */ @@ -2275,11 +2401,12 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_data_chunk_get_vector(duckdb_v2_data_chun /* --- Functions for environment --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates the V2 environment. Call once at program start. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param out_env Receives the new environment handle. * @param err Optional. On failure, receives an opaque info handle the caller must destroy via @@ -2288,7 +2415,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_data_chunk_get_vector(duckdb_v2_data_chun */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_environment_create(duckdb_v2_environment_handle *out_env, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys the environment. * @@ -2296,13 +2425,15 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_environment_create(duckdb_v2_environment_ * instances first, then retry. On success the handle is set to null. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param env The environment. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_environment_destroy(duckdb_v2_environment_handle *env); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the number of instances currently alive under the environment. * @@ -2310,7 +2441,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_environment_destroy(duckdb_v2_environment * ERROR_RESOURCE_IN_USE. The count is a snapshot and may change before the next call. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param env The environment. * @param out_count Receives the number of live instances. @@ -2321,6 +2452,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_environment_destroy(duckdb_v2_environment DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_environment_get_instance_count(duckdb_v2_environment_handle env, idx_t *out_count, duckdb_v2_error_info_handle *err); +#endif /* --- Struct definitions for environment --- */ @@ -2340,6 +2472,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_environment_get_instance_count(duckdb_v2_ /* --- Functions for error --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the error code associated with an error info handle. * @@ -2347,14 +2480,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_environment_get_instance_count(duckdb_v2_ * unchanged and returns a non-success error code. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The error info handle to query. * @param out_code The error code associated with the info, if the call succeeds. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_error_info_get_code(duckdb_v2_error_info_handle info, DUCKDB_V2_ERROR *out_code); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the error text associated with an error info handle. * @@ -2363,14 +2498,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_error_info_get_code(duckdb_v2_error_info_ * been destroyed. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The error info handle to query. * @param out_text Receives a borrowed view of the text. Owned by DuckDB; valid until the info handle is destroyed. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_error_info_get_text(duckdb_v2_error_info_handle info, duckdb_v2_str *out_text); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the error text body without the leading category prefix. * @@ -2381,7 +2518,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_error_info_get_text(duckdb_v2_error_info_ * pointer is owned by DuckDB and valid until the info handle is destroyed. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The error info handle to query. * @param out_raw_text Receives a borrowed view of the raw text. Owned by DuckDB; valid until the info handle is @@ -2390,7 +2527,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_error_info_get_text(duckdb_v2_error_info_ */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_error_info_get_raw_text(duckdb_v2_error_info_handle info, duckdb_v2_str *out_raw_text); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the error code for an error info handle. * @@ -2398,14 +2537,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_error_info_get_raw_text(duckdb_v2_error_i * info handle, in which case the call is a no-op and returns ERROR_NONE. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The error info handle to set. On success, updated with the provided code. * @param code The error code to set in the info. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_error_info_set_code(duckdb_v2_error_info_handle info, DUCKDB_V2_ERROR code); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the error text for an error info handle. * @@ -2413,14 +2554,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_error_info_set_code(duckdb_v2_error_info_ * nothing is changed. Accepts a `nullptr` info handle, in which case the call is a no-op and returns ERROR_NONE. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The error info handle to set. On success, updated with the provided text. * @param text The error text to set in the info. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_error_info_set_text(duckdb_v2_error_info_handle info, const duckdb_v2_str *text); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys an error info handle and frees its resources. * @@ -2428,12 +2571,13 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_error_info_set_text(duckdb_v2_error_info_ * `*info` is set to nullptr. Safe to call on any info DuckDB returned. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The error info handle to destroy. Set to nullptr on return. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_error_info_destroy(duckdb_v2_error_info_handle *info); +#endif /* --- Struct definitions for error --- */ @@ -2509,6 +2653,7 @@ struct duckdb_v2_extension_input { /* --- Functions for factory --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Borrows the factory of an instance. * @@ -2518,7 +2663,7 @@ struct duckdb_v2_extension_input { * instance is, and must not be destroyed. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param instance The instance. * @param out_factory Receives the borrowed factory. @@ -2529,7 +2674,9 @@ struct duckdb_v2_extension_input { DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_get_factory(duckdb_v2_instance_handle instance, duckdb_v2_factory_handle *out_factory, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Borrows the factory of a connection. * @@ -2538,7 +2685,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_get_factory(duckdb_v2_instance_h * handle is borrowed: it is valid for as long as the connection is, and must not be destroyed. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param conn The connection. * @param out_factory Receives the borrowed factory. @@ -2549,7 +2696,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_get_factory(duckdb_v2_instance_h DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_get_factory(duckdb_v2_connection_handle conn, duckdb_v2_factory_handle *out_factory, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Borrows the factory of a context. * @@ -2557,7 +2706,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_get_factory(duckdb_v2_connecti * handle is borrowed: it is valid for as long as the context is, and must not be destroyed. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param ctx The context. * @param out_factory Receives the borrowed factory. @@ -2568,6 +2717,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_get_factory(duckdb_v2_connecti DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_context_get_factory(duckdb_v2_context_handle ctx, duckdb_v2_factory_handle *out_factory, duckdb_v2_error_info_handle *err); +#endif /* --- Struct definitions for factory --- */ @@ -2673,13 +2823,14 @@ typedef void (*duckdb_v2_file_system_path_glob_callback_fn)(const duckdb_v2_str /* --- Functions for file system --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Borrows the file system of a context. * * The returned handle is borrowed: it is valid only for as long as the context is, and must not be destroyed. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param context The context to take the file system from. * @param file_system Receives the borrowed file system. @@ -2690,7 +2841,9 @@ typedef void (*duckdb_v2_file_system_path_glob_callback_fn)(const duckdb_v2_str DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_context_get_file_system(duckdb_v2_context_handle context, duckdb_v2_file_system_handle *file_system, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Borrows the file system of an instance. * @@ -2699,7 +2852,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_context_get_file_system(duckdb_v2_context * The returned handle is borrowed: it is valid only for as long as the instance is, and must not be destroyed. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param instance The instance to take the file system from. * @param file_system Receives the borrowed file system. @@ -2710,7 +2863,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_context_get_file_system(duckdb_v2_context DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_get_file_system(duckdb_v2_instance_handle instance, duckdb_v2_file_system_handle *file_system, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Borrows the file system of a connection. * @@ -2720,7 +2875,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_get_file_system(duckdb_v2_instan * The returned handle is borrowed: it is valid only for as long as the connection is, and must not be destroyed. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param conn The connection to take the file system from. * @param file_system Receives the borrowed file system. @@ -2731,7 +2886,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_get_file_system(duckdb_v2_instan DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_get_file_system(duckdb_v2_connection_handle conn, duckdb_v2_file_system_handle *file_system, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a set of open options for a file system. * @@ -2744,7 +2901,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_get_file_system(duckdb_v2_conn * system ends up handling the path. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param file_system The file system the options are for. * @param options On success, receives the new options. Owned by the caller; destroy via @@ -2756,7 +2913,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_get_file_system(duckdb_v2_conn DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_open_options_create(duckdb_v2_file_system_handle file_system, duckdb_v2_file_open_options_handle *options, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Applies one flag to the options. * @@ -2767,7 +2926,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_open_options_create(duckdb_v2_file_s * `FILE_FLAG_INVALID` names no behaviour and is rejected, as is any value that is not a `DUCKDB_V2_FILE_FLAG`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param options The options to apply the flag to. * @param flag The flag to apply. @@ -2778,7 +2937,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_open_options_create(duckdb_v2_file_s DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_open_options_set_flag(duckdb_v2_file_open_options_handle options, DUCKDB_V2_FILE_FLAG flag, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Attaches a named value to the options. * @@ -2791,7 +2952,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_open_options_set_flag(duckdb_v2_file * same name again replaces the previous value. Names are case-sensitive. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param options The options to set the value on. * @param name The name of the value. Borrowed and copied. @@ -2804,7 +2965,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_open_options_set_value(duckdb_v2_fil const duckdb_v2_str *name, duckdb_v2_value_handle value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys the options, releasing their resources. * @@ -2812,13 +2975,15 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_open_options_set_value(duckdb_v2_fil * double-destruction. Files already opened with these options are unaffected. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param options The options to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_open_options_destroy(duckdb_v2_file_open_options_handle *options); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Opens a file. * @@ -2837,7 +3002,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_open_options_destroy(duckdb_v2_file_ * elsewhere the behaviour is whatever the underlying file system does with them. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param file_system The file system to open the file through. * @param file_path The path of the file to open. Borrowed for the call only. @@ -2851,7 +3016,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_system_open(duckdb_v2_file_system_ha const duckdb_v2_str *file_path, duckdb_v2_file_open_options_handle options, duckdb_v2_file_handle *file, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Reports whether a file exists at the given path. * @@ -2859,7 +3026,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_system_open(duckdb_v2_file_system_ha * system may reach out to it. A directory is not a file, and reports false. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param file_system The file system to ask. * @param path The path to check. Borrowed for the call only. @@ -2871,7 +3038,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_system_open(duckdb_v2_file_system_ha DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_system_path_exists(duckdb_v2_file_system_handle file_system, const duckdb_v2_str *path, bool *out_exists, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Reports whether a path names a remote file, e.g. one under `s3://`, `https://`, `gcs://` or `azure://`. * @@ -2879,7 +3048,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_system_path_exists(duckdb_v2_file_sy * file system is not loaded. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param file_system The file system the path is meant for. * @param path The path to check. Borrowed for the call only. @@ -2891,7 +3060,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_system_path_exists(duckdb_v2_file_sy DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_system_path_is_remote(duckdb_v2_file_system_handle file_system, const duckdb_v2_str *path, bool *out_is_remote, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Expands a path as the file system does when opening it: a leading `~` becomes the home directory, as the * `home_directory` setting configures it. @@ -2899,7 +3070,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_system_path_is_remote(duckdb_v2_file * A path without anything to expand is handed back as it is. The expanded path is handed to `sink` in a single call. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param file_system The file system whose settings expand the path. * @param path The path to expand. Borrowed for the call only. @@ -2913,7 +3084,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_system_path_is_remote(duckdb_v2_file DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_system_path_expand(duckdb_v2_file_system_handle file_system, const duckdb_v2_str *path, duckdb_v2_text_sink_fn sink, void *user_data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Finds the files matching a glob pattern, e.g. `*.csv` or `data_?.json` in a directory, handing each matched path to * `callback`. @@ -2924,7 +3097,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_system_path_expand(duckdb_v2_file_sy * handed over is up to the file system. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param file_system The file system to glob in. * @param pattern The glob pattern. Borrowed for the call only. @@ -2938,7 +3111,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_system_path_glob(duckdb_v2_file_syst const duckdb_v2_str *pattern, duckdb_v2_file_system_path_glob_callback_fn callback, void *user_data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Moves, or renames, a file from one path to another. * @@ -2947,7 +3122,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_system_path_glob(duckdb_v2_file_syst * whether the move is atomic, is up to that file system. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param file_system The file system to move the file in. * @param source The path of the file to move. Borrowed for the call only. @@ -2959,7 +3134,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_system_path_glob(duckdb_v2_file_syst DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_system_path_move(duckdb_v2_file_system_handle file_system, const duckdb_v2_str *source, const duckdb_v2_str *target, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Removes the file at a path, if there is one. * @@ -2967,7 +3144,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_system_path_move(duckdb_v2_file_syst * `out_removed` then receives false. A file that exists but cannot be removed is. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param file_system The file system to remove the file from. * @param path The path of the file to remove. Borrowed for the call only. @@ -2979,7 +3156,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_system_path_move(duckdb_v2_file_syst DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_system_path_remove(duckdb_v2_file_system_handle file_system, const duckdb_v2_str *path, bool *out_removed, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Reads from the file into a caller-supplied buffer. * @@ -2991,7 +3170,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_system_path_remove(duckdb_v2_file_sy * on several threads at once. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param file The file to read from. * @param buffer A caller-owned buffer of at least `buffer_size` bytes, receiving what was read. @@ -3004,7 +3183,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_system_path_remove(duckdb_v2_file_sy */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_read(duckdb_v2_file_handle file, void *buffer, idx_t buffer_size, idx_t *bytes_read, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Writes a caller-supplied buffer to the file. * @@ -3016,7 +3197,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_read(duckdb_v2_file_handle file, voi * run on several threads at once. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param file The file to write to. * @param buffer A caller-owned buffer of at least `buffer_size` bytes, holding what to write. @@ -3028,7 +3209,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_read(duckdb_v2_file_handle file, voi */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_write(duckdb_v2_file_handle file, const void *buffer, idx_t buffer_size, idx_t *bytes_written, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Reads from a fixed offset, without moving the file's position. * @@ -3040,7 +3223,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_write(duckdb_v2_file_handle file, co * The file must have been opened with `FILE_FLAG_READ`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param file The file to read from. * @param buffer A caller-owned buffer of at least `buffer_size` bytes, receiving what was read. @@ -3052,7 +3235,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_write(duckdb_v2_file_handle file, co */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_read_at(duckdb_v2_file_handle file, void *buffer, idx_t buffer_size, idx_t location, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Writes at a fixed offset, without moving the file's position. * @@ -3065,7 +3250,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_read_at(duckdb_v2_file_handle file, * them out. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param file The file to write to. * @param buffer A caller-owned buffer of at least `buffer_size` bytes, holding what to write. @@ -3077,12 +3262,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_read_at(duckdb_v2_file_handle file, */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_write_at(duckdb_v2_file_handle file, const void *buffer, idx_t buffer_size, idx_t location, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the file's current read/write position, as a byte offset from the start of the file. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param file The file to query. * @param position Receives the current position, as a byte offset from the start of the file. @@ -3092,12 +3279,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_write_at(duckdb_v2_file_handle file, */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_tell(duckdb_v2_file_handle file, idx_t *position, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the total size of the file in bytes. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param file The file to query. * @param size Receives the total size of the file in bytes. @@ -3107,7 +3296,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_tell(duckdb_v2_file_handle file, idx */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_size(duckdb_v2_file_handle file, idx_t *size, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Moves the file's read/write position. * @@ -3115,7 +3306,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_size(duckdb_v2_file_handle file, idx * Seeking past the end is allowed, and reading from there yields nothing. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param file The file to seek within. * @param position The absolute byte offset to seek to, measured from the start of the file. @@ -3125,7 +3316,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_size(duckdb_v2_file_handle file, idx */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_seek(duckdb_v2_file_handle file, idx_t position, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Flushes buffered writes to persistent storage. * @@ -3133,7 +3326,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_seek(duckdb_v2_file_handle file, idx * Closing or destroying the handle flushes as well. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param file The file to synchronize. * @param err Optional. On failure, receives an opaque info handle the caller must destroy via @@ -3141,7 +3334,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_seek(duckdb_v2_file_handle file, idx * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_sync(duckdb_v2_file_handle file, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Closes the file without destroying the handle. * @@ -3149,7 +3344,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_sync(duckdb_v2_file_handle file, duc * must still be destroyed with `duckdb_v2_file_destroy()`, but it can no longer read, write or seek. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param file The file to close. * @param err Optional. On failure, receives an opaque info handle the caller must destroy via @@ -3157,7 +3352,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_sync(duckdb_v2_file_handle file, duc * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_close(duckdb_v2_file_handle file, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys the file, closing it if it is still open. * @@ -3165,12 +3362,13 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_close(duckdb_v2_file_handle file, du * double-destruction. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param file The file to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_file_destroy(duckdb_v2_file_handle *file); +#endif /* --- Struct definitions for file system --- */ @@ -3205,11 +3403,12 @@ typedef struct _duckdb_v2_function_bind_info { /* --- Functions for function --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set on the function being bound, e.g. via `duckdb_v2_scalar_function_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param data Receives the user data pointer, or null if none was set. @@ -3219,7 +3418,9 @@ typedef struct _duckdb_v2_function_bind_info { */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_bind_get_user_data(duckdb_v2_function_bind_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the function's "bind data" from the bind callback. * @@ -3229,7 +3430,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_bind_get_user_data(duckdb_v2_fun * bind data through `duckdb_v2_scalar_function_bind_set_bind_data()` instead. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param data Opaque handle bundling the bind data pointer plus optional destructor and equality callbacks. @@ -3240,7 +3441,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_bind_get_user_data(duckdb_v2_fun DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_bind_set_bind_data(duckdb_v2_function_bind_info_handle info, duckdb_v2_opaque *data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the number of arguments of the call site being bound, split into the four parts of the argument list. * @@ -3251,7 +3454,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_bind_set_bind_data(duckdb_v2_fun * written to it. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param positional_fixed Optional. Receives the number of positional-only and standard parameters. @@ -3267,7 +3470,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_bind_get_arg_count(duckdb_v2_fun idx_t *positional_fixed, idx_t *positional_variadic, idx_t *named_fixed, idx_t *named_variadic, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the type of the argument at the given index. * @@ -3275,7 +3480,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_bind_get_arg_count(duckdb_v2_fun * `duckdb_v2_logical_type_destroy()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param index The index of the argument. @@ -3287,7 +3492,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_bind_get_arg_count(duckdb_v2_fun DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_bind_get_arg_type(duckdb_v2_function_bind_info_handle info, idx_t index, duckdb_v2_logical_type_handle *type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Folds the argument at the given index to a constant value. * @@ -3296,7 +3503,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_bind_get_arg_type(duckdb_v2_func * caller and must be destroyed via `duckdb_v2_value_destroy()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param index The index of the argument. @@ -3308,7 +3515,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_bind_get_arg_type(duckdb_v2_func DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_bind_get_arg_value(duckdb_v2_function_bind_info_handle info, idx_t index, duckdb_v2_value_handle *value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the name of the argument at the given index. * @@ -3318,7 +3527,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_bind_get_arg_value(duckdb_v2_fun * duration of the callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param index The index of the argument. @@ -3330,7 +3539,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_bind_get_arg_value(duckdb_v2_fun DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_bind_get_arg_name(duckdb_v2_function_bind_info_handle info, idx_t index, duckdb_v2_identifier_t *name, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Looks up the index of an argument by name. * @@ -3341,7 +3552,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_bind_get_arg_name(duckdb_v2_func * passed it or it carries its default value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param name The name to look up. Borrowed for the call only. @@ -3354,6 +3565,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_bind_get_arg_name(duckdb_v2_func DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_bind_get_arg_index(duckdb_v2_function_bind_info_handle info, const duckdb_v2_identifier_t *name, idx_t *index, bool *found, duckdb_v2_error_info_handle *err); +#endif /* --- Struct definitions for function --- */ @@ -3384,13 +3596,14 @@ typedef struct _duckdb_v2_function_docs { /* --- Functions for function docs --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the description of the function overload. * * The description is borrowed and copied. Calling this again replaces the previous description. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param docs The documentation to set the description of. * @param description The description to set. Borrowed and copied. @@ -3401,14 +3614,16 @@ typedef struct _duckdb_v2_function_docs { DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_docs_set_description(duckdb_v2_function_docs_handle docs, const duckdb_v2_str *description, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Adds an example of calling the function overload. * * The title and the example are borrowed and copied, and examples are reported in the order they were added. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param docs The documentation to add the example to. * @param title Optional. The title of the example; NULL or an empty view for none. Borrowed and copied. @@ -3421,14 +3636,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_docs_add_example(duckdb_v2_funct const duckdb_v2_str *title, const duckdb_v2_str *example, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Adds a category the function overload belongs to, e.g. "string" or "aggregate". * * The category is borrowed and copied, and categories are reported in the order they were added. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param docs The documentation to add the category to. * @param category The category. Borrowed and copied. @@ -3439,6 +3656,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_docs_add_example(duckdb_v2_funct DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_docs_add_category(duckdb_v2_function_docs_handle docs, const duckdb_v2_str *category, duckdb_v2_error_info_handle *err); +#endif /* --- Struct definitions for function docs --- */ @@ -3495,6 +3713,7 @@ typedef struct _duckdb_v2_function_signature { /* --- Functions for function signature --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Adds a parameter to a signature. * @@ -3507,7 +3726,7 @@ typedef struct _duckdb_v2_function_signature { * parameter, or when a standard parameter without a default value follows one with a default value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param sig The signature to configure. * @param name The parameter name. Borrowed and copied. @@ -3521,7 +3740,9 @@ typedef struct _duckdb_v2_function_signature { DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_signature_add_parameter( duckdb_v2_function_signature_handle sig, const duckdb_v2_identifier_t *name, duckdb_v2_logical_type_handle type, duckdb_v2_value_handle value, DUCKDB_V2_FUNCTION_PARAMETER_KIND kind, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the return type of a signature. * @@ -3530,7 +3751,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_signature_add_parameter( * ANY is accepted, depends on the function family and is enforced when the signature is registered with a builder. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param sig The signature to configure. * @param type The return type. Borrowed and copied. @@ -3540,6 +3761,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_signature_add_parameter( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_signature_set_return_type(duckdb_v2_function_signature_handle sig, duckdb_v2_logical_type_handle type, duckdb_v2_error_info_handle *err); +#endif /* --- Struct definitions for function signature --- */ @@ -3559,6 +3781,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_signature_set_return_type(duckdb /* --- Functions for identifier --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Renders a name as a SQL identifier, quoting and escaping only when required. * @@ -3575,7 +3798,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_signature_set_return_type(duckdb * string. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param name The name to render. Borrowed for the call only. * @param out_text Caller-owned buffer receiving the text plus a null terminator, or NULL to only report the required @@ -3590,6 +3813,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_function_signature_set_return_type(duckdb DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_identifier_render_quoted(const duckdb_v2_identifier_t *name, char *out_text, idx_t out_capacity, idx_t *out_length, duckdb_v2_error_info_handle *err); +#endif /* --- Struct definitions for identifier --- */ @@ -3618,6 +3842,7 @@ typedef struct _duckdb_v2_attach_options { /* --- Functions for instance --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates an instance under the environment with no startup options. * @@ -3628,7 +3853,7 @@ typedef struct _duckdb_v2_attach_options { * `duckdb_v2_instance_destroy()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param env The environment. * @param out_instance Receives the new instance handle. @@ -3639,7 +3864,9 @@ typedef struct _duckdb_v2_attach_options { DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_create(duckdb_v2_environment_handle env, duckdb_v2_instance_handle *out_instance, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates an instance under the environment, configured with startup options. * @@ -3654,7 +3881,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_create(duckdb_v2_environment_han * creation fails with the names none claimed. The caller destroys the instance via `duckdb_v2_instance_destroy()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param env The environment. * @param option_names Optional. An array of option_count option names (canonical or alias). Pass NULL when option_count @@ -3670,7 +3897,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_create(duckdb_v2_environment_han DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_create_with_options( duckdb_v2_environment_handle env, const duckdb_v2_str *option_names, const duckdb_v2_str *option_values, idx_t option_count, duckdb_v2_instance_handle *out_instance, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys the instance handle. * @@ -3679,13 +3908,15 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_create_with_options( * available to open again. On success the handle is set to null. Safe to call on an already-null slot. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param instance The instance handle to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_destroy(duckdb_v2_instance_handle *instance); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Attaches a database to the instance. * @@ -3707,7 +3938,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_destroy(duckdb_v2_instance_handl * `duckdb_v2_instance_create_with_options()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param instance The instance handle. * @param name Optional. The name to attach under; null or an empty view for the name derived from the path. Borrowed @@ -3724,7 +3955,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_attach(duckdb_v2_instance_handle const duckdb_v2_identifier_t *name, const duckdb_v2_str *path, duckdb_v2_attach_options_handle options, bool make_default, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Detaches the database attached under `name`. * @@ -3735,7 +3968,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_attach(duckdb_v2_instance_handle * it alive until they release it. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param instance The instance handle. * @param name The name the database is attached under. Borrowed. @@ -3746,7 +3979,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_attach(duckdb_v2_instance_handle DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_detach(duckdb_v2_instance_handle instance, const duckdb_v2_identifier_t *name, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Makes the database attached under `name` the default database for connections created from now on. * @@ -3758,7 +3993,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_detach(duckdb_v2_instance_handle * no database is attached under that name. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param instance The instance handle. * @param name The name the database is attached under. Borrowed. @@ -3769,7 +4004,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_detach(duckdb_v2_instance_handle DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_set_default(duckdb_v2_instance_handle instance, const duckdb_v2_identifier_t *name, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates an empty set of attach options for use with `duckdb_v2_instance_attach()` on `instance`. * @@ -3777,7 +4014,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_set_default(duckdb_v2_instance_h * as the attach call returns, and reused for further attaches before that. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param instance The instance handle the options will be used with. * @param out_options Receives the new options handle. @@ -3788,7 +4025,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_set_default(duckdb_v2_instance_h DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_attach_options_create(duckdb_v2_instance_handle instance, duckdb_v2_attach_options_handle *out_options, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets one attach option, like a `(KEY value)` entry of SQL `ATTACH`. * @@ -3799,7 +4038,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_attach_options_create(duckdb_v2_instance_ * option fails the attach. Both views are borrowed and copied. Setting the same key again replaces it. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param options The attach options. * @param key The option name, e.g. READ_ONLY. @@ -3812,25 +4051,29 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_attach_options_set(duckdb_v2_attach_optio const duckdb_v2_identifier_t *key, const duckdb_v2_str *setting, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys an attach options handle. * * On success the slot is set to null. Safe to call on an already-null slot. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param options The attach options to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_attach_options_destroy(duckdb_v2_attach_options_handle *options); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the version of the linked DuckDB library. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param out_version The version string. * @param err Optional. On failure, receives an opaque info handle the caller must destroy via @@ -3838,6 +4081,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_attach_options_destroy(duckdb_v2_attach_o * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_library_version(duckdb_v2_str *out_version, duckdb_v2_error_info_handle *err); +#endif /* --- Struct definitions for instance --- */ @@ -3882,6 +4126,7 @@ typedef enum DUCKDB_V2_LOG_LEVEL { /* --- Functions for logging --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Writes a message to DuckDB's log. * @@ -3891,7 +4136,7 @@ typedef enum DUCKDB_V2_LOG_LEVEL { * selects the default type. Read entries back with `SELECT * FROM duckdb_logs`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param ctx The context to log through. * @param level Severity of the message. @@ -3903,7 +4148,9 @@ typedef enum DUCKDB_V2_LOG_LEVEL { DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_context_log(duckdb_v2_context_handle ctx, DUCKDB_V2_LOG_LEVEL level, const duckdb_v2_str *log_type, const duckdb_v2_str *message, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Writes a message to DuckDB's log. * @@ -3913,7 +4160,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_context_log(duckdb_v2_context_handle ctx, * Read entries back with `SELECT * FROM duckdb_logs`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param instance The instance to log through. * @param level Severity of the message. @@ -3925,7 +4172,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_context_log(duckdb_v2_context_handle ctx, DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_log(duckdb_v2_instance_handle instance, DUCKDB_V2_LOG_LEVEL level, const duckdb_v2_str *log_type, const duckdb_v2_str *message, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Writes a message to DuckDB's log. * @@ -3935,7 +4184,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_log(duckdb_v2_instance_handle in * entries back with `SELECT * FROM duckdb_logs`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param conn The connection to log through. * @param level Severity of the message. @@ -3947,6 +4196,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_log(duckdb_v2_instance_handle in DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_log(duckdb_v2_connection_handle conn, DUCKDB_V2_LOG_LEVEL level, const duckdb_v2_str *log_type, const duckdb_v2_str *message, duckdb_v2_error_info_handle *err); +#endif /* --- Struct definitions for logging --- */ @@ -3977,6 +4227,7 @@ typedef struct _duckdb_v2_qname { /* --- Functions for qname --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Parses SQL text into a qualified name. * @@ -3986,7 +4237,7 @@ typedef struct _duckdb_v2_qname { * already separate, build the name with `duckdb_v2_qname_create()` rather than joining them and parsing the result. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param text The name text to parse. Borrowed for the call only. * @param name On success, receives the qualified name. Owned by the caller; destroy via `duckdb_v2_qname_destroy()`. @@ -3996,7 +4247,9 @@ typedef struct _duckdb_v2_qname { */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_qname_parse(const duckdb_v2_str *text, duckdb_v2_qname_handle *name, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a qualified name from its parts. * @@ -4006,7 +4259,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_qname_parse(const duckdb_v2_str *text, du * all rejected with `ERROR_INPUT_INVALID`. The parts are borrowed and copied. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param parts An array of `part_count` non-empty identifier views, outermost first. * @param part_count The number of parts, between one and three. @@ -4017,7 +4270,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_qname_parse(const duckdb_v2_str *text, du */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_qname_create(const duckdb_v2_identifier_t *parts, idx_t part_count, duckdb_v2_qname_handle *name, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns how many parts the qualified name has. * @@ -4025,7 +4280,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_qname_create(const duckdb_v2_identifier_t * at count - 1. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param name The qualified name. * @param count Receives the number of parts. @@ -4035,7 +4290,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_qname_create(const duckdb_v2_identifier_t */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_qname_get_part_count(duckdb_v2_qname_handle name, idx_t *count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Borrows one part of the qualified name. * @@ -4044,7 +4301,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_qname_get_part_count(duckdb_v2_qname_hand * `ERROR_INPUT_OUT_OF_RANGE`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param name The qualified name. * @param index Zero-based part index. @@ -4055,7 +4312,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_qname_get_part_count(duckdb_v2_qname_hand */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_qname_get_part(duckdb_v2_qname_handle name, idx_t index, duckdb_v2_identifier_t *part, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Renders the qualified name as SQL text. * @@ -4071,7 +4330,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_qname_get_part(duckdb_v2_qname_handle nam * string. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param name The qualified name to render. * @param out_text Caller-owned buffer receiving the text plus a null terminator, or NULL to only report the required @@ -4085,7 +4344,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_qname_get_part(duckdb_v2_qname_handle nam */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_qname_render(duckdb_v2_qname_handle name, char *out_text, idx_t out_capacity, idx_t *out_length, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Compares two qualified names. * @@ -4094,7 +4355,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_qname_render(duckdb_v2_qname_handle name, * equal names are still distinct pointers. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param left The first qualified name. * @param right The second qualified name. @@ -4105,7 +4366,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_qname_render(duckdb_v2_qname_handle name, */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_qname_equals(duckdb_v2_qname_handle left, duckdb_v2_qname_handle right, bool *result, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Hashes a qualified name. * @@ -4114,7 +4377,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_qname_equals(duckdb_v2_qname_handle left, * persist it. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param name The qualified name to hash. * @param hash Receives the hash value. @@ -4124,7 +4387,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_qname_equals(duckdb_v2_qname_handle left, */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_qname_hash(duckdb_v2_qname_handle name, uint64_t *hash, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys the qualified name, releasing its resources. * @@ -4132,15 +4397,273 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_qname_hash(duckdb_v2_qname_handle name, u * double-destruction. Any part views borrowed from it become dangling. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param name The qualified name to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_qname_destroy(duckdb_v2_qname_handle *name); +#endif /* --- Struct definitions for qname --- */ +/* ============================================================================ + * MODULE: query metrics + * ============================================================================ */ + +/* --- Enums for query metrics --- */ + +/* --- Struct forward declarations for query metrics --- */ + +/* --- Types for query metrics --- */ + +/*! + * An owned snapshot of the metrics of a query. Taken with `duckdb_v2_connection_get_query_metrics()`, read from its + * root node via `duckdb_v2_query_metrics_get_root()`, and destroyed with `duckdb_v2_query_metrics_destroy()`. Later + * queries do not update it. + */ +typedef struct _duckdb_v2_query_metrics { + void *internal_ptr; +} * duckdb_v2_query_metrics_handle; + +/*! + * A borrowed opaque handle to one node of a query metrics snapshot, valid for as long as the snapshot is. Read its name + * with `duckdb_v2_query_metrics_node_get_name()`, its metrics with `duckdb_v2_query_metrics_node_get_metric()` or by + * index, and its children with `duckdb_v2_query_metrics_node_get_child()`. + */ +typedef struct _duckdb_v2_query_metrics_node { + void *internal_ptr; +} * duckdb_v2_query_metrics_node_handle; + +/* --- Constants for query metrics --- */ + +/* --- Function pointer typedefs for query metrics --- */ + +/* --- Functions for query metrics --- */ + +#if DUCKDB_V2_API_ALLOW_UNSTABLE +/*! + * Takes a snapshot of the metrics of the last query the connection finished. + * + * The snapshot is owned by the caller and does not change afterwards. It holds the metrics DuckDB's profiling + * configuration gathered: without profiling enabled, the root node carries no metrics and has no children. A snapshot + * is not promised to be complete; any metric, and any operator node, may be missing. + * + * Fails with `ERROR_RESOURCE_IN_USE` while a query is running on the connection, i.e. while a result of it has not yet + * been drained or destroyed. + * + * history: + * - unstable: v2.0.0 + * + * @param conn The connection to take the snapshot of. + * @param metrics On success, receives the owned snapshot. Destroy via `duckdb_v2_query_metrics_destroy()`. + * @param err Optional. On failure, receives an opaque info handle the caller must destroy via + * `duckdb_v2_error_info_destroy()`. + * @return DUCKDB_V2_ERROR + */ +DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_get_query_metrics(duckdb_v2_connection_handle conn, + duckdb_v2_query_metrics_handle *metrics, + duckdb_v2_error_info_handle *err); +#endif + +#if DUCKDB_V2_API_ALLOW_UNSTABLE +/*! + * Enables or disables profiling for the queries the connection runs from now on. + * + * While profiling is enabled, DuckDB gathers the metrics `duckdb_v2_connection_get_query_metrics()` reports. Profiling + * also prints the profile of every query, as configured by the `enable_profiling` and `profiling_output` options, which + * by default print a query tree to the standard output: set `enable_profiling` to `no_output` to only gather the + * metrics. Disabling profiling stops both. + * + * history: + * - unstable: v2.0.0 + * + * @param conn The connection to enable or disable profiling for. + * @param enabled Whether to enable profiling. + * @param err Optional. On failure, receives an opaque info handle the caller must destroy via + * `duckdb_v2_error_info_destroy()`. + * @return DUCKDB_V2_ERROR + */ +DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_enable_profiling(duckdb_v2_connection_handle conn, bool enabled, + duckdb_v2_error_info_handle *err); +#endif + +#if DUCKDB_V2_API_ALLOW_UNSTABLE +/*! + * Borrows the root node of the snapshot, which describes the query as a whole. Its children, if any, describe the + * operators that executed the query. + * + * history: + * - unstable: v2.0.0 + * + * @param metrics The snapshot. + * @param node Receives the borrowed root node. Valid until the snapshot is destroyed. + * @param err Optional. On failure, receives an opaque info handle the caller must destroy via + * `duckdb_v2_error_info_destroy()`. + * @return DUCKDB_V2_ERROR + */ +DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_query_metrics_get_root(duckdb_v2_query_metrics_handle metrics, + duckdb_v2_query_metrics_node_handle *node, + duckdb_v2_error_info_handle *err); +#endif + +#if DUCKDB_V2_API_ALLOW_UNSTABLE +/*! + * Borrows the name of the node: `QUERY` for the root node, and the name of the operator, e.g. `TABLE_SCAN`, for the + * other nodes. + * + * history: + * - unstable: v2.0.0 + * + * @param node The node. + * @param name Receives a borrowed view of the name. Valid until the snapshot is destroyed. + * @param err Optional. On failure, receives an opaque info handle the caller must destroy via + * `duckdb_v2_error_info_destroy()`. + * @return DUCKDB_V2_ERROR + */ +DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_query_metrics_node_get_name(duckdb_v2_query_metrics_node_handle node, + duckdb_v2_str *name, + duckdb_v2_error_info_handle *err); +#endif + +#if DUCKDB_V2_API_ALLOW_UNSTABLE +/*! + * Returns the number of children of the node. Valid indices for `duckdb_v2_query_metrics_node_get_child()` are [0, + * count). + * + * history: + * - unstable: v2.0.0 + * + * @param node The node. + * @param count Receives the number of children. + * @param err Optional. On failure, receives an opaque info handle the caller must destroy via + * `duckdb_v2_error_info_destroy()`. + * @return DUCKDB_V2_ERROR + */ +DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_query_metrics_node_get_child_count(duckdb_v2_query_metrics_node_handle node, + idx_t *count, + duckdb_v2_error_info_handle *err); +#endif + +#if DUCKDB_V2_API_ALLOW_UNSTABLE +/*! + * Borrows the child of the node at index. An out-of-range index is rejected with `ERROR_INPUT_OUT_OF_RANGE`. + * + * history: + * - unstable: v2.0.0 + * + * @param node The node. + * @param index Zero-based child index. + * @param child Receives the borrowed child. Valid until the snapshot is destroyed. + * @param err Optional. On failure, receives an opaque info handle the caller must destroy via + * `duckdb_v2_error_info_destroy()`. + * @return DUCKDB_V2_ERROR + */ +DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_query_metrics_node_get_child(duckdb_v2_query_metrics_node_handle node, + idx_t index, + duckdb_v2_query_metrics_node_handle *child, + duckdb_v2_error_info_handle *err); +#endif + +#if DUCKDB_V2_API_ALLOW_UNSTABLE +/*! + * Returns the number of metrics the node carries. Valid indices for `duckdb_v2_query_metrics_node_get_metric_name()` + * and `duckdb_v2_query_metrics_node_get_metric_value()` are [0, count); the order of the metrics is unspecified. + * + * history: + * - unstable: v2.0.0 + * + * @param node The node. + * @param count Receives the number of metrics. + * @param err Optional. On failure, receives an opaque info handle the caller must destroy via + * `duckdb_v2_error_info_destroy()`. + * @return DUCKDB_V2_ERROR + */ +DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_query_metrics_node_get_metric_count(duckdb_v2_query_metrics_node_handle node, + idx_t *count, + duckdb_v2_error_info_handle *err); +#endif + +#if DUCKDB_V2_API_ALLOW_UNSTABLE +/*! + * Borrows the name of the metric at index, e.g. `query.total_time`. An out-of-range index is rejected with + * `ERROR_INPUT_OUT_OF_RANGE`. + * + * history: + * - unstable: v2.0.0 + * + * @param node The node. + * @param index Zero-based metric index. + * @param name Receives a borrowed view of the name. Valid until the snapshot is destroyed. + * @param err Optional. On failure, receives an opaque info handle the caller must destroy via + * `duckdb_v2_error_info_destroy()`. + * @return DUCKDB_V2_ERROR + */ +DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_query_metrics_node_get_metric_name(duckdb_v2_query_metrics_node_handle node, + idx_t index, duckdb_v2_str *name, + duckdb_v2_error_info_handle *err); +#endif + +#if DUCKDB_V2_API_ALLOW_UNSTABLE +/*! + * Returns the value of the metric at index, a number such as a UBIGINT count or a DOUBLE duration. An out-of-range + * index is rejected with `ERROR_INPUT_OUT_OF_RANGE`. + * + * history: + * - unstable: v2.0.0 + * + * @param node The node. + * @param index Zero-based metric index. + * @param value Receives the owned value. Destroy via `duckdb_v2_value_destroy()`. + * @param err Optional. On failure, receives an opaque info handle the caller must destroy via + * `duckdb_v2_error_info_destroy()`. + * @return DUCKDB_V2_ERROR + */ +DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_query_metrics_node_get_metric_value(duckdb_v2_query_metrics_node_handle node, + idx_t index, duckdb_v2_value_handle *value, + duckdb_v2_error_info_handle *err); +#endif + +#if DUCKDB_V2_API_ALLOW_UNSTABLE +/*! + * Looks up a metric of the node by name, e.g. `query.total_time`. When the node does not carry it, `present` receives + * false and `value` receives null. + * + * history: + * - unstable: v2.0.0 + * + * @param node The node. + * @param name The name of the metric, matched exactly. Borrowed for the call only. + * @param value Receives the owned value, if present. Destroy via `duckdb_v2_value_destroy()`. + * @param present Receives whether the node carries the metric. + * @param err Optional. On failure, receives an opaque info handle the caller must destroy via + * `duckdb_v2_error_info_destroy()`. + * @return DUCKDB_V2_ERROR + */ +DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_query_metrics_node_get_metric(duckdb_v2_query_metrics_node_handle node, + const duckdb_v2_str *name, + duckdb_v2_value_handle *value, bool *present, + duckdb_v2_error_info_handle *err); +#endif + +#if DUCKDB_V2_API_ALLOW_UNSTABLE +/*! + * Destroys the snapshot, releasing its resources and invalidating the nodes borrowed from it. + * + * Null-safe: passing a null pointer or null handle is a no-op. The handle is set to null on return to prevent + * double-destruction. + * + * history: + * - unstable: v2.0.0 + * + * @param metrics The snapshot to destroy. + * @return DUCKDB_V2_ERROR + */ +DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_query_metrics_destroy(duckdb_v2_query_metrics_handle *metrics); +#endif + +/* --- Struct definitions for query metrics --- */ + /* ============================================================================ * MODULE: schema * ============================================================================ */ @@ -4165,11 +4688,12 @@ typedef struct _duckdb_v2_schema { /* --- Functions for schema --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the number of fields in a schema. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param schema The schema. * @param out_count Receives the field count. @@ -4178,7 +4702,9 @@ typedef struct _duckdb_v2_schema { */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_schema_get_count(duckdb_v2_schema_handle schema, idx_t *out_count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Borrows the name and type of the field at the given index. * @@ -4186,7 +4712,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_schema_get_count(duckdb_v2_schema_handle * out-of-range index is rejected with ERROR_INPUT_INVALID. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param schema The schema. * @param index Zero-based field index. @@ -4199,7 +4725,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_schema_get_field(duckdb_v2_schema_handle duckdb_v2_identifier_t *out_name, duckdb_v2_logical_type_handle *out_type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys a schema handle. * @@ -4207,12 +4735,13 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_schema_get_field(duckdb_v2_schema_handle * already-null slot. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param schema The schema handle to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_schema_destroy(duckdb_v2_schema_handle *schema); +#endif /* --- Struct definitions for schema --- */ @@ -4271,6 +4800,7 @@ typedef struct _duckdb_v2_token_iterator { /* --- Functions for tokenizer --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Tokenizes a SQL string into an iterator over its tokens. * @@ -4282,7 +4812,7 @@ typedef struct _duckdb_v2_token_iterator { * *out_iterator is set to NULL on failure. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param conn The connection supplying the grammar. * @param sql The SQL text. Borrowed for the call only; may contain interior null bytes. {NULL, 0} is the empty input. @@ -4293,7 +4823,9 @@ typedef struct _duckdb_v2_token_iterator { DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_tokenize_sql(duckdb_v2_connection_handle conn, const duckdb_v2_str *sql, duckdb_v2_token_iterator_handle *out_iterator, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Yields the next token, or END_OF_INPUT once exhausted. * @@ -4302,7 +4834,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_tokenize_sql(duckdb_v2_connection_handle * to the input length and length 0. On failure out params are set to TOKEN_TYPE_INVALID, 0, 0. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param iterator The iterator to advance. * @param out_type Receives the token's class, or TOKEN_TYPE_END_OF_INPUT once exhausted. @@ -4314,7 +4846,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_tokenize_sql(duckdb_v2_connection_handle DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_token_iterator_next(duckdb_v2_token_iterator_handle iterator, DUCKDB_V2_TOKEN_TYPE *out_type, idx_t *out_start, idx_t *out_length, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Reports whether the input ended before the closing delimiter of its last token. * @@ -4325,7 +4859,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_token_iterator_next(duckdb_v2_token_itera * same before, during and after draining. The only failure is a null argument. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param iterator The iterator. * @param out_ends_unterminated Receives whether the input ended inside an open token. @@ -4335,17 +4869,20 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_token_iterator_next(duckdb_v2_token_itera DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_token_iterator_ends_unterminated(duckdb_v2_token_iterator_handle iterator, bool *out_ends_unterminated, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys a token iterator handle. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param iterator The iterator to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_token_iterator_destroy(duckdb_v2_token_iterator_handle *iterator); +#endif /* --- Struct definitions for tokenizer --- */ @@ -4461,6 +4998,7 @@ typedef void (*duckdb_v2_aggregate_function_destroy_callback_fn)(duckdb_v2_aggre /* --- Functions for aggregate --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a new aggregate function through a factory. * @@ -4474,7 +5012,7 @@ typedef void (*duckdb_v2_aggregate_function_destroy_callback_fn)(duckdb_v2_aggre * The aggregate function can only be registered on the database the factory belongs to. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create the aggregate function through. * @param function On success, receives the newly created aggregate function. Owned by the caller. @@ -4485,7 +5023,9 @@ typedef void (*duckdb_v2_aggregate_function_destroy_callback_fn)(duckdb_v2_aggre DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_create(duckdb_v2_factory_handle factory, duckdb_v2_aggregate_function_handle *function, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the name of the aggregate function. * @@ -4493,7 +5033,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_create(duckdb_v2_facto * registration. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the name of. * @param name The name to set. Borrowed and copied. @@ -4504,7 +5044,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_create(duckdb_v2_facto DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_set_name(duckdb_v2_aggregate_function_handle function, const duckdb_v2_identifier_t *name, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the documentation of the function so it can be filled in. * @@ -4513,7 +5055,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_set_name(duckdb_v2_agg * in place, describes this overload only, and is registered with the function. Optional. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to get the documentation of. * @param docs The returned documentation. Borrowed and valid for the lifetime of the function handle. @@ -4524,7 +5066,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_set_name(duckdb_v2_agg DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_get_docs(duckdb_v2_aggregate_function_handle function, duckdb_v2_function_docs_handle *docs, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the function's signature so it can be configured. * @@ -4533,7 +5077,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_get_docs(duckdb_v2_agg * signature with a return type before registration. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to get the signature of. * @param sig The returned signature. Borrowed and valid for the lifetime of the function handle. @@ -4544,7 +5088,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_get_docs(duckdb_v2_agg DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_get_signature(duckdb_v2_aggregate_function_handle function, duckdb_v2_function_signature_handle *sig, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets arbitrary user data on the aggregate function. * @@ -4553,7 +5099,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_get_signature(duckdb_v * handle bundles the pointer with an optional destructor, invoked when the data is no longer needed. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the user data of. * @param data Opaque handle bundling the user data pointer plus an optional destructor. @@ -4564,7 +5110,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_get_signature(duckdb_v DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_set_user_data(duckdb_v2_aggregate_function_handle function, duckdb_v2_opaque *data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets a property on the aggregate function. * @@ -4574,7 +5122,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_set_user_data(duckdb_v * key that is not valid for aggregate functions, results in an error. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the property of. * @param key The property to set. @@ -4587,7 +5135,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_set_property(duckdb_v2 DUCKDB_V2_FUNCTION_PROPERTY_KEY key, DUCKDB_V2_FUNCTION_PROPERTY_VALUE value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the optional bind callback of the aggregate function. * @@ -4597,7 +5147,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_set_property(duckdb_v2 * a concrete return type. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the bind callback of. * @param callback The bind callback to set. @@ -4608,7 +5158,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_set_property(duckdb_v2 DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_set_bind_callback( duckdb_v2_aggregate_function_handle function, duckdb_v2_aggregate_function_bind_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the size callback of the aggregate function. * @@ -4617,7 +5169,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_set_bind_callback( * be set before registration. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the size callback of. * @param callback The size callback to set. @@ -4628,7 +5180,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_set_bind_callback( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_set_size_callback( duckdb_v2_aggregate_function_handle function, duckdb_v2_aggregate_function_size_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the init callback of the aggregate function. * @@ -4636,7 +5190,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_set_size_callback( * `duckdb_v2_aggregate_function_init_get_states()`. An init callback must be set before registration. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the init callback of. * @param callback The init callback to set. @@ -4647,7 +5201,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_set_size_callback( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_set_init_callback( duckdb_v2_aggregate_function_handle function, duckdb_v2_aggregate_function_init_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the update callback of the aggregate function. * @@ -4655,7 +5211,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_set_init_callback( * be aggregated into state i of the state array. An update callback must be set before registration. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the update callback of. * @param callback The update callback to set. @@ -4666,7 +5222,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_set_init_callback( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_set_update_callback( duckdb_v2_aggregate_function_handle function, duckdb_v2_aggregate_function_update_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the combine callback of the aggregate function. * @@ -4674,7 +5232,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_set_update_callback( * target state i. A combine callback must be set before registration. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the combine callback of. * @param callback The combine callback to set. @@ -4685,7 +5243,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_set_update_callback( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_set_combine_callback( duckdb_v2_aggregate_function_handle function, duckdb_v2_aggregate_function_combine_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the finalize callback of the aggregate function. * @@ -4693,7 +5253,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_set_combine_callback( * result vector. A finalize callback must be set before registration. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the finalize callback of. * @param callback The finalize callback to set. @@ -4704,14 +5264,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_set_combine_callback( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_set_finalize_callback( duckdb_v2_aggregate_function_handle function, duckdb_v2_aggregate_function_finalize_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the destroy callback for the aggregate function. Optional: only needed when aggregate states own resources that * must be released. The callback runs on states that are discarded without being finalized; it must not fail, an error * reported through its error slot is ignored. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the destroy callback of. * @param callback The destroy callback to set. @@ -4722,7 +5284,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_set_finalize_callback( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_set_destroy_callback( duckdb_v2_aggregate_function_handle function, duckdb_v2_aggregate_function_destroy_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the concrete return type of the call site being bound. * @@ -4731,7 +5295,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_set_destroy_callback( * type is borrowed and copied. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param return_type The return type to set. Borrowed for the call only. @@ -4742,12 +5306,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_set_destroy_callback( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_bind_set_return_type( duckdb_v2_aggregate_function_bind_info_handle info, duckdb_v2_logical_type_handle return_type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_aggregate_function_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The size info handle. * @param data Receives the user data pointer, or null if none was set. @@ -4757,12 +5323,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_bind_set_return_type( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_size_get_user_data( duckdb_v2_aggregate_function_size_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the bind data set by the function's bind callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The size info handle. * @param data Receives the bind data pointer, or null if none was set. @@ -4772,13 +5340,15 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_size_get_user_data( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_size_get_bind_data( duckdb_v2_aggregate_function_size_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the size of a single aggregate state, in bytes. The size callback must set this; DuckDB uses it to allocate * state memory. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The size info handle. * @param size The size of a single aggregate state, in bytes. @@ -4788,12 +5358,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_size_get_bind_data( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_size_set_state_size( duckdb_v2_aggregate_function_size_info_handle info, idx_t size, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_aggregate_function_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The init info handle. * @param data Receives the user data pointer, or null if none was set. @@ -4803,12 +5375,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_size_set_state_size( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_init_get_user_data( duckdb_v2_aggregate_function_init_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the bind data set by the function's bind callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The init info handle. * @param data Receives the bind data pointer, or null if none was set. @@ -4818,13 +5392,15 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_init_get_user_data( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_init_get_bind_data( duckdb_v2_aggregate_function_init_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns how many aggregate states this invocation must initialize. This is the length of the array returned by * `duckdb_v2_aggregate_function_init_get_states()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The init info handle. * @param count Receives the number of states. @@ -4834,13 +5410,15 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_init_get_bind_data( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_init_get_state_count( duckdb_v2_aggregate_function_init_info_handle info, idx_t *count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the array of aggregate states to initialize, one pointer per state. Each state points to uninitialized memory * of the size reported by the size callback; the init callback must initialize all of them in place. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The init info handle. * @param states Receives the array of aggregate state pointers. Borrowed; valid only for the duration of the callback. @@ -4850,12 +5428,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_init_get_state_count( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_init_get_states( duckdb_v2_aggregate_function_init_info_handle info, void ***states, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_aggregate_function_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The update info handle. * @param data Receives the user data pointer, or null if none was set. @@ -4865,12 +5445,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_init_get_states( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_update_get_user_data( duckdb_v2_aggregate_function_update_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the bind data set by the function's bind callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The update info handle. * @param data Receives the bind data pointer, or null if none was set. @@ -4880,13 +5462,15 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_update_get_user_data( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_update_get_bind_data( duckdb_v2_aggregate_function_update_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns how many input rows this invocation carries. This is the length of the argument vectors and of the state * array: row i of every argument vector must be aggregated into state i. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The update info handle. * @param count Receives the number of rows. @@ -4896,7 +5480,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_update_get_bind_data( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_update_get_row_count( duckdb_v2_aggregate_function_update_info_handle info, idx_t *count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns how many argument vectors this invocation carries, split into the four parts of the argument list. * @@ -4905,7 +5491,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_update_get_row_count( * the four counts). Every out-parameter may be NULL, in which case nothing is written to it. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The update info handle. * @param positional_fixed Optional. Receives the number of positional-only and standard parameters. @@ -4920,7 +5506,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_update_get_row_count( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_update_get_arg_count( duckdb_v2_aggregate_function_update_info_handle info, idx_t *positional_fixed, idx_t *positional_variadic, idx_t *named_fixed, idx_t *named_variadic, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the argument vector at the given index. * @@ -4930,7 +5518,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_update_get_arg_count( * bounds. Borrowed; valid only for the duration of the callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The update info handle. * @param index The index of the argument. @@ -4942,13 +5530,15 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_update_get_arg_count( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_update_get_arg(duckdb_v2_aggregate_function_update_info_handle info, idx_t index, duckdb_v2_vector_handle *vector, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the array of aggregate states to update, one pointer per input row: row i of every argument vector must be * aggregated into state i. Different rows may point to the same state. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The update info handle. * @param states Receives the array of aggregate state pointers. Borrowed; valid only for the duration of the callback. @@ -4958,12 +5548,14 @@ duckdb_v2_aggregate_function_update_get_arg(duckdb_v2_aggregate_function_update_ */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_update_get_states( duckdb_v2_aggregate_function_update_info_handle info, void ***states, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_aggregate_function_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The combine info handle. * @param data Receives the user data pointer, or null if none was set. @@ -4973,12 +5565,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_update_get_states( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_combine_get_user_data( duckdb_v2_aggregate_function_combine_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the bind data set by the function's bind callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The combine info handle. * @param data Receives the bind data pointer, or null if none was set. @@ -4988,13 +5582,15 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_combine_get_user_data( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_combine_get_bind_data( duckdb_v2_aggregate_function_combine_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns how many source/target state pairs this invocation must combine. This is the length of both the sources and * the targets array. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The combine info handle. * @param count Receives the number of state pairs. @@ -5004,13 +5600,15 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_combine_get_bind_data( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_combine_get_state_count( duckdb_v2_aggregate_function_combine_info_handle info, idx_t *count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the array of source aggregate states, one pointer per pair. Source i must be combined into target i; the * source must not be modified. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The combine info handle. * @param states Receives the array of source aggregate state pointers. Borrowed; valid only for the duration of the @@ -5021,12 +5619,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_combine_get_state_coun */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_combine_get_sources( duckdb_v2_aggregate_function_combine_info_handle info, void ***states, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the array of target aggregate states, one pointer per pair. Source i must be combined into target i. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The combine info handle. * @param states Receives the array of target aggregate state pointers. Borrowed; valid only for the duration of the @@ -5037,12 +5637,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_combine_get_sources( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_combine_get_targets( duckdb_v2_aggregate_function_combine_info_handle info, void ***states, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_aggregate_function_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The finalize info handle. * @param data Receives the user data pointer, or null if none was set. @@ -5052,12 +5654,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_combine_get_targets( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_finalize_get_user_data( duckdb_v2_aggregate_function_finalize_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the bind data set by the function's bind callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The finalize info handle. * @param data Receives the bind data pointer, or null if none was set. @@ -5067,13 +5671,15 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_finalize_get_user_data */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_finalize_get_bind_data( duckdb_v2_aggregate_function_finalize_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns how many aggregate states this invocation must finalize. This is the length of the state array and the number * of rows to write to the result vector. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The finalize info handle. * @param count Receives the number of states. @@ -5083,13 +5689,15 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_finalize_get_bind_data */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_finalize_get_state_count( duckdb_v2_aggregate_function_finalize_info_handle info, idx_t *count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the array of aggregate states to finalize, one pointer per state. State i must be finalized into result row * offset + i. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The finalize info handle. * @param states Receives the array of aggregate state pointers. Borrowed; valid only for the duration of the callback. @@ -5099,7 +5707,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_finalize_get_state_cou */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_finalize_get_states( duckdb_v2_aggregate_function_finalize_info_handle info, void ***states, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the result vector the finalize callback must write into. * @@ -5107,7 +5717,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_finalize_get_states( * `duckdb_v2_aggregate_function_finalize_get_result_offset()`. Borrowed; valid only for the duration of the callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The finalize info handle. * @param vector Receives the borrowed result vector to write into. @@ -5118,13 +5728,15 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_finalize_get_states( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_finalize_get_result(duckdb_v2_aggregate_function_finalize_info_handle info, duckdb_v2_vector_handle *vector, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the offset in the result vector at which to start writing: state i must be finalized into result row offset + * i. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The finalize info handle. * @param offset Receives the result offset. @@ -5134,12 +5746,14 @@ duckdb_v2_aggregate_function_finalize_get_result(duckdb_v2_aggregate_function_fi */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_finalize_get_result_offset( duckdb_v2_aggregate_function_finalize_info_handle info, idx_t *offset, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_aggregate_function_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The destroy info handle. * @param data Receives the user data pointer, or null if none was set. @@ -5149,12 +5763,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_finalize_get_result_of */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_destroy_get_user_data( duckdb_v2_aggregate_function_destroy_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the bind data set by the function's bind callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The destroy info handle. * @param data Receives the bind data pointer, or null if none was set. @@ -5164,12 +5780,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_destroy_get_user_data( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_destroy_get_bind_data( duckdb_v2_aggregate_function_destroy_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns how many aggregate states this invocation must destroy. This is the length of the state array. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The destroy info handle. * @param count Receives the number of states. @@ -5179,13 +5797,15 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_destroy_get_bind_data( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_destroy_get_state_count( duckdb_v2_aggregate_function_destroy_info_handle info, idx_t *count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the array of aggregate states to destroy, one pointer per state. The callback must release any resources the * states own. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The destroy info handle. * @param states Receives the array of aggregate state pointers. Borrowed; valid only for the duration of the callback. @@ -5195,7 +5815,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_destroy_get_state_coun */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_destroy_get_states( duckdb_v2_aggregate_function_destroy_info_handle info, void ***states, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Registers the aggregate function, making it available for use in SQL queries. * @@ -5208,7 +5830,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_destroy_get_states( * `duckdb_v2_aggregate_function_destroy()`, which does not affect the registered function. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param conn The connection to register on. * @param function The aggregate function to register. @@ -5218,7 +5840,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_destroy_get_states( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_register_aggregate_function( duckdb_v2_connection_handle conn, duckdb_v2_aggregate_function_handle function, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Registers the aggregate function, making it available for use in SQL queries. * @@ -5230,7 +5854,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_register_aggregate_function( * `duckdb_v2_aggregate_function_destroy()`, which does not affect the registered function. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param extension The loading extension. * @param function The aggregate function to register. @@ -5241,7 +5865,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_register_aggregate_function( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_extension_register_aggregate_function( duckdb_v2_extension_handle extension, duckdb_v2_aggregate_function_handle function, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys the aggregate function, releasing its resources. * @@ -5249,12 +5875,13 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_extension_register_aggregate_function( * double-destruction. Destroying the handle after registration does not affect the registered function. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_aggregate_function_destroy(duckdb_v2_aggregate_function_handle *function); +#endif /* --- Struct definitions for aggregate --- */ @@ -5295,6 +5922,7 @@ typedef struct _duckdb_v2_column_description { /* --- Functions for catalog --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Resolves a table name and snapshots its description. * @@ -5306,7 +5934,7 @@ typedef struct _duckdb_v2_column_description { * a base table. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param conn The connection whose catalogs and search path resolve the name. * @param name The possibly partial table name to resolve. Borrowed for the call only. @@ -5319,7 +5947,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_describe_table(duckdb_v2_conne duckdb_v2_qname_handle name, duckdb_v2_table_description_handle *desc, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the resolved qualified name of the described table. * @@ -5328,7 +5958,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_describe_table(duckdb_v2_conne * described table regardless of search path. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param desc The description. * @param name Receives the owned resolved name. Destroy via `duckdb_v2_qname_destroy()`. @@ -5339,7 +5969,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_describe_table(duckdb_v2_conne DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_description_get_qname(duckdb_v2_table_description_handle desc, duckdb_v2_qname_handle *name, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns whether the described table's catalog is read-only. * @@ -5347,7 +5979,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_description_get_qname(duckdb_v2_tab * False does not by itself prove a write will succeed; it clears the catalog-level check only. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param desc The description. * @param readonly Receives whether the catalog is read-only. @@ -5357,7 +5989,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_description_get_qname(duckdb_v2_tab */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_description_is_readonly(duckdb_v2_table_description_handle desc, bool *readonly, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the number of columns of the described table. * @@ -5365,7 +5999,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_description_is_readonly(duckdb_v2_t * `duckdb_v2_table_description_get_column()` are [0, count). * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param desc The description. * @param count Receives the column count. @@ -5376,7 +6010,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_description_is_readonly(duckdb_v2_t DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_description_get_column_count(duckdb_v2_table_description_handle desc, idx_t *count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns an owned description of the column at index. * @@ -5384,7 +6020,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_description_get_column_count(duckdb * `ERROR_INPUT_OUT_OF_RANGE`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param desc The description. * @param index Zero-based column index. @@ -5397,7 +6033,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_description_get_column(duckdb_v2_ta idx_t index, duckdb_v2_column_description_handle *column, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys the table description, releasing its resources. * @@ -5405,20 +6043,22 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_description_get_column(duckdb_v2_ta * double-destruction. Column descriptions obtained from it are independent and stay valid. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param desc The description to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_description_destroy(duckdb_v2_table_description_handle *desc); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Borrows the name of the column. * * The name carries the casing the column was declared with. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param column The column description. * @param name Receives a borrowed view of the column name. Valid until the column description is destroyed. @@ -5429,12 +6069,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_description_destroy(duckdb_v2_table DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_description_get_name(duckdb_v2_column_description_handle column, duckdb_v2_identifier_t *name, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Borrows the type of the column. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param column The column description. * @param type Receives the borrowed column type. Valid until the column description is destroyed; do not destroy it. @@ -5445,7 +6087,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_description_get_name(duckdb_v2_col DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_description_get_type(duckdb_v2_column_description_handle column, duckdb_v2_logical_type_handle *type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns whether the column has a default value. * @@ -5453,7 +6097,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_description_get_type(duckdb_v2_col * columns report false. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param column The column description. * @param has_default Receives whether the column has a default value. @@ -5464,14 +6108,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_description_get_type(duckdb_v2_col DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_description_has_default(duckdb_v2_column_description_handle column, bool *has_default, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns whether the column is generated. * * True when the column is a generated column, computed by the engine from a generation expression and not writable. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param column The column description. * @param has_generated Receives whether the column is generated. @@ -5482,7 +6128,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_description_has_default(duckdb_v2_ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_description_has_generated(duckdb_v2_column_description_handle column, bool *has_generated, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys the column description, releasing its resources. * @@ -5490,12 +6138,13 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_description_has_generated(duckdb_v * double-destruction. Any name or type borrowed from it becomes dangling. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param column The column description to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_column_description_destroy(duckdb_v2_column_description_handle *column); +#endif /* --- Struct definitions for catalog --- */ @@ -5678,6 +6327,7 @@ typedef void (*duckdb_v2_copy_from_progress_callback_fn)(duckdb_v2_copy_from_pro /* --- Functions for copy --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a new copy function through a factory. * @@ -5691,7 +6341,7 @@ typedef void (*duckdb_v2_copy_from_progress_callback_fn)(duckdb_v2_copy_from_pro * The copy function can only be registered on the database the factory belongs to. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create the copy function through. * @param function On success, receives the newly created copy function. Owned by the caller. @@ -5702,7 +6352,9 @@ typedef void (*duckdb_v2_copy_from_progress_callback_fn)(duckdb_v2_copy_from_pro DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_function_create(duckdb_v2_factory_handle factory, duckdb_v2_copy_function_handle *function, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the name of the copy function. * @@ -5711,7 +6363,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_function_create(duckdb_v2_factory_ha * registration. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the name of. * @param name The name to set. Borrowed and copied. @@ -5722,7 +6374,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_function_create(duckdb_v2_factory_ha DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_function_set_name(duckdb_v2_copy_function_handle function, const duckdb_v2_identifier_t *name, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the file extension of the files the copy function writes, without the leading dot, e.g. `parquet`. * @@ -5732,7 +6386,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_function_set_name(duckdb_v2_copy_fun * without it the names DuckDB gives files end in a bare dot, e.g. `data_0.`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the file extension of. * @param extension The extension to set, without the leading dot. Borrowed and copied. @@ -5743,7 +6397,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_function_set_name(duckdb_v2_copy_fun DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_function_set_file_extension(duckdb_v2_copy_function_handle function, const duckdb_v2_str *extension, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets arbitrary user data on the copy function. * @@ -5752,7 +6408,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_function_set_file_extension(duckdb_v * opaque handle bundles the pointer with an optional destructor, invoked when the data is no longer needed. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the user data of. * @param data Opaque handle bundling the user data pointer plus an optional destructor. @@ -5763,7 +6419,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_function_set_file_extension(duckdb_v DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_function_set_user_data(duckdb_v2_copy_function_handle function, duckdb_v2_opaque *data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the optional bind callback of the `COPY ... TO` side. * @@ -5772,7 +6430,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_function_set_user_data(duckdb_v2_cop * shared with the other `COPY ... TO` callbacks. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the callback of. * @param callback The callback to set. @@ -5783,7 +6441,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_function_set_user_data(duckdb_v2_cop DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_set_bind_callback(duckdb_v2_copy_function_handle function, duckdb_v2_copy_to_bind_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the optional batch size callback of the `COPY ... TO` side. * @@ -5795,7 +6455,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_set_bind_callback(duckdb_v2_copy_ * one of a file, or when `BATCH_SIZE_BYTES` cuts it first). * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the callback of. * @param callback The callback to set. @@ -5806,7 +6466,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_set_bind_callback(duckdb_v2_copy_ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_set_batch_size_callback( duckdb_v2_copy_function_handle function, duckdb_v2_copy_to_batch_size_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the optional init callback of the `COPY ... TO` side. * @@ -5816,7 +6478,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_set_batch_size_callback( * each gets its own init data. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the callback of. * @param callback The callback to set. @@ -5827,7 +6489,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_set_batch_size_callback( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_set_init_callback(duckdb_v2_copy_function_handle function, duckdb_v2_copy_to_init_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the batch callback of the `COPY ... TO` side. * @@ -5838,7 +6502,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_set_init_callback(duckdb_v2_copy_ * A batch callback must be set for the `COPY ... TO` side to be registered. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the callback of. * @param callback The callback to set. @@ -5849,7 +6513,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_set_init_callback(duckdb_v2_copy_ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_set_batch_callback(duckdb_v2_copy_function_handle function, duckdb_v2_copy_to_batch_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the flush callback of the `COPY ... TO` side. * @@ -5858,7 +6524,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_set_batch_callback(duckdb_v2_copy * callback must be set for the `COPY ... TO` side to be registered. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the callback of. * @param callback The callback to set. @@ -5869,7 +6535,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_set_batch_callback(duckdb_v2_copy DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_set_flush_callback(duckdb_v2_copy_function_handle function, duckdb_v2_copy_to_flush_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the optional finalize callback of the `COPY ... TO` side. * @@ -5877,7 +6545,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_set_flush_callback(duckdb_v2_copy * It can e.g. write a footer and close the file. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the callback of. * @param callback The callback to set. @@ -5888,12 +6556,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_set_flush_callback(duckdb_v2_copy DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_set_finalize_callback(duckdb_v2_copy_function_handle function, duckdb_v2_copy_to_finalize_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_copy_function_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param data Receives the user data pointer, or null if none was set. @@ -5903,7 +6573,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_set_finalize_callback(duckdb_v2_c */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_bind_get_user_data(duckdb_v2_copy_to_bind_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the function's "bind data" from the bind callback. * @@ -5912,7 +6584,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_bind_get_user_data(duckdb_v2_copy * optional equality callback used when comparing two bound statements; without one, pointer equality is used. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param data Opaque handle bundling the bind data pointer plus optional destructor and equality callbacks. @@ -5923,7 +6595,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_bind_get_user_data(duckdb_v2_copy DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_bind_set_bind_data(duckdb_v2_copy_to_bind_info_handle info, duckdb_v2_opaque *data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the path the `COPY ... TO` statement writes to, as written in the statement. * @@ -5932,7 +6606,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_bind_set_bind_data(duckdb_v2_copy * path is borrowed and valid only for the duration of the callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param path Receives a borrowed view of the file path. Valid only for the duration of the callback. @@ -5943,7 +6617,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_bind_set_bind_data(duckdb_v2_copy DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_bind_get_file_path(duckdb_v2_copy_to_bind_info_handle info, duckdb_v2_str *path, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the number of columns being written, i.e. the columns of the rows every batch carries. * @@ -5951,7 +6627,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_bind_get_file_path(duckdb_v2_copy * count). * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param count Receives the number of columns. @@ -5961,7 +6637,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_bind_get_file_path(duckdb_v2_copy */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_bind_get_column_count(duckdb_v2_copy_to_bind_info_handle info, idx_t *count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the type of the column at the given index. * @@ -5969,7 +6647,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_bind_get_column_count(duckdb_v2_c * `duckdb_v2_logical_type_destroy()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param index The index of the column to get the type of. @@ -5981,14 +6659,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_bind_get_column_count(duckdb_v2_c DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_bind_get_column_type(duckdb_v2_copy_to_bind_info_handle info, idx_t index, duckdb_v2_logical_type_handle *type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the name of the column at the given index. * * Fails if the index is out of bounds. The name is borrowed and valid only for the duration of the callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param index The index of the column to get the name of. @@ -6000,7 +6680,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_bind_get_column_type(duckdb_v2_co DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_bind_get_column_name(duckdb_v2_copy_to_bind_info_handle info, idx_t index, duckdb_v2_identifier_t *name, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the number of options the `COPY` statement passed to the function. * @@ -6009,7 +6691,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_bind_get_column_name(duckdb_v2_co * `duckdb_v2_copy_to_bind_get_option_value()` are [0, count). The options are ordered by name. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param count Receives the number of options. @@ -6019,7 +6701,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_bind_get_column_name(duckdb_v2_co */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_bind_get_option_count(duckdb_v2_copy_to_bind_info_handle info, idx_t *count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the name of the option at the given index. * @@ -6027,7 +6711,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_bind_get_option_count(duckdb_v2_c * borrowed and valid only for the duration of the callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param index The index of the option to get the name of. @@ -6039,7 +6723,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_bind_get_option_count(duckdb_v2_c DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_bind_get_option_name(duckdb_v2_copy_to_bind_info_handle info, idx_t index, duckdb_v2_identifier_t *name, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the value of the option at the given index. * @@ -6049,7 +6735,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_bind_get_option_name(duckdb_v2_co * owned by the caller and must be destroyed via `duckdb_v2_value_destroy()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param index The index of the option. @@ -6061,12 +6747,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_bind_get_option_name(duckdb_v2_co DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_bind_get_option_value(duckdb_v2_copy_to_bind_info_handle info, idx_t index, duckdb_v2_value_handle *value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_copy_function_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The batch size info handle. * @param data Receives the user data pointer, or null if none was set. @@ -6076,12 +6764,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_bind_get_option_value(duckdb_v2_c */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_batch_size_get_user_data(duckdb_v2_copy_to_batch_size_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the bind data set by the function's `COPY ... TO` bind callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The batch size info handle. * @param data Receives the bind data pointer, or null if none was set. @@ -6091,14 +6781,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_batch_size_get_user_data(duckdb_v */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_batch_size_get_bind_data(duckdb_v2_copy_to_batch_size_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the number of rows a batch should carry, as the target the engine cuts batches at. The batch size callback must * set this to a value greater than 0; the statement fails otherwise. DuckDB defines the `BATCH_SIZE` on omission of * calling the function. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The batch size info handle. * @param rows The number of rows a batch should carry. Must be greater than 0. @@ -6108,12 +6800,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_batch_size_get_bind_data(duckdb_v */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_batch_size_set_target(duckdb_v2_copy_to_batch_size_info_handle info, idx_t rows, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_copy_function_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The init info handle. * @param data Receives the user data pointer, or null if none was set. @@ -6123,12 +6817,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_batch_size_set_target(duckdb_v2_c */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_init_get_user_data(duckdb_v2_copy_to_init_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the bind data set by the function's `COPY ... TO` bind callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The init info handle. * @param data Receives the bind data pointer, or null if none was set. @@ -6138,7 +6834,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_init_get_user_data(duckdb_v2_copy */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_init_get_bind_data(duckdb_v2_copy_to_init_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the path of the file the init callback is preparing. * @@ -6147,7 +6845,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_init_get_bind_data(duckdb_v2_copy * duration of the callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The init info handle. * @param path Receives a borrowed view of the file path. Valid only for the duration of the callback. @@ -6158,7 +6856,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_init_get_bind_data(duckdb_v2_copy DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_init_get_file_path(duckdb_v2_copy_to_init_info_handle info, duckdb_v2_str *path, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the function's "init data" from the init callback. * @@ -6168,7 +6868,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_init_get_file_path(duckdb_v2_copy * the file is done with the data. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The init info handle. * @param data Opaque handle bundling the init data pointer plus an optional destructor. @@ -6179,12 +6879,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_init_get_file_path(duckdb_v2_copy DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_init_set_init_data(duckdb_v2_copy_to_init_info_handle info, duckdb_v2_opaque *data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_copy_function_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The batch info handle. * @param data Receives the user data pointer, or null if none was set. @@ -6194,12 +6896,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_init_set_init_data(duckdb_v2_copy */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_batch_get_user_data(duckdb_v2_copy_to_batch_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the bind data set by the function's `COPY ... TO` bind callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The batch info handle. * @param data Receives the bind data pointer, or null if none was set. @@ -6209,12 +6913,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_batch_get_user_data(duckdb_v2_cop */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_batch_get_bind_data(duckdb_v2_copy_to_batch_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the init data set by the function's `COPY ... TO` init callback for the file this batch belongs to. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The batch info handle. * @param data Receives the init data pointer, or null if none was set. @@ -6224,7 +6930,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_batch_get_bind_data(duckdb_v2_cop */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_batch_get_init_data(duckdb_v2_copy_to_batch_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Takes ownership of the rows of the batch to prepare. * @@ -6235,7 +6943,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_batch_get_init_data(duckdb_v2_cop * is never taken is destroyed when the callback returns. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The batch info handle. * @param collection Receives the collection holding the rows of the batch. Owned by the caller; destroy via @@ -6247,7 +6955,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_batch_get_init_data(duckdb_v2_cop DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_batch_take_input(duckdb_v2_copy_to_batch_info_handle info, duckdb_v2_column_data_collection_handle *collection, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the prepared "batch data" from the batch callback. * @@ -6256,7 +6966,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_batch_take_input(duckdb_v2_copy_t * invoked once the batch has been flushed. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The batch info handle. * @param data Opaque handle bundling the batch data pointer plus an optional destructor. @@ -6267,12 +6977,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_batch_take_input(duckdb_v2_copy_t DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_batch_set_batch_data(duckdb_v2_copy_to_batch_info_handle info, duckdb_v2_opaque *data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_copy_function_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The flush info handle. * @param data Receives the user data pointer, or null if none was set. @@ -6282,12 +6994,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_batch_set_batch_data(duckdb_v2_co */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_flush_get_user_data(duckdb_v2_copy_to_flush_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the bind data set by the function's `COPY ... TO` bind callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The flush info handle. * @param data Receives the bind data pointer, or null if none was set. @@ -6297,12 +7011,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_flush_get_user_data(duckdb_v2_cop */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_flush_get_bind_data(duckdb_v2_copy_to_flush_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the init data set by the function's `COPY ... TO` init callback for the file this batch belongs to. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The flush info handle. * @param data Receives the init data pointer, or null if none was set. @@ -6312,12 +7028,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_flush_get_bind_data(duckdb_v2_cop */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_flush_get_init_data(duckdb_v2_copy_to_flush_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the batch data set by the function's batch callback for the batch being flushed. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The flush info handle. * @param data Receives the batch data pointer, or null if none was set. @@ -6327,12 +7045,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_flush_get_init_data(duckdb_v2_cop */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_flush_get_batch_data(duckdb_v2_copy_to_flush_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_copy_function_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The finalize info handle. * @param data Receives the user data pointer, or null if none was set. @@ -6342,12 +7062,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_flush_get_batch_data(duckdb_v2_co */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_finalize_get_user_data(duckdb_v2_copy_to_finalize_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the bind data set by the function's `COPY ... TO` bind callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The finalize info handle. * @param data Receives the bind data pointer, or null if none was set. @@ -6357,12 +7079,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_finalize_get_user_data(duckdb_v2_ */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_finalize_get_bind_data(duckdb_v2_copy_to_finalize_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the init data set by the function's `COPY ... TO` init callback for the file being finalized. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The finalize info handle. * @param data Receives the init data pointer, or null if none was set. @@ -6372,7 +7096,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_finalize_get_bind_data(duckdb_v2_ */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_finalize_get_init_data(duckdb_v2_copy_to_finalize_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the bind callback of the `COPY ... FROM` side. * @@ -6383,7 +7109,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_finalize_get_init_data(duckdb_v2_ * bind callback must be set for the `COPY ... FROM` side to be registered. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the callback of. * @param callback The callback to set. @@ -6394,7 +7120,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_to_finalize_get_init_data(duckdb_v2_ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_set_bind_callback(duckdb_v2_copy_function_handle function, duckdb_v2_copy_from_bind_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the optional global init callback of the `COPY ... FROM` side. * @@ -6403,7 +7131,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_set_bind_callback(duckdb_v2_cop * `duckdb_v2_copy_from_init_global_set_max_threads()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the callback of. * @param callback The callback to set. @@ -6414,7 +7142,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_set_bind_callback(duckdb_v2_cop DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_set_init_global_callback( duckdb_v2_copy_function_handle function, duckdb_v2_copy_from_init_global_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the optional local init callback of the `COPY ... FROM` side. * @@ -6422,7 +7152,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_set_init_global_callback( * retrievable from the exec callback, typically derived from the shared global state. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the callback of. * @param callback The callback to set. @@ -6433,7 +7163,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_set_init_global_callback( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_set_init_local_callback( duckdb_v2_copy_function_handle function, duckdb_v2_copy_from_init_local_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the exec callback of the `COPY ... FROM` side. * @@ -6442,7 +7174,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_set_init_local_callback( * set for the `COPY ... FROM` side to be registered. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the callback of. * @param callback The callback to set. @@ -6453,7 +7185,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_set_init_local_callback( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_set_exec_callback(duckdb_v2_copy_function_handle function, duckdb_v2_copy_from_exec_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the optional progress callback of the `COPY ... FROM` side. * @@ -6462,7 +7196,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_set_exec_callback(duckdb_v2_cop * in a thread-safe way. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the callback of. * @param callback The callback to set. @@ -6473,12 +7207,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_set_exec_callback(duckdb_v2_cop DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_set_progress_callback( duckdb_v2_copy_function_handle function, duckdb_v2_copy_from_progress_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_copy_function_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param data Receives the user data pointer, or null if none was set. @@ -6488,7 +7224,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_set_progress_callback( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_bind_get_user_data(duckdb_v2_copy_from_bind_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the function's "bind data" from the bind callback. * @@ -6497,7 +7235,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_bind_get_user_data(duckdb_v2_co * optional equality callback used when comparing two bound statements; without one, pointer equality is used. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param data Opaque handle bundling the bind data pointer plus optional destructor and equality callbacks. @@ -6508,7 +7246,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_bind_get_user_data(duckdb_v2_co DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_bind_set_bind_data(duckdb_v2_copy_from_bind_info_handle info, duckdb_v2_opaque *data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the path the `COPY ... FROM` statement reads from, as written in the statement. * @@ -6516,7 +7256,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_bind_set_bind_data(duckdb_v2_co * and valid only for the duration of the callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param path Receives a borrowed view of the file path. Valid only for the duration of the callback. @@ -6527,7 +7267,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_bind_set_bind_data(duckdb_v2_co DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_bind_get_file_path(duckdb_v2_copy_from_bind_info_handle info, duckdb_v2_str *path, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the number of columns the target table expects, i.e. the columns every batch the exec callback produces must * carry, in this order. @@ -6536,7 +7278,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_bind_get_file_path(duckdb_v2_co * [0, count). * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param count Receives the number of columns. @@ -6546,7 +7288,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_bind_get_file_path(duckdb_v2_co */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_bind_get_column_count(duckdb_v2_copy_from_bind_info_handle info, idx_t *count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the type of the column at the given index. * @@ -6554,7 +7298,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_bind_get_column_count(duckdb_v2 * `duckdb_v2_logical_type_destroy()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param index The index of the column to get the type of. @@ -6566,14 +7310,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_bind_get_column_count(duckdb_v2 DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_bind_get_column_type(duckdb_v2_copy_from_bind_info_handle info, idx_t index, duckdb_v2_logical_type_handle *type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the name of the column at the given index. * * Fails if the index is out of bounds. The name is borrowed and valid only for the duration of the callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param index The index of the column to get the name of. @@ -6585,7 +7331,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_bind_get_column_type(duckdb_v2_ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_bind_get_column_name(duckdb_v2_copy_from_bind_info_handle info, idx_t index, duckdb_v2_identifier_t *name, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the number of options the `COPY` statement passed to the function. * @@ -6593,7 +7341,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_bind_get_column_name(duckdb_v2_ * `duckdb_v2_copy_from_bind_get_option_value()` are [0, count). The options are ordered by name. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param count Receives the number of options. @@ -6603,7 +7351,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_bind_get_column_name(duckdb_v2_ */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_bind_get_option_count(duckdb_v2_copy_from_bind_info_handle info, idx_t *count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the name of the option at the given index. * @@ -6611,7 +7361,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_bind_get_option_count(duckdb_v2 * borrowed and valid only for the duration of the callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param index The index of the option to get the name of. @@ -6623,7 +7373,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_bind_get_option_count(duckdb_v2 DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_bind_get_option_name(duckdb_v2_copy_from_bind_info_handle info, idx_t index, duckdb_v2_identifier_t *name, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the value of the option at the given index. * @@ -6633,7 +7385,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_bind_get_option_name(duckdb_v2_ * owned by the caller and must be destroyed via `duckdb_v2_value_destroy()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param index The index of the option. @@ -6645,7 +7397,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_bind_get_option_name(duckdb_v2_ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_bind_get_option_value(duckdb_v2_copy_from_bind_info_handle info, idx_t index, duckdb_v2_value_handle *value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Reports the estimated number of rows the read will produce. * @@ -6653,7 +7407,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_bind_get_option_value(duckdb_v2 * it, the optimizer falls back on its own defaults. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param cardinality The estimated number of rows. @@ -6665,12 +7419,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_bind_get_option_value(duckdb_v2 DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_bind_set_cardinality(duckdb_v2_copy_from_bind_info_handle info, idx_t cardinality, bool is_exact, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_copy_function_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The global init info handle. * @param data Receives the user data pointer, or null if none was set. @@ -6680,12 +7436,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_bind_set_cardinality(duckdb_v2_ */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_init_global_get_user_data( duckdb_v2_copy_from_init_global_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the bind data set by the function's `COPY ... FROM` bind callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The global init info handle. * @param data Receives the bind data pointer, or null if none was set. @@ -6695,7 +7453,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_init_global_get_user_data( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_init_global_get_bind_data( duckdb_v2_copy_from_init_global_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the function's "global state" from the global init callback. * @@ -6704,7 +7464,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_init_global_get_bind_data( * handle bundles the pointer with an optional destructor, invoked when the read is done with the state. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The global init info handle. * @param data Opaque handle bundling the global state pointer plus an optional destructor. @@ -6714,7 +7474,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_init_global_get_bind_data( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_init_global_set_global_state( duckdb_v2_copy_from_init_global_info_handle info, duckdb_v2_opaque *data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets how many threads may read the file in parallel. * @@ -6722,7 +7484,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_init_global_set_global_state( * this many exec callbacks concurrently. It is an upper bound, not a request: the engine may use fewer threads. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The global init info handle. * @param max_threads The maximum number of threads. Must be at least 1. @@ -6732,12 +7494,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_init_global_set_global_state( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_init_global_set_max_threads( duckdb_v2_copy_from_init_global_info_handle info, idx_t max_threads, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_copy_function_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The local init info handle. * @param data Receives the user data pointer, or null if none was set. @@ -6747,12 +7511,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_init_global_set_max_threads( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_init_local_get_user_data( duckdb_v2_copy_from_init_local_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the bind data set by the function's `COPY ... FROM` bind callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The local init info handle. * @param data Receives the bind data pointer, or null if none was set. @@ -6762,14 +7528,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_init_local_get_user_data( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_init_local_get_bind_data( duckdb_v2_copy_from_init_local_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the global state set by the function's global init callback. * * Shared with every other thread reading the file; access to it must be synchronized by the function. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The local init info handle. * @param data Receives the global state pointer, or null if none was set. @@ -6779,7 +7547,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_init_local_get_bind_data( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_init_local_get_global_state( duckdb_v2_copy_from_init_local_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the function's worker-local "local state" from the local init callback. * @@ -6789,7 +7559,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_init_local_get_global_state( * no longer needed. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The local init info handle. * @param data Opaque handle bundling the local state pointer plus an optional destructor. @@ -6799,12 +7569,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_init_local_get_global_state( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_init_local_set_local_state( duckdb_v2_copy_from_init_local_info_handle info, duckdb_v2_opaque *data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_copy_function_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The exec info handle. * @param data Receives the user data pointer, or null if none was set. @@ -6814,12 +7586,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_init_local_set_local_state( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_exec_get_user_data(duckdb_v2_copy_from_exec_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the bind data set by the function's `COPY ... FROM` bind callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The exec info handle. * @param data Receives the bind data pointer, or null if none was set. @@ -6829,14 +7603,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_exec_get_user_data(duckdb_v2_co */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_exec_get_bind_data(duckdb_v2_copy_from_exec_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the global state set by the function's global init callback. * * Shared with every other thread reading the file; access to it must be synchronized by the function. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The exec info handle. * @param data Receives the global state pointer, or null if none was set. @@ -6846,12 +7622,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_exec_get_bind_data(duckdb_v2_co */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_exec_get_global_state(duckdb_v2_copy_from_exec_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the worker-local local state set by the function's local init callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The exec info handle. * @param data Receives the local state pointer for the executing thread, or null if none was set. @@ -6861,7 +7639,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_exec_get_global_state(duckdb_v2 */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_exec_get_local_state(duckdb_v2_copy_from_exec_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the output chunk the exec callback must write the next batch of rows into. * @@ -6872,7 +7652,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_exec_get_local_state(duckdb_v2_ * which the callback is not invoked again on that thread. Borrowed; valid only for the duration of the callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The exec info handle. * @param chunk Receives the borrowed output chunk to write into. @@ -6883,12 +7663,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_exec_get_local_state(duckdb_v2_ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_exec_get_output_chunk(duckdb_v2_copy_from_exec_info_handle info, duckdb_v2_data_chunk_handle *chunk, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_copy_function_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The progress info handle. * @param data Receives the user data pointer, or null if none was set. @@ -6898,12 +7680,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_exec_get_output_chunk(duckdb_v2 */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_progress_get_user_data(duckdb_v2_copy_from_progress_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the bind data set by the function's `COPY ... FROM` bind callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The progress info handle. * @param data Receives the bind data pointer, or null if none was set. @@ -6913,7 +7697,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_progress_get_user_data(duckdb_v */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_progress_get_bind_data(duckdb_v2_copy_from_progress_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the global state set by the function's global init callback. * @@ -6921,7 +7707,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_progress_get_bind_data(duckdb_v * a thread-safe way. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The progress info handle. * @param data Receives the global state pointer, or null if none was set. @@ -6931,7 +7717,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_progress_get_bind_data(duckdb_v */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_progress_get_global_state( duckdb_v2_copy_from_progress_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Reports how far the read has advanced. * @@ -6939,7 +7727,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_progress_get_global_state( * that returns without calling this reports no progress. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The progress info handle. * @param progress The fraction of the read that is complete, in [0.0, 1.0]. @@ -6950,7 +7738,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_progress_get_global_state( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_progress_set_progress(duckdb_v2_copy_from_progress_info_handle info, double progress, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Registers the copy function, making it available as a `COPY` format. * @@ -6963,7 +7753,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_progress_set_progress(duckdb_v2 * `duckdb_v2_copy_function_destroy()`, which does not affect the registered function. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param conn The connection to register on. * @param function The copy function to register. @@ -6974,7 +7764,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_from_progress_set_progress(duckdb_v2 DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_register_copy_function(duckdb_v2_connection_handle conn, duckdb_v2_copy_function_handle function, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Registers the copy function, making it available as a `COPY` format. * @@ -6986,7 +7778,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_register_copy_function(duckdb_ * `duckdb_v2_copy_function_destroy()`, which does not affect the registered function. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param extension The loading extension. * @param function The copy function to register. @@ -6997,7 +7789,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_register_copy_function(duckdb_ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_extension_register_copy_function(duckdb_v2_extension_handle extension, duckdb_v2_copy_function_handle function, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys the copy function, releasing its resources. * @@ -7005,12 +7799,13 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_extension_register_copy_function(duckdb_v * double-destruction. Destroying the handle after registration does not affect the registered function. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_copy_function_destroy(duckdb_v2_copy_function_handle *function); +#endif #if DUCKDB_V2_API_ALLOW_UNSTABLE /*! @@ -7162,6 +7957,7 @@ typedef void (*duckdb_v2_custom_option_update_callback_fn)(duckdb_v2_custom_opti /* --- Functions for custom_option --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a new custom option through a factory. * @@ -7172,7 +7968,7 @@ typedef void (*duckdb_v2_custom_option_update_callback_fn)(duckdb_v2_custom_opti * The custom option can only be registered on the instance the factory belongs to. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create the custom option through. * @param option On success, receives the newly created custom option. Owned by the caller. @@ -7183,7 +7979,9 @@ typedef void (*duckdb_v2_custom_option_update_callback_fn)(duckdb_v2_custom_opti DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_create(duckdb_v2_factory_handle factory, duckdb_v2_custom_option_handle *option, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the name of the custom option, as `SET` and the config functions refer to it. * @@ -7191,7 +7989,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_create(duckdb_v2_factory_ha * registration. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param option The option to set the name of. * @param name The name to set. Borrowed and copied. @@ -7202,14 +8000,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_create(duckdb_v2_factory_ha DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_set_name(duckdb_v2_custom_option_handle option, const duckdb_v2_identifier_t *name, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the type of the custom option. Every value written to the option is cast to it, as SQL `SET` does. * * The type is borrowed and copied. Optional when a default value is set, whose type the option then takes. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param option The option to set the type of. * @param type The type to set. Borrowed and copied. @@ -7220,7 +8020,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_set_name(duckdb_v2_custom_o DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_set_type(duckdb_v2_custom_option_handle option, duckdb_v2_logical_type_handle type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the default value of the custom option: its value until it is set, and the value `RESET` restores. * @@ -7228,7 +8030,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_set_type(duckdb_v2_custom_o * Without a default value the option reads as NULL until it is set. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param option The option to set the default value of. * @param value The default value. Borrowed and copied. @@ -7239,14 +8041,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_set_type(duckdb_v2_custom_o DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_set_default_value(duckdb_v2_custom_option_handle option, duckdb_v2_value_handle value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the description of the custom option, as `duckdb_v2_option_get_description()` and `duckdb_settings()` report it. * * The description is borrowed and copied. Calling this again replaces the previous description. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param option The option to set the description of. * @param description The description to set. Borrowed and copied. @@ -7257,7 +8061,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_set_default_value(duckdb_v2 DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_set_description(duckdb_v2_custom_option_handle option, const duckdb_v2_str *description, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the scope a write at `SETTING_SCOPE_DEFAULT` goes to, like SQL `SET name = value`. * @@ -7265,7 +8071,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_set_description(duckdb_v2_c * not support SESSION. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param option The option to set the default scope of. * @param scope The default scope, GLOBAL or SESSION. @@ -7276,7 +8082,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_set_description(duckdb_v2_c DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_set_default_scope(duckdb_v2_custom_option_handle option, DUCKDB_V2_SETTING_SCOPE scope, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets whether the custom option can be written at a scope, as `duckdb_v2_option_supports_scope()` reports it. * @@ -7284,7 +8092,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_set_default_scope(duckdb_v2 * from SQL as from `duckdb_v2_config_set_option_value()`. Registration fails when the option supports neither scope. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param option The option to configure. * @param scope The scope, GLOBAL or SESSION. @@ -7296,7 +8104,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_set_default_scope(duckdb_v2 DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_set_supports_scope(duckdb_v2_custom_option_handle option, DUCKDB_V2_SETTING_SCOPE scope, bool supported, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets arbitrary user data on the custom option. * @@ -7306,7 +8116,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_set_supports_scope(duckdb_v * instance is too. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param option The option to set the user data of. * @param data Opaque handle bundling the user data pointer plus an optional destructor. @@ -7317,7 +8127,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_set_supports_scope(duckdb_v DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_set_user_data(duckdb_v2_custom_option_handle option, duckdb_v2_opaque *data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the optional update callback of the custom option. * @@ -7327,7 +8139,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_set_user_data(duckdb_v2_cus * value at registration, nor for a value given to the instance at startup. The callback must not write options itself. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param option The option to set the update callback of. * @param callback The update callback to set. @@ -7338,12 +8150,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_set_user_data(duckdb_v2_cus DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_set_update_callback( duckdb_v2_custom_option_handle option, duckdb_v2_custom_option_update_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_custom_option_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The update info handle. * @param data Receives the user data pointer, or null if none was set. @@ -7353,14 +8167,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_set_update_callback( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_update_get_user_data( duckdb_v2_custom_option_update_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the value the option is updated to, already cast to the option's type. On a reset this is the default * value, which may be NULL. The returned value is owned by the caller and must be destroyed via * `duckdb_v2_value_destroy()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The update info handle. * @param value Receives the new value. Owned by the caller; destroy via `duckdb_v2_value_destroy()`. @@ -7371,13 +8187,15 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_update_get_user_data( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_update_get_value(duckdb_v2_custom_option_update_info_handle info, duckdb_v2_value_handle *value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Replaces the value the option is updated to, e.g. to normalize it. The value is borrowed and copied, and cast to the * option's type, which fails when the cast does. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The update info handle. * @param value The value to store instead. Borrowed and copied. @@ -7388,13 +8206,15 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_update_get_value(duckdb_v2_ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_update_set_value(duckdb_v2_custom_option_update_info_handle info, duckdb_v2_value_handle value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the scope the value is written at: GLOBAL or SESSION, a DEFAULT write already resolved to the option's * default scope. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The update info handle. * @param scope Receives the scope. @@ -7405,12 +8225,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_update_set_value(duckdb_v2_ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_update_get_scope(duckdb_v2_custom_option_update_info_handle info, DUCKDB_V2_SETTING_SCOPE *scope, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves whether the update is a reset to the default value, like SQL `RESET`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The update info handle. * @param is_reset Receives whether the update is a reset. @@ -7420,7 +8242,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_update_get_scope(duckdb_v2_ */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_update_is_reset(duckdb_v2_custom_option_update_info_handle info, bool *is_reset, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Registers the custom option on the connection's instance, visible to every connection. * @@ -7431,7 +8255,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_update_is_reset(duckdb_v2_c * must destroy it with `duckdb_v2_custom_option_destroy()`, which does not affect the registered option. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param conn The connection to register on. * @param option The custom option to register. @@ -7442,7 +8266,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_update_is_reset(duckdb_v2_c DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_register_custom_option(duckdb_v2_connection_handle conn, duckdb_v2_custom_option_handle option, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Registers the custom option on the loading extension's instance, visible to every connection. * @@ -7453,7 +8279,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_register_custom_option(duckdb_ * does not affect the registered option. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param extension The loading extension. * @param option The custom option to register. @@ -7464,7 +8290,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_register_custom_option(duckdb_ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_extension_register_custom_option(duckdb_v2_extension_handle extension, duckdb_v2_custom_option_handle option, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys the custom option, releasing its resources. * @@ -7472,12 +8300,13 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_extension_register_custom_option(duckdb_v * double-destruction. Destroying the handle after registration does not affect the registered option. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param option The option to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_custom_option_destroy(duckdb_v2_custom_option_handle *option); +#endif /* --- Struct definitions for custom_option --- */ @@ -7596,6 +8425,7 @@ typedef struct _duckdb_v2_expression { /* --- Functions for expression --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the type of an expression node. * @@ -7603,7 +8433,7 @@ typedef struct _duckdb_v2_expression { * `EXPRESSION_TYPE`. A node of a type this API does not model reports `EXPRESSION_TYPE_INVALID`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param expression The expression node. * @param type Receives the node type. @@ -7614,7 +8444,9 @@ typedef struct _duckdb_v2_expression { DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_expression_get_type(duckdb_v2_expression_handle expression, DUCKDB_V2_EXPRESSION_TYPE *type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the logical type the expression node evaluates to. * @@ -7622,7 +8454,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_expression_get_type(duckdb_v2_expression_ * `duckdb_v2_logical_type_destroy()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param expression The expression node. * @param type Receives the owned logical type. @@ -7633,7 +8465,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_expression_get_type(duckdb_v2_expression_ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_expression_get_return_type(duckdb_v2_expression_handle expression, duckdb_v2_logical_type_handle *type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the number of child nodes of an expression node. * @@ -7641,7 +8475,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_expression_get_return_type(duckdb_v2_expr * children. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param expression The expression node. * @param count Receives the number of children. @@ -7651,7 +8485,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_expression_get_return_type(duckdb_v2_expr */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_expression_get_child_count(duckdb_v2_expression_handle expression, idx_t *count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves a child node of an expression node by index. * @@ -7659,7 +8495,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_expression_get_child_count(duckdb_v2_expr * child is borrowed and shares the lifetime of its parent. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param expression The expression node. * @param index The index of the child to retrieve. @@ -7671,7 +8507,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_expression_get_child_count(duckdb_v2_expr DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_expression_get_child(duckdb_v2_expression_handle expression, idx_t index, duckdb_v2_expression_handle *child, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value of a constant node. * @@ -7679,7 +8517,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_expression_get_child(duckdb_v2_expression * be destroyed via `duckdb_v2_value_destroy()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param expression The constant node. * @param value Receives the owned constant value. @@ -7690,7 +8528,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_expression_get_child(duckdb_v2_expression DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_expression_constant_get_value(duckdb_v2_expression_handle expression, duckdb_v2_value_handle *value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the column a column reference node points at. * @@ -7700,7 +8540,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_expression_constant_get_value(duckdb_v2_e * `duckdb_v2_table_function_filter_pushdown_get_column_index()` for a filter offered to a table function. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param expression The column reference node. * @param index Receives the column index. @@ -7710,7 +8550,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_expression_constant_get_value(duckdb_v2_e */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_expression_column_ref_get_index(duckdb_v2_expression_handle expression, idx_t *index, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the name of the scalar function a function node calls. * @@ -7720,7 +8562,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_expression_column_ref_get_index(duckdb_v2 * the type rather than the name for those. The name is borrowed and shares the lifetime of the node. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param expression The function node. * @param name Receives a borrowed view of the function name. @@ -7731,7 +8573,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_expression_column_ref_get_index(duckdb_v2 DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_expression_function_get_name(duckdb_v2_expression_handle expression, duckdb_v2_identifier_t *name, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the qualified name of the scalar function a function node calls. * @@ -7740,7 +8584,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_expression_function_get_name(duckdb_v2_ex * caller and must be destroyed via `duckdb_v2_qname_destroy()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param expression The function node. * @param name Receives the owned qualified name. @@ -7751,7 +8595,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_expression_function_get_name(duckdb_v2_ex DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_expression_function_get_qname(duckdb_v2_expression_handle expression, duckdb_v2_qname_handle *name, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns whether a cast node is a regular `CAST` or a `TRY_CAST`. * @@ -7759,7 +8605,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_expression_function_get_qname(duckdb_v2_e * convert where a regular `CAST` would fail the query. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param expression The cast node. * @param mode Receives the cast mode. @@ -7770,6 +8616,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_expression_function_get_qname(duckdb_v2_e DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_expression_cast_get_mode(duckdb_v2_expression_handle expression, DUCKDB_V2_CAST_MODE *mode, duckdb_v2_error_info_handle *err); +#endif /* --- Struct definitions for expression --- */ @@ -7837,6 +8684,7 @@ typedef void (*duckdb_v2_log_sink_flush_callback_fn)(duckdb_v2_log_sink_flush_in /* --- Functions for log sink --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a new log sink through a factory. * @@ -7847,7 +8695,7 @@ typedef void (*duckdb_v2_log_sink_flush_callback_fn)(duckdb_v2_log_sink_flush_in * The log sink can only be registered on the instance the factory belongs to. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create the log sink through. * @param sink On success, receives the newly created log sink. Owned by the caller. @@ -7858,7 +8706,9 @@ typedef void (*duckdb_v2_log_sink_flush_callback_fn)(duckdb_v2_log_sink_flush_in DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_log_sink_create(duckdb_v2_factory_handle factory, duckdb_v2_log_sink_handle *sink, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the name the logging configuration refers to the log sink by. * @@ -7866,7 +8716,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_log_sink_create(duckdb_v2_factory_handle * A name must be set before registration. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param sink The log sink to set the name of. * @param name The name to set. Borrowed and copied. @@ -7877,7 +8727,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_log_sink_create(duckdb_v2_factory_handle DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_log_sink_set_name(duckdb_v2_log_sink_handle sink, const duckdb_v2_identifier_t *name, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets arbitrary user data on the log sink. * @@ -7886,7 +8738,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_log_sink_set_name(duckdb_v2_log_sink_hand * sink was registered, else when the log sink handle is. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param sink The log sink to set the user data of. * @param data Opaque handle bundling the user data pointer plus an optional destructor. @@ -7896,7 +8748,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_log_sink_set_name(duckdb_v2_log_sink_hand */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_log_sink_set_user_data(duckdb_v2_log_sink_handle sink, duckdb_v2_opaque *data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the write callback of the log sink, invoked for every entry the logging configuration directs to the sink. * @@ -7904,7 +8758,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_log_sink_set_user_data(duckdb_v2_log_sink * logging configuration. A write callback must be set before registration. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param sink The log sink to set the write callback of. * @param callback The write callback to set. @@ -7915,7 +8769,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_log_sink_set_user_data(duckdb_v2_log_sink DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_log_sink_set_write_callback(duckdb_v2_log_sink_handle sink, duckdb_v2_log_sink_write_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the optional flush callback of the log sink, invoked when DuckDB flushes its log, so entries the sink holds on * to can be written out. When DuckDB flushes is up to DuckDB; entries still held when the instance is destroyed are for @@ -7924,7 +8780,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_log_sink_set_write_callback(duckdb_v2_log * Like the write callback, it must be safe to run on any thread, and must not log or change the logging configuration. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param sink The log sink to set the flush callback of. * @param callback The flush callback to set. @@ -7935,13 +8791,15 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_log_sink_set_write_callback(duckdb_v2_log DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_log_sink_set_flush_callback(duckdb_v2_log_sink_handle sink, duckdb_v2_log_sink_flush_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the id of the connection that wrote the entry, as `duckdb_logs` reports it. An entry written for the * database as a whole has none: `present` then receives false and `id` is left untouched. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The write info handle of the entry. * @param id Receives the connection id, if present. @@ -7953,13 +8811,15 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_log_sink_set_flush_callback(duckdb_v2_log DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_log_sink_write_info_get_connection_id(duckdb_v2_log_sink_write_info_handle info, idx_t *id, bool *present, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the id of the transaction the entry was written in, as `duckdb_logs` reports it. An entry written outside a * transaction has none: `present` then receives false and `id` is left untouched. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The write info handle of the entry. * @param id Receives the transaction id, if present. @@ -7971,13 +8831,15 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_log_sink_write_info_get_connection_id(duc DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_log_sink_write_info_get_transaction_id(duckdb_v2_log_sink_write_info_handle info, idx_t *id, bool *present, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the id of the query the entry was written for, as `duckdb_logs` reports it. An entry written outside a * query has none: `present` then receives false and `id` is left untouched. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The write info handle of the entry. * @param id Receives the query id, if present. @@ -7989,14 +8851,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_log_sink_write_info_get_transaction_id(du DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_log_sink_write_info_get_query_id(duckdb_v2_log_sink_write_info_handle info, idx_t *id, bool *present, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the id of the thread that wrote the entry, as `duckdb_logs` reports it. Only an entry written in the thread * scope has one: otherwise `present` receives false and `id` is left untouched. The id identifies the thread that * logged, which need not be the thread the write callback runs on. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The write info handle of the entry. * @param id Receives the thread id, if present. @@ -8008,7 +8872,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_log_sink_write_info_get_query_id(duckdb_v DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_log_sink_write_info_get_thread_id(duckdb_v2_log_sink_write_info_handle info, idx_t *id, bool *present, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Registers the log sink on the instance, making it available to the logging configuration under its name. * @@ -8020,7 +8886,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_log_sink_write_info_get_thread_id(duckdb_ * sink. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param instance The instance to register on. * @param sink The log sink to register. @@ -8031,7 +8897,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_log_sink_write_info_get_thread_id(duckdb_ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_register_log_sink(duckdb_v2_instance_handle instance, duckdb_v2_log_sink_handle sink, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Registers the log sink on the loading extension's instance, making it available to the logging configuration under * its name. @@ -8040,7 +8908,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_register_log_sink(duckdb_v2_inst * `duckdb_v2_instance_register_log_sink()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param extension The loading extension. * @param sink The log sink to register. @@ -8051,7 +8919,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_register_log_sink(duckdb_v2_inst DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_extension_register_log_sink(duckdb_v2_extension_handle extension, duckdb_v2_log_sink_handle sink, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys the log sink, releasing its resources. * @@ -8059,12 +8929,13 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_extension_register_log_sink(duckdb_v2_ext * double-destruction. Destroying the handle after registration does not affect the registered sink. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param sink The log sink to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_log_sink_destroy(duckdb_v2_log_sink_handle *sink); +#endif /* --- Struct definitions for log sink --- */ @@ -8174,6 +9045,7 @@ typedef enum DUCKDB_V2_LOGICAL_TYPE_ID { /* --- Functions for logical_type --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a logical type from a type id plus value parameters. * @@ -8197,7 +9069,7 @@ typedef enum DUCKDB_V2_LOGICAL_TYPE_ID { * factory_create_type_from_text — and for INVALID. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to resolve the type in. * @param type_id The type id to instantiate. @@ -8213,7 +9085,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_factory_create_type_from_id( duckdb_v2_factory_handle factory, DUCKDB_V2_LOGICAL_TYPE_ID type_id, const duckdb_v2_identifier_t *param_names, const duckdb_v2_value_handle *param_values, idx_t param_count, duckdb_v2_logical_type_handle *out_type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a logical type from a type name plus value parameters. * @@ -8243,7 +9117,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_factory_create_type_from_id( * the inverse of logical_type_get_param_count / logical_type_get_param. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to resolve the type in. * @param name The type name to resolve. Parts are matched case-insensitively; qualify it to name a type in a particular @@ -8260,7 +9134,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_factory_create_type_from_name( duckdb_v2_factory_handle factory, duckdb_v2_qname_handle name, const duckdb_v2_identifier_t *param_names, const duckdb_v2_value_handle *param_values, idx_t param_count, duckdb_v2_logical_type_handle *out_type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a logical type by parsing SQL text. * @@ -8279,7 +9155,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_factory_create_type_from_name( * the inverse of logical_type_to_text for every constructible kind. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to resolve the type in. * @param text View of the SQL type expression to parse. @@ -8291,14 +9167,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_factory_create_type_from_text(duckdb_v2_f const duckdb_v2_str *text, duckdb_v2_logical_type_handle *out_type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a copy of a logical type. * * On success, writes the new caller-owned handle into *out_type; destroy it via logical_type_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param type The logical type to copy. * @param out_type Receives the new logical type handle. @@ -8308,20 +9186,24 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_factory_create_type_from_text(duckdb_v2_f DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_logical_type_copy(duckdb_v2_logical_type_handle type, duckdb_v2_logical_type_handle *out_type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys a logical type handle. * * Null-safe: passing nullptr or a slot already set to nullptr is a no-op. On success the slot is set to nullptr. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param type The logical type to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_logical_type_destroy(duckdb_v2_logical_type_handle *type); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Compares two logical types for deep equality. * @@ -8330,7 +9212,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_logical_type_destroy(duckdb_v2_logical_ty * and equal field types. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param left The first logical type. * @param right The second logical type. @@ -8341,12 +9223,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_logical_type_destroy(duckdb_v2_logical_ty DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_logical_type_is_equal(duckdb_v2_logical_type_handle left, duckdb_v2_logical_type_handle right, bool *result, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the logical type id. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param type The logical type. * @param out_id Receives the type id. @@ -8356,7 +9240,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_logical_type_is_equal(duckdb_v2_logical_t DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_logical_type_get_id(duckdb_v2_logical_type_handle type, DUCKDB_V2_LOGICAL_TYPE_ID *out_id, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Borrows the logical type's name. * @@ -8366,7 +9252,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_logical_type_get_id(duckdb_v2_logical_typ * name points at static storage. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param type The logical type. * @param out_name Receives a borrowed view of the name (alias when set, else the id's canonical name). @@ -8376,7 +9262,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_logical_type_get_id(duckdb_v2_logical_typ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_logical_type_get_name(duckdb_v2_logical_type_handle type, duckdb_v2_identifier_t *out_name, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Renders a logical type as SQL text. * @@ -8394,7 +9282,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_logical_type_get_name(duckdb_v2_logical_t * string. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param type The logical type. * @param out_text Caller-owned buffer receiving the text plus a null terminator, or NULL to only report the required @@ -8408,7 +9296,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_logical_type_get_name(duckdb_v2_logical_t DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_logical_type_to_text(duckdb_v2_logical_type_handle type, char *out_text, idx_t out_capacity, idx_t *out_length, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the number of value parameters of a logical type. * @@ -8419,7 +9309,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_logical_type_to_text(duckdb_v2_logical_ty * actually carries, so a bind-time modifier that is not retained — an ignored VARCHAR length, say — does not reappear. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param type The logical type. * @param out_count Receives the number of parameters. @@ -8428,7 +9318,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_logical_type_to_text(duckdb_v2_logical_ty */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_logical_type_get_param_count(duckdb_v2_logical_type_handle type, idx_t *out_count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns one value parameter of a logical type. * @@ -8439,7 +9331,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_logical_type_get_param_count(duckdb_v2_lo * collations as VARCHAR. An out-of-range index returns ERROR_INPUT_INVALID. Each call allocates one owned value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param type The logical type. * @param index The parameter index, in [0, param_count). @@ -8453,7 +9345,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_logical_type_get_param(duckdb_v2_logical_ duckdb_v2_identifier_t *out_name, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a logical type that is an alias of another logical type. * @@ -8465,7 +9359,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_logical_type_get_param(duckdb_v2_logical_ * ERROR_INPUT_INVALID. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to resolve the type in. * @param base_type The logical type to alias. Typically the base type supplied in the custom type bind info. @@ -8480,6 +9374,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_factory_create_type_with_alias(duckdb_v2_ const duckdb_v2_identifier_t *alias_name, duckdb_v2_logical_type_handle *out_type, duckdb_v2_error_info_handle *err); +#endif #if DUCKDB_V2_API_ALLOW_UNSTABLE /*! @@ -8552,6 +9447,7 @@ typedef struct _duckdb_v2_macro_function { /* --- Functions for macro --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a new macro function through a factory. * @@ -8563,7 +9459,7 @@ typedef struct _duckdb_v2_macro_function { * The macro function can only be registered on the database the factory belongs to. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create the macro function through. * @param type Whether the macro is a scalar or a table macro. @@ -8576,7 +9472,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_macro_function_create(duckdb_v2_factory_h DUCKDB_V2_MACRO_FUNCTION_TYPE type, duckdb_v2_macro_function_handle *function, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the name of the macro function, as SQL calls it. * @@ -8584,7 +9482,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_macro_function_create(duckdb_v2_factory_h * registration. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The macro function to set the name of. * @param name The name to set. Borrowed and copied. @@ -8595,7 +9493,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_macro_function_create(duckdb_v2_factory_h DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_macro_function_set_name(duckdb_v2_macro_function_handle function, const duckdb_v2_identifier_t *name, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the body of the macro function, as SQL text. * @@ -8605,7 +9505,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_macro_function_set_name(duckdb_v2_macro_f * the previous body. A body must be set before registration. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The macro function to set the body of. * @param body The SQL text of the body. Borrowed and copied. @@ -8616,7 +9516,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_macro_function_set_name(duckdb_v2_macro_f DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_macro_function_set_body(duckdb_v2_macro_function_handle function, const duckdb_v2_str *body, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the macro function's signature so its parameters can be declared. * @@ -8627,7 +9529,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_macro_function_set_body(duckdb_v2_macro_f * that does not follow these rules. The signature is modified in place. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The macro function to get the signature of. * @param sig The returned signature. Borrowed and valid for the lifetime of the macro function handle. @@ -8638,7 +9540,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_macro_function_set_body(duckdb_v2_macro_f DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_macro_function_get_signature(duckdb_v2_macro_function_handle function, duckdb_v2_function_signature_handle *sig, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the documentation of the macro function so it can be filled in. * @@ -8647,7 +9551,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_macro_function_get_signature(duckdb_v2_ma * in place and registered with the macro function. Optional. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The macro function to get the documentation of. * @param docs The returned documentation. Borrowed and valid for the lifetime of the macro function handle. @@ -8658,7 +9562,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_macro_function_get_signature(duckdb_v2_ma DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_macro_function_get_docs(duckdb_v2_macro_function_handle function, duckdb_v2_function_docs_handle *docs, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Registers the macro function, making it available for use in SQL queries. * @@ -8670,7 +9576,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_macro_function_get_docs(duckdb_v2_macro_f * `duckdb_v2_macro_function_destroy()`, which does not affect the registered macro function. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param extension The loading extension. * @param function The macro function to register. @@ -8681,7 +9587,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_macro_function_get_docs(duckdb_v2_macro_f DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_extension_register_macro_function(duckdb_v2_extension_handle extension, duckdb_v2_macro_function_handle function, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys the macro function, releasing its resources. * @@ -8689,12 +9597,13 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_extension_register_macro_function(duckdb_ * double-destruction. Destroying the handle after registration does not affect the registered macro function. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The macro function to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_macro_function_destroy(duckdb_v2_macro_function_handle *function); +#endif /* --- Struct definitions for macro --- */ @@ -8743,6 +9652,7 @@ typedef void (*duckdb_v2_pragma_function_exec_callback_fn)(duckdb_v2_function_bi /* --- Functions for pragma --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a new pragma function through a factory. * @@ -8755,7 +9665,7 @@ typedef void (*duckdb_v2_pragma_function_exec_callback_fn)(duckdb_v2_function_bi * The pragma function can only be registered on the database the factory belongs to. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create the pragma function through. * @param function On success, receives the newly created pragma function. Owned by the caller. @@ -8766,7 +9676,9 @@ typedef void (*duckdb_v2_pragma_function_exec_callback_fn)(duckdb_v2_function_bi DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_pragma_function_create(duckdb_v2_factory_handle factory, duckdb_v2_pragma_function_handle *function, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the name of the pragma function, as the `PRAGMA` statement calls it. * @@ -8774,7 +9686,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_pragma_function_create(duckdb_v2_factory_ * registration. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the name of. * @param name The name to set. Borrowed and copied. @@ -8785,7 +9697,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_pragma_function_create(duckdb_v2_factory_ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_pragma_function_set_name(duckdb_v2_pragma_function_handle function, const duckdb_v2_identifier_t *name, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the documentation of the function so it can be filled in. * @@ -8794,7 +9708,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_pragma_function_set_name(duckdb_v2_pragma * in place and registered with the function. Optional. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to get the documentation of. * @param docs The returned documentation. Borrowed and valid for the lifetime of the function handle. @@ -8805,7 +9719,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_pragma_function_set_name(duckdb_v2_pragma DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_pragma_function_get_docs(duckdb_v2_pragma_function_handle function, duckdb_v2_function_docs_handle *docs, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the function's signature so it can be configured. * @@ -8814,7 +9730,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_pragma_function_get_docs(duckdb_v2_pragma * modified in place. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to get the signature of. * @param sig The returned signature. Borrowed and valid for the lifetime of the function handle. @@ -8825,7 +9741,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_pragma_function_get_docs(duckdb_v2_pragma DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_pragma_function_get_signature(duckdb_v2_pragma_function_handle function, duckdb_v2_function_signature_handle *sig, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets arbitrary user data on the pragma function. * @@ -8834,7 +9752,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_pragma_function_get_signature(duckdb_v2_p * when the data is no longer needed. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the user data of. * @param data Opaque handle bundling the user data pointer plus an optional destructor. @@ -8845,7 +9763,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_pragma_function_get_signature(duckdb_v2_p DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_pragma_function_set_user_data(duckdb_v2_pragma_function_handle function, duckdb_v2_opaque *data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the query callback of the pragma function, making it a query pragma. * @@ -8855,7 +9775,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_pragma_function_set_user_data(duckdb_v2_p * are set. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the query callback of. * @param callback The query callback to set. @@ -8866,7 +9786,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_pragma_function_set_user_data(duckdb_v2_p DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_pragma_function_set_query_callback( duckdb_v2_pragma_function_handle function, duckdb_v2_pragma_function_query_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the exec callback of the pragma function, making it an exec pragma. * @@ -8875,7 +9797,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_pragma_function_set_query_callback( * neither are set. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the exec callback of. * @param callback The exec callback to set. @@ -8886,7 +9808,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_pragma_function_set_query_callback( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_pragma_function_set_exec_callback( duckdb_v2_pragma_function_handle function, duckdb_v2_pragma_function_exec_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the SQL to run in place of the `PRAGMA` statement. * @@ -8894,7 +9818,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_pragma_function_set_exec_callback( * replaces the previous query. The query callback must set a query. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The query info handle. * @param query The SQL to run. Borrowed and copied. @@ -8905,7 +9829,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_pragma_function_set_exec_callback( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_pragma_function_query_set_query(duckdb_v2_pragma_function_query_info_handle info, const duckdb_v2_str *query, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Registers the pragma function, making it available to the `PRAGMA` statement. * @@ -8917,7 +9843,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_pragma_function_query_set_query(duckdb_v2 * `duckdb_v2_pragma_function_destroy()`, which does not affect the registered function. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param conn The connection to register on. * @param function The pragma function to register. @@ -8928,7 +9854,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_pragma_function_query_set_query(duckdb_v2 DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_register_pragma_function(duckdb_v2_connection_handle conn, duckdb_v2_pragma_function_handle function, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Registers the pragma function, making it available to the `PRAGMA` statement. * @@ -8939,7 +9867,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_register_pragma_function(duckd * `duckdb_v2_pragma_function_destroy()`, which does not affect the registered function. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param extension The loading extension. * @param function The pragma function to register. @@ -8950,7 +9878,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_register_pragma_function(duckd DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_extension_register_pragma_function(duckdb_v2_extension_handle extension, duckdb_v2_pragma_function_handle function, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys the pragma function, releasing its resources. * @@ -8958,12 +9888,13 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_extension_register_pragma_function(duckdb * double-destruction. Destroying the handle after registration does not affect the registered function. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_pragma_function_destroy(duckdb_v2_pragma_function_handle *function); +#endif /* --- Struct definitions for pragma --- */ @@ -9006,6 +9937,7 @@ typedef void (*duckdb_v2_replacement_scan_callback_fn)(duckdb_v2_replacement_sca /* --- Functions for replacement scan --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a new replacement scan through a factory. * @@ -9018,7 +9950,7 @@ typedef void (*duckdb_v2_replacement_scan_callback_fn)(duckdb_v2_replacement_sca * The scan can only be registered on the database the factory belongs to. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create the scan through. * @param scan On success, receives the newly created replacement scan. Owned by the caller. @@ -9029,7 +9961,9 @@ typedef void (*duckdb_v2_replacement_scan_callback_fn)(duckdb_v2_replacement_sca DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_create(duckdb_v2_factory_handle factory, duckdb_v2_replacement_scan_handle *scan, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the callback of the replacement scan. * @@ -9040,7 +9974,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_create(duckdb_v2_factory * callback may be used to read settings, but not to run queries. A callback must be set before registration. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param scan The scan to set the callback of. * @param callback The callback to set. @@ -9051,7 +9985,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_create(duckdb_v2_factory DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_set_callback(duckdb_v2_replacement_scan_handle scan, duckdb_v2_replacement_scan_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets arbitrary user data on the replacement scan. * @@ -9061,7 +9997,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_set_callback(duckdb_v2_r * several connections at once, so the data must be safe to read concurrently. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param scan The scan to set the user data of. * @param data Opaque handle bundling the user data pointer plus an optional destructor. @@ -9072,12 +10008,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_set_callback(duckdb_v2_r DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_set_user_data(duckdb_v2_replacement_scan_handle scan, duckdb_v2_opaque *data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_replacement_scan_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The info handle. * @param data Receives the user data pointer, or null if none was set. @@ -9087,7 +10025,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_set_user_data(duckdb_v2_ */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_get_user_data(duckdb_v2_replacement_scan_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the name the catalog could not resolve. * @@ -9097,7 +10037,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_get_user_data(duckdb_v2_ * `duckdb_v2_qname_destroy()`; being owned, it may outlive the callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The info handle. * @param name Receives the unresolved name. Owned by the caller; destroy via `duckdb_v2_qname_destroy()`. @@ -9108,7 +10048,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_get_user_data(duckdb_v2_ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_get_name(duckdb_v2_replacement_scan_info_handle info, duckdb_v2_qname_handle *name, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Claims the reference by naming a table function to read instead. * @@ -9123,7 +10065,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_get_name(duckdb_v2_repla * exclusive: claiming the reference through a second, different form results in an error. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The info handle. * @param name The table function to read instead. Borrowed and copied. @@ -9134,7 +10076,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_get_name(duckdb_v2_repla DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_set_function_name(duckdb_v2_replacement_scan_info_handle info, duckdb_v2_qname_handle name, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Appends a positional argument to the claimed table function. * @@ -9143,7 +10087,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_set_function_name(duckdb * called first; otherwise the call results in an error. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The info handle. * @param value The argument value. Borrowed and copied. @@ -9154,7 +10098,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_set_function_name(duckdb DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_add_argument(duckdb_v2_replacement_scan_info_handle info, duckdb_v2_value_handle value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Appends a named argument to the claimed table function. * @@ -9163,7 +10109,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_add_argument(duckdb_v2_r * first; otherwise the call results in an error. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The info handle. * @param name The name of the parameter to bind the value to. Borrowed and copied. @@ -9176,7 +10122,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_add_named_argument(duckd const duckdb_v2_identifier_t *name, duckdb_v2_value_handle value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Claims the reference by naming a column data collection to read instead. * @@ -9200,7 +10148,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_add_named_argument(duckd * exclusive: claiming the reference through a second, different form results in an error. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The info handle. * @param collection The collection to read instead. Borrowed; the caller keeps ownership and must keep it alive. @@ -9215,7 +10163,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_add_named_argument(duckd DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_set_collection( duckdb_v2_replacement_scan_info_handle info, duckdb_v2_column_data_collection_handle collection, const duckdb_v2_identifier_t *column_names, idx_t column_count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Claims the reference by naming a query to read instead. * @@ -9229,7 +10179,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_set_collection( * exclusive: claiming the reference through a second, different form results in an error. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The info handle. * @param sql The SELECT statement to read instead. Borrowed for the call only. @@ -9240,7 +10190,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_set_collection( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_set_subquery(duckdb_v2_replacement_scan_info_handle info, const duckdb_v2_str *sql, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the alias the claimed replacement is bound under. * @@ -9249,7 +10201,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_set_subquery(duckdb_v2_r * and copied. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The info handle. * @param alias The alias to bind the replacement under. Borrowed and copied. @@ -9260,7 +10212,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_set_subquery(duckdb_v2_r DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_set_alias(duckdb_v2_replacement_scan_info_handle info, const duckdb_v2_identifier_t *alias, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Registers the replacement scan, making it consulted for names the catalog cannot resolve. * @@ -9273,7 +10227,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_set_alias(duckdb_v2_repl * `duckdb_v2_replacement_scan_destroy()`, which does not affect the registered scan. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param conn The connection to register on. * @param scan The replacement scan to register. @@ -9284,7 +10238,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_set_alias(duckdb_v2_repl DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_register_replacement_scan(duckdb_v2_connection_handle conn, duckdb_v2_replacement_scan_handle scan, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Registers the replacement scan, making it consulted for names the catalog cannot resolve. * @@ -9297,7 +10253,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_register_replacement_scan(duck * `duckdb_v2_replacement_scan_destroy()`, which does not affect the registered scan. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param instance The instance to register on. * @param scan The replacement scan to register. @@ -9308,7 +10264,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_register_replacement_scan(duck DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_register_replacement_scan(duckdb_v2_instance_handle instance, duckdb_v2_replacement_scan_handle scan, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Registers the replacement scan, making it consulted for names the catalog cannot resolve. * @@ -9321,7 +10279,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_register_replacement_scan(duckdb * scan. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param extension The loading extension. * @param scan The replacement scan to register. @@ -9332,7 +10290,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_instance_register_replacement_scan(duckdb DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_extension_register_replacement_scan(duckdb_v2_extension_handle extension, duckdb_v2_replacement_scan_handle scan, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys the replacement scan, releasing its resources. * @@ -9340,12 +10300,13 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_extension_register_replacement_scan(duckd * double-destruction. Destroying the handle after registration does not affect the registered scan. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param scan The scan to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_replacement_scan_destroy(duckdb_v2_replacement_scan_handle *scan); +#endif /* --- Struct definitions for replacement scan --- */ @@ -9429,6 +10390,7 @@ typedef void (*duckdb_v2_scalar_function_exec_callback_fn)(duckdb_v2_scalar_func /* --- Functions for scalar --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a new scalar function through a factory. * @@ -9441,7 +10403,7 @@ typedef void (*duckdb_v2_scalar_function_exec_callback_fn)(duckdb_v2_scalar_func * The scalar function can only be registered on the database the factory belongs to. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create the scalar function through. * @param function On success, receives the newly created scalar function. Owned by the caller. @@ -9452,7 +10414,9 @@ typedef void (*duckdb_v2_scalar_function_exec_callback_fn)(duckdb_v2_scalar_func DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_create(duckdb_v2_factory_handle factory, duckdb_v2_scalar_function_handle *function, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the name of the scalar function. * @@ -9460,7 +10424,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_create(duckdb_v2_factory_ * registration. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the name of. * @param name The name to set. Borrowed and copied. @@ -9471,7 +10435,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_create(duckdb_v2_factory_ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_set_name(duckdb_v2_scalar_function_handle function, const duckdb_v2_identifier_t *name, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the documentation of the function so it can be filled in. * @@ -9480,7 +10446,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_set_name(duckdb_v2_scalar * in place, describes this overload only, and is registered with the function. Optional. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to get the documentation of. * @param docs The returned documentation. Borrowed and valid for the lifetime of the function handle. @@ -9491,7 +10457,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_set_name(duckdb_v2_scalar DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_get_docs(duckdb_v2_scalar_function_handle function, duckdb_v2_function_docs_handle *docs, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the function's signature so it can be configured. * @@ -9500,7 +10468,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_get_docs(duckdb_v2_scalar * signature with a return type before registration. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to get the signature of. * @param sig The returned signature. Borrowed and valid for the lifetime of the function handle. @@ -9511,7 +10479,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_get_docs(duckdb_v2_scalar DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_get_signature(duckdb_v2_scalar_function_handle function, duckdb_v2_function_signature_handle *sig, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets arbitrary user data on the scalar function. * @@ -9521,7 +10491,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_get_signature(duckdb_v2_s * invoked when the data is no longer needed. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the user data of. * @param data Opaque handle bundling the user data pointer plus an optional destructor. @@ -9532,7 +10502,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_get_signature(duckdb_v2_s DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_set_user_data(duckdb_v2_scalar_function_handle function, duckdb_v2_opaque *data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets a property on the scalar function. * @@ -9542,7 +10514,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_set_user_data(duckdb_v2_s * error. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the property of. * @param key The property to set. @@ -9555,7 +10527,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_set_property(duckdb_v2_sc DUCKDB_V2_FUNCTION_PROPERTY_KEY key, DUCKDB_V2_FUNCTION_PROPERTY_VALUE value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the optional resolve types callback of the scalar function. * @@ -9566,7 +10540,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_set_property(duckdb_v2_sc * use the bind callback for that. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the resolve types callback of. * @param callback The resolve types callback to set. @@ -9577,7 +10551,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_set_property(duckdb_v2_sc DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_set_resolve_types_callback( duckdb_v2_scalar_function_handle function, duckdb_v2_scalar_function_resolve_types_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the optional bind callback of the scalar function. * @@ -9588,7 +10564,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_set_resolve_types_callbac * It cannot change the types of the call site, use the resolve types callback for that. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the bind callback of. * @param callback The bind callback to set. @@ -9599,7 +10575,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_set_resolve_types_callbac DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_set_bind_callback( duckdb_v2_scalar_function_handle function, duckdb_v2_scalar_function_bind_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the optional init callback of the scalar function. * @@ -9608,7 +10586,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_set_bind_callback( * function. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the init callback of. * @param callback The init callback to set. @@ -9619,7 +10597,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_set_bind_callback( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_set_init_callback( duckdb_v2_scalar_function_handle function, duckdb_v2_scalar_function_init_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the exec callback of the scalar function. * @@ -9627,7 +10607,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_set_init_callback( * and must fill the result vector. An exec callback must be set before registration. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the exec callback of. * @param callback The exec callback to set. @@ -9638,7 +10618,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_set_init_callback( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_set_exec_callback( duckdb_v2_scalar_function_handle function, duckdb_v2_scalar_function_exec_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the concrete return type of the call site being bound. * @@ -9647,7 +10629,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_set_exec_callback( * type is borrowed and copied. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The resolve types info handle. * @param return_type The return type to set. Borrowed for the call only. @@ -9658,7 +10640,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_set_exec_callback( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_resolve_types_set_return_type( duckdb_v2_scalar_function_resolve_types_info_handle info, duckdb_v2_logical_type_handle return_type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the function's "bind data" from the bind callback. * @@ -9668,7 +10652,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_resolve_types_set_return_ * set their bind data through this function, `duckdb_v2_function_bind_set_bind_data()` is not available to them. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param data Opaque handle bundling the bind data pointer plus optional destructor and equality callbacks. @@ -9678,12 +10662,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_resolve_types_set_return_ */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_bind_set_bind_data( duckdb_v2_scalar_function_bind_info_handle info, duckdb_v2_opaque *data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_scalar_function_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The init info handle. * @param data Receives the user data pointer, or null if none was set. @@ -9693,12 +10679,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_bind_set_bind_data( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_init_get_user_data( duckdb_v2_scalar_function_init_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the bind data set by the function's bind callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The init info handle. * @param data Receives the bind data pointer, or null if none was set. @@ -9708,7 +10696,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_init_get_user_data( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_init_get_bind_data( duckdb_v2_scalar_function_init_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the function's worker-local "init data" from the init callback. * @@ -9717,7 +10707,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_init_get_bind_data( * destructor, invoked when the init data is no longer needed. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The init info handle. * @param data Opaque handle bundling the init data pointer plus an optional destructor. @@ -9727,12 +10717,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_init_get_bind_data( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_init_set_init_data( duckdb_v2_scalar_function_init_info_handle info, duckdb_v2_opaque *data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_scalar_function_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The exec info handle. * @param data Receives the user data pointer, or null if none was set. @@ -9742,12 +10734,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_init_set_init_data( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_exec_get_user_data( duckdb_v2_scalar_function_exec_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the bind data set by the function's bind callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The exec info handle. * @param data Receives the bind data pointer, or null if none was set. @@ -9757,12 +10751,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_exec_get_user_data( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_exec_get_bind_data( duckdb_v2_scalar_function_exec_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the worker-local init data set by the function's init callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The exec info handle. * @param data Receives the init data pointer for the executing thread, or null if none was set. @@ -9772,14 +10768,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_exec_get_bind_data( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_exec_get_init_data( duckdb_v2_scalar_function_exec_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns how many rows this execution must produce. The exec callback must write exactly this many rows to the result * vector. Note that this may be less than a full vector: with all-constant arguments the function is invoked for a * single row and the result is expanded by the engine. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The exec info handle. * @param count Receives the number of rows. @@ -9789,7 +10787,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_exec_get_init_data( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_exec_get_row_count( duckdb_v2_scalar_function_exec_info_handle info, idx_t *count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns how many argument vectors this invocation carries, split into the four parts of the argument list. * @@ -9798,7 +10798,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_exec_get_row_count( * four counts). Every out-parameter may be NULL, in which case nothing is written to it. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The exec info handle. * @param positional_fixed Optional. Receives the number of positional-only and standard parameters. @@ -9813,7 +10813,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_exec_get_row_count( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_exec_get_arg_count( duckdb_v2_scalar_function_exec_info_handle info, idx_t *positional_fixed, idx_t *positional_variadic, idx_t *named_fixed, idx_t *named_variadic, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the argument vector at the given index. * @@ -9823,7 +10825,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_exec_get_arg_count( * bounds. Borrowed; valid only for the duration of the callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The exec info handle. * @param index The index of the argument. @@ -9835,7 +10837,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_exec_get_arg_count( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_exec_get_arg(duckdb_v2_scalar_function_exec_info_handle info, idx_t index, duckdb_v2_vector_handle *vector, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the result vector the exec callback must write into. * @@ -9843,7 +10847,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_exec_get_arg(duckdb_v2_sc * of rows. Borrowed; valid only for the duration of the callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The exec info handle. * @param vector Receives the borrowed result vector to write into. @@ -9854,7 +10858,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_exec_get_arg(duckdb_v2_sc DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_exec_get_result(duckdb_v2_scalar_function_exec_info_handle info, duckdb_v2_vector_handle *vector, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Registers the scalar function, making it available for use in SQL queries. * @@ -9867,7 +10873,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_exec_get_result(duckdb_v2 * registered function. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param conn The connection to register on. * @param function The scalar function to register. @@ -9878,7 +10884,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_exec_get_result(duckdb_v2 DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_register_scalar_function(duckdb_v2_connection_handle conn, duckdb_v2_scalar_function_handle function, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Registers the scalar function, making it available for use in SQL queries. * @@ -9890,7 +10898,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_register_scalar_function(duckd * registered function. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param extension The loading extension. * @param function The scalar function to register. @@ -9901,7 +10909,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_register_scalar_function(duckd DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_extension_register_scalar_function(duckdb_v2_extension_handle extension, duckdb_v2_scalar_function_handle function, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys the scalar function, releasing its resources. * @@ -9909,12 +10919,13 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_extension_register_scalar_function(duckdb * double-destruction. Destroying the handle after registration does not affect the registered function. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_scalar_function_destroy(duckdb_v2_scalar_function_handle *function); +#endif /* --- Struct definitions for scalar --- */ @@ -9990,6 +11001,7 @@ typedef struct _duckdb_v2_statement_iterator { /* --- Functions for sql_statement --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Parses a SQL string into an iterator over its statements. * @@ -9999,7 +11011,7 @@ typedef struct _duckdb_v2_statement_iterator { * with no statements — empty, whitespace, or separators only — yields an iterator that is immediately exhausted. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param conn The connection supplying the parser configuration. * @param sql Null-terminated SQL string; may contain any number of statements. @@ -10010,7 +11022,9 @@ typedef struct _duckdb_v2_statement_iterator { DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_parse_sql(duckdb_v2_connection_handle conn, const char *sql, duckdb_v2_statement_iterator_handle *out_iterator, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Yields the next statement, or NULL when exhausted. * @@ -10020,7 +11034,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_parse_sql(duckdb_v2_connection_handle con * while an incremental one yields the statements ahead of the failure first. On failure *out_statement is set to NULL. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param iterator The iterator to advance. * @param out_statement Receives an owned statement, or NULL when the iterator is exhausted. @@ -10030,7 +11044,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_parse_sql(duckdb_v2_connection_handle con DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_statement_iterator_next(duckdb_v2_statement_iterator_handle iterator, duckdb_v2_sql_statement_handle *out_statement, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Binds a parsed statement without executing, yielding its schema signature. * @@ -10051,7 +11067,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_statement_iterator_next(duckdb_v2_stateme * *out_schema and *out_parameters are set to NULL on failure. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param conn The connection supplying the catalog, transaction, and parser configuration. * @param statement The statement to bind. Borrowed; not consumed. @@ -10066,7 +11082,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_statement_bind(duckdb_v2_connection_handl duckdb_v2_schema_handle *out_schema, duckdb_v2_schema_handle *out_parameters, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Binds a column data collection to the statement under a name. * @@ -10087,7 +11105,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_statement_bind(duckdb_v2_connection_handl * empty collection is a valid binding. Several collections can be bound under distinct names. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param statement The statement to bind the collection to. Modified in place. * @param name The non-empty name the statement refers to the collection by. Borrowed and copied. @@ -10105,7 +11123,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_statement_add_collection(duckdb_v2_sql_st duckdb_v2_column_data_collection_handle collection, const duckdb_v2_identifier_t *column_names, idx_t column_count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the statement's type as classified by the parser. * @@ -10116,7 +11136,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_statement_add_collection(duckdb_v2_sql_st * not visible here, and statement_bind reports ERROR_INPUT_METADATA_DEFERRED for it. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param statement The statement. * @param out_type Receives the statement type. @@ -10126,7 +11146,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_statement_add_collection(duckdb_v2_sql_st DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_sql_statement_get_type(duckdb_v2_sql_statement_handle statement, DUCKDB_V2_STATEMENT_TYPE *out_type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Borrows the statement's own SQL text. * @@ -10136,7 +11158,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_sql_statement_get_type(duckdb_v2_sql_stat * statement produced by a parser extension that overrides parsing carries whatever text the extension recorded. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param statement The statement. * @param out_text Receives a borrowed view of the statement text, valid until the statement is destroyed. @@ -10146,7 +11168,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_sql_statement_get_type(duckdb_v2_sql_stat DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_sql_statement_get_text(duckdb_v2_sql_statement_handle statement, duckdb_v2_str *out_text, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the number of distinct parameters the statement declares. * @@ -10154,7 +11178,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_sql_statement_get_text(duckdb_v2_sql_stat * parameter types wait for `duckdb_v2_statement_bind()`. Repeated uses of one parameter count once. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param statement The statement. * @param out_count Receives the number of distinct parameters. @@ -10164,7 +11188,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_sql_statement_get_text(duckdb_v2_sql_stat DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_sql_statement_get_parameter_count(duckdb_v2_sql_statement_handle statement, idx_t *out_count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Borrows the name of one parameter, in binding order. * @@ -10176,7 +11202,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_sql_statement_get_parameter_count(duckdb_ * with ERROR_INPUT_OUT_OF_RANGE. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param statement The statement. * @param index Zero-based position in binding order. @@ -10187,7 +11213,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_sql_statement_get_parameter_count(duckdb_ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_sql_statement_get_parameter_name(duckdb_v2_sql_statement_handle statement, idx_t index, duckdb_v2_identifier_t *out_name, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys a statement handle. * @@ -10195,13 +11223,15 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_sql_statement_get_parameter_name(duckdb_v * statement, so every statement is destroyed here once it is no longer needed. On success the slot is set to nullptr. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param statement The statement to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_sql_statement_destroy(duckdb_v2_sql_statement_handle *statement); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys a statement iterator handle. * @@ -10209,12 +11239,13 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_sql_statement_destroy(duckdb_v2_sql_state * owned and stay valid. On success the slot is set to nullptr. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param iterator The iterator to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_statement_iterator_destroy(duckdb_v2_statement_iterator_handle *iterator); +#endif /* --- Struct definitions for sql_statement --- */ @@ -10264,6 +11295,7 @@ typedef struct duckdb_v2_interval_t duckdb_v2_interval_t; /* --- Functions for vector --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the internal representation kind: flat, constant, or dictionary. * @@ -10271,7 +11303,7 @@ typedef struct duckdb_v2_interval_t duckdb_v2_interval_t; * vector_get_view will read them. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param vector The vector. * @param out_type Receives the representation kind. @@ -10281,7 +11313,9 @@ typedef struct duckdb_v2_interval_t duckdb_v2_interval_t; DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_get_vector_type(duckdb_v2_vector_handle vector, DUCKDB_V2_VECTOR_TYPE *out_type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the vector's logical type. * @@ -10289,7 +11323,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_get_vector_type(duckdb_v2_vector_h * It is caller-owned; destroy it via logical_type_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param vector The vector. * @param out_type Receives the caller-owned logical type handle. Destroy via logical_type_destroy. @@ -10299,7 +11333,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_get_vector_type(duckdb_v2_vector_h DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_get_logical_type(duckdb_v2_vector_handle vector, duckdb_v2_logical_type_handle *out_type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Reads a vector as a unified view of data, validity, selection, and count. * @@ -10323,7 +11359,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_get_logical_type(duckdb_v2_vector_ * vector to FLAT. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param vector The vector to read. * @param out_view Receives the view. Its pointers are borrowed and valid until the owning chunk is destroyed. @@ -10332,7 +11368,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_get_logical_type(duckdb_v2_vector_ */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_get_view(duckdb_v2_vector_handle vector, duckdb_v2_vector_view *out_view, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the number of elements in the vector. * @@ -10341,7 +11379,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_get_view(duckdb_v2_vector_handle v * single child vector has 30. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param vector The vector. * @param out_size Receives the number of elements. @@ -10350,7 +11388,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_get_view(duckdb_v2_vector_handle v */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_get_size(duckdb_v2_vector_handle vector, idx_t *out_size, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the number of elements in the vector. * @@ -10358,7 +11398,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_get_size(duckdb_v2_vector_handle v * space for size logical elements. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param vector The vector. * @param size The new number of logical elements. @@ -10367,7 +11407,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_get_size(duckdb_v2_vector_handle v */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_set_size(duckdb_v2_vector_handle vector, idx_t size, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Reads one cell of a vector as an owned value. * @@ -10380,7 +11422,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_set_size(duckdb_v2_vector_handle v * is caller-owned; destroy it via value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param vector The vector to read from. * @param row The logical row index, in [0, vector_get_size). @@ -10391,7 +11433,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_set_size(duckdb_v2_vector_handle v DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_get_value(duckdb_v2_vector_handle vector, idx_t row, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Writes one cell of a FLAT vector from a value. * @@ -10406,7 +11450,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_get_value(duckdb_v2_vector_handle * vector_get_size. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param vector The vector to write to. * @param row The logical row index, in [0, vector_get_size). @@ -10416,7 +11460,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_get_value(duckdb_v2_vector_handle */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_set_value(duckdb_v2_vector_handle vector, idx_t row, duckdb_v2_value_handle value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns a mutable pointer to the data of a FLAT or CONSTANT vector. * @@ -10426,7 +11472,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_set_value(duckdb_v2_vector_handle * When writing VARCHAR values, the caller must ensure that the bytes contain valid UTF-8. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param vector The vector. * @param out_data Receives a mutable pointer to the data. @@ -10435,7 +11481,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_set_value(duckdb_v2_vector_handle */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_get_data_mutable(duckdb_v2_vector_handle vector, void **out_data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Forces a vector into FLAT representation, in place. * @@ -10445,14 +11493,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_get_data_mutable(duckdb_v2_vector_ * VECTOR_TYPE_OTHER. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param vector The vector to flatten. * @param err Optional. On failure, receives an opaque info handle the caller must destroy via error_info_destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_flatten(duckdb_v2_vector_handle vector, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Casts every row of a vector into another vector, using a factory. * @@ -10470,7 +11520,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_flatten(duckdb_v2_vector_handle ve * vectors; `target` is typically a vector of a data chunk created by the caller, or the result vector of a callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory supplying the cast functions. * @param source The vector to cast. Borrowed for the call only. @@ -10488,7 +11538,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_cast(duckdb_v2_factory_handle fact duckdb_v2_vector_handle target, DUCKDB_V2_CAST_MODE mode, bool *out_converted, duckdb_v2_error_info_handle *cast_err, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Repoints a vector at another vector's data, without copying. * @@ -10498,7 +11550,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_cast(duckdb_v2_factory_handle fact * hand an already-materialized vector straight to an output vector without a per-row copy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param vector The vector to repoint at the source's data. * @param source The vector whose data to reference. Its logical type must equal the vector's. @@ -10507,7 +11559,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_cast(duckdb_v2_factory_handle fact */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_reference(duckdb_v2_vector_handle vector, duckdb_v2_vector_handle source, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Turns the vector into a CONSTANT vector holding the given value. * @@ -10516,7 +11570,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_reference(duckdb_v2_vector_handle * every child. The value's logical type must equal the vector's; a mismatch returns ERROR_INPUT_INVALID. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param vector The vector to make constant. * @param value The value every row takes. Its logical type must equal the vector's. @@ -10527,7 +11581,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_reference(duckdb_v2_vector_handle DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_make_constant(duckdb_v2_vector_handle vector, duckdb_v2_value_handle value, idx_t count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets a vector to a SEQUENCE representation. * @@ -10535,7 +11591,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_make_constant(duckdb_v2_vector_han * elements. No data pointer is involved; the three parameters describe the sequence completely. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param vector The vector to turn into a sequence. * @param start The first value of the sequence. @@ -10547,7 +11603,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_make_constant(duckdb_v2_vector_han DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_make_sequence(duckdb_v2_vector_handle vector, int64_t start, int64_t increment, idx_t count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets one row of a FLAT vector to NULL, nested children included. * @@ -10562,7 +11620,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_make_sequence(duckdb_v2_vector_han * vector_flatten first. The row index is logical and bounds-checked against vector_get_size. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param vector The vector to write to. * @param row The logical row index, in [0, vector_get_size). @@ -10571,7 +11629,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_make_sequence(duckdb_v2_vector_han */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_set_null(duckdb_v2_vector_handle vector, idx_t row, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns a mutable pointer to the validity mask of a FLAT vector. * @@ -10584,7 +11644,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_set_null(duckdb_v2_vector_handle v * masks up front and mark elements valid as the values are written. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param vector The vector. * @param out_validity Receives a mutable pointer to the validity mask. @@ -10594,14 +11654,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_set_null(duckdb_v2_vector_handle v DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_flat_get_validity_mutable(duckdb_v2_vector_handle vector, uint64_t **out_validity, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the validity of a CONSTANT vector. * * A constant vector holds a single element, so one flag decides whether every row reads as the value or as NULL. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param vector The constant vector. * @param validity True to mark the vector's single element valid, false to mark it NULL. @@ -10610,7 +11672,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_flat_get_validity_mutable(duckdb_v */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_constant_set_valid(duckdb_v2_vector_handle vector, bool validity, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Borrows a string-backed vector's arena for writing. * @@ -10619,7 +11683,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_constant_set_valid(duckdb_v2_vecto * arena is borrowed — never destroy it — and stays valid until the vector is flattened, reallocated, or destroyed. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param vector The string-backed vector whose arena to borrow. * @param out_arena Receives the borrowed arena handle. @@ -10629,7 +11693,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_constant_set_valid(duckdb_v2_vecto DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_get_arena(duckdb_v2_vector_handle vector, duckdb_v2_arena_handle *out_arena, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the number of child vectors a nested vector exposes. * @@ -10637,7 +11703,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_get_arena(duckdb_v2_vector_handle * for any non-nested kind. vector_get_child documents what each index addresses. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param vector The vector. * @param out_count Receives the number of child vectors. @@ -10646,7 +11712,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_get_arena(duckdb_v2_vector_handle */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_get_child_count(duckdb_v2_vector_handle vector, idx_t *out_count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Borrows a child vector by index. * @@ -10658,7 +11726,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_get_child_count(duckdb_v2_vector_h * no children, or if the index is out of range. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param vector The nested vector to descend into. * @param index The child index, in [0, vector_get_child_count). @@ -10669,7 +11737,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_get_child_count(duckdb_v2_vector_h DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_get_child(duckdb_v2_vector_handle vector, idx_t index, duckdb_v2_vector_handle *out_child, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Decodes BIGNUM storage bytes into a caller-supplied magnitude buffer + sign flag. * @@ -10693,7 +11763,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_get_child(duckdb_v2_vector_handle * Returns ERROR_INPUT_INVALID if in_data is NULL, or if in_length is too short to hold a bignum header. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param in_data The value's raw BIGNUM storage bytes. * @param in_length Size of in_data in bytes. @@ -10708,7 +11778,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_vector_get_child(duckdb_v2_vector_handle DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_bignum_decode(const uint8_t *in_data, idx_t in_length, uint8_t *out_data, idx_t out_capacity, idx_t *out_length, bool *out_is_negative, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Encodes a magnitude + sign flag into BIGNUM storage bytes. * @@ -10729,7 +11801,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_bignum_decode(const uint8_t *in_data, idx * ERROR_INPUT_OUT_OF_RANGE. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param in_data Big-endian magnitude bytes, with no leading zero bytes. * @param in_length Size of in_data in bytes. Must be >= 1. @@ -10744,7 +11816,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_bignum_decode(const uint8_t *in_data, idx DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_bignum_encode(const uint8_t *in_data, idx_t in_length, bool is_negative, uint8_t *out_data, idx_t out_capacity, idx_t *out_length, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Validates all text->len bytes as UTF-8, including bytes after embedded NUL characters. * @@ -10756,13 +11830,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_bignum_encode(const uint8_t *in_data, idx * A view with a NULL ptr and zero length is valid. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param text The bytes to validate. * @param err Optional. On failure, receives an opaque info handle the caller must destroy via error_info_destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_validate_utf8(const duckdb_v2_str *text, duckdb_v2_error_info_handle *err); +#endif /* --- Struct definitions for vector --- */ @@ -10820,6 +11895,7 @@ typedef struct _duckdb_v2_prepared_statement { /* --- Functions for prepared_statement --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Prepares a parsed statement into a reusable handle. Non-consuming. * @@ -10842,7 +11918,7 @@ typedef struct _duckdb_v2_prepared_statement { * interrupt that result first, or prepare on another connection. `*out_prepared` is set to NULL on failure. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param conn The connection supplying the catalog, transaction, and parser state. The prepared statement belongs to * it. @@ -10861,7 +11937,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_prepared_statement_create(duckdb_v2_conne bool require_cacheable, duckdb_v2_prepared_statement_handle *out_prepared, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Executes a prepared statement, streaming its result. Non-consuming. * @@ -10888,7 +11966,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_prepared_statement_create(duckdb_v2_conne * statement usable. `*out_result` is set to NULL on failure. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param prepared The prepared statement to execute. Borrowed; not consumed. * @param parameter_names Optional. An array of `parameter_count` parameter names; a non-empty entry binds its value to @@ -10910,7 +11988,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_prepared_statement_execute(duckdb_v2_prep idx_t parameter_count, duckdb_v2_result_handle *out_result, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Reports whether the prepared statement reuses its compiled plan across executions. * @@ -10925,7 +12005,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_prepared_statement_execute(duckdb_v2_prep * to `duckdb_v2_prepared_statement_execute()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param prepared The prepared statement to inspect. * @param out_reuses Receives true when the compiled plan is reused across executions, false when the statement re-binds @@ -10937,7 +12017,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_prepared_statement_execute(duckdb_v2_prep DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_prepared_statement_reuses_plan(duckdb_v2_prepared_statement_handle prepared, bool *out_reuses, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys a prepared statement. * @@ -10946,12 +12028,13 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_prepared_statement_reuses_plan(duckdb_v2_ * statement may be destroyed while results made from it are still live. On success the slot is set to NULL. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param prepared The prepared statement to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_prepared_statement_destroy(duckdb_v2_prepared_statement_handle *prepared); +#endif /* --- Struct definitions for prepared_statement --- */ @@ -11002,6 +12085,7 @@ typedef enum DUCKDB_V2_RESULT_STEP_STATUS { /* --- Functions for query_result --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Executes a parsed statement on the connection, streaming its result. Non-consuming. * @@ -11037,7 +12121,7 @@ typedef enum DUCKDB_V2_RESULT_STEP_STATUS { * *out_result is set to nullptr on failure. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param conn The connection on which to execute the statement. * @param statement The statement to execute. Borrowed and copied; not consumed. Destroy it with sql_statement_destroy. @@ -11059,7 +12143,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_statement_execute(duckdb_v2_connection_ha const duckdb_v2_value_handle *parameter_values, idx_t parameter_count, duckdb_v2_result_handle *out_result, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys a result handle. * @@ -11070,13 +12156,15 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_statement_execute(duckdb_v2_connection_ha * already fetched are caller-owned and stay valid. On success the slot is set to nullptr. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param result The result to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_result_destroy(duckdb_v2_result_handle *result); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Runs one bounded unit of query execution and returns without blocking. * @@ -11097,7 +12185,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_result_destroy(duckdb_v2_result_handle *r * *out_chunk is nullptr. Errors are sticky, so later steps report the same code. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param result The result to step. * @param out_chunk Receives an owned chunk if *out_status is CHUNK; set to nullptr otherwise. @@ -11109,7 +12197,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_result_step(duckdb_v2_result_handle resul duckdb_v2_data_chunk_handle *out_chunk, DUCKDB_V2_RESULT_STEP_STATUS *out_status, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Blocks until the next chunk is available and returns it. * @@ -11123,7 +12213,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_result_step(duckdb_v2_result_handle resul * On failure *out_chunk is set to nullptr. Errors are sticky, so later calls report the same code. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param result The result to fetch from. * @param out_chunk Receives an owned chunk, or nullptr at end-of-stream. @@ -11133,7 +12223,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_result_step(duckdb_v2_result_handle resul DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_result_fetch_chunk(duckdb_v2_result_handle result, duckdb_v2_data_chunk_handle *out_chunk, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Blocks until result_step can make progress. * @@ -11142,14 +12234,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_result_fetch_chunk(duckdb_v2_result_handl * or a sticky error — returns immediately; it is a no-op, never an error. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param result The result to wait on. * @param err Optional. On failure, receives an opaque info handle the caller must destroy via error_info_destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_result_wait(duckdb_v2_result_handle result, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Renders the result as a box table, consuming it. * @@ -11171,7 +12265,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_result_wait(duckdb_v2_result_handle resul * length — write it straight to a stream, or copy it into your own string. sink must not be NULL. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param result The result to render; consumed and set to NULL. Left intact only when the call rejects null arguments. * @param max_rows Maximum rows displayed; 0 selects the renderer default (20). @@ -11194,7 +12288,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_result_render_box(duckdb_v2_result_handle const duckdb_v2_str *null_value, idx_t render_mode, idx_t limit, duckdb_v2_text_sink_fn sink, void *user_data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Runs the result to completion and reports the changed-row count. * @@ -11207,7 +12303,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_result_render_box(duckdb_v2_result_handle * ERROR_RUNTIME_INTERRUPT; errors are sticky, and on failure *out_rows_changed is unspecified. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param result The result to drain. * @param out_rows_changed Receives the affected row count for CHANGED_ROWS results, 0 otherwise. @@ -11216,7 +12312,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_result_render_box(duckdb_v2_result_handle */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_result_drain(duckdb_v2_result_handle result, idx_t *out_rows_changed, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the shape of the result: query, changed rows, or nothing. * @@ -11228,7 +12326,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_result_drain(duckdb_v2_result_handle resu * without one. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param result The result. * @param out_type Receives the result shape. @@ -11238,7 +12336,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_result_drain(duckdb_v2_result_handle resu DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_result_get_result_type(duckdb_v2_result_handle result, DUCKDB_V2_RESULT_TYPE *out_type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the SQL statement type that produced the result. * @@ -11246,7 +12346,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_result_get_result_type(duckdb_v2_result_h * written: MULTI, or PRAGMA for a pragma such as IMPORT DATABASE. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param result The result. * @param out_type Receives the statement type. @@ -11256,7 +12356,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_result_get_result_type(duckdb_v2_result_h DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_result_get_statement_type(duckdb_v2_result_handle result, DUCKDB_V2_STATEMENT_TYPE *out_type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the result's output schema as a single schema handle. * @@ -11271,7 +12373,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_result_get_statement_type(duckdb_v2_resul * *out_schema is set to NULL on failure. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param result The result. * @param out_schema Receives the owned output schema. Destroy via schema_destroy. @@ -11281,6 +12383,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_result_get_statement_type(duckdb_v2_resul DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_result_get_schema(duckdb_v2_result_handle result, duckdb_v2_schema_handle *out_schema, duckdb_v2_error_info_handle *err); +#endif /* --- Struct definitions for query_result --- */ @@ -11477,6 +12580,7 @@ typedef void (*duckdb_v2_table_function_get_bind_info_callback_fn)( /* --- Functions for table --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a new table function through a factory. * @@ -11489,7 +12593,7 @@ typedef void (*duckdb_v2_table_function_get_bind_info_callback_fn)( * The table function can only be registered on the database the factory belongs to. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create the table function through. * @param function On success, receives the newly created table function. Owned by the caller. @@ -11500,7 +12604,9 @@ typedef void (*duckdb_v2_table_function_get_bind_info_callback_fn)( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_create(duckdb_v2_factory_handle factory, duckdb_v2_table_function_handle *function, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the name of the table function. * @@ -11508,7 +12614,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_create(duckdb_v2_factory_h * registration. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the name of. * @param name The name to set. Borrowed and copied. @@ -11519,7 +12625,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_create(duckdb_v2_factory_h DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_name(duckdb_v2_table_function_handle function, const duckdb_v2_identifier_t *name, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the documentation of the function so it can be filled in. * @@ -11528,7 +12636,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_name(duckdb_v2_table_f * in place, describes this overload only, and is registered with the function. Optional. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to get the documentation of. * @param docs The returned documentation. Borrowed and valid for the lifetime of the function handle. @@ -11539,7 +12647,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_name(duckdb_v2_table_f DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_get_docs(duckdb_v2_table_function_handle function, duckdb_v2_function_docs_handle *docs, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the function's signature so it can be configured. * @@ -11548,7 +12658,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_get_docs(duckdb_v2_table_f * rejects a signature whose return type was set with `duckdb_v2_function_signature_set_return_type()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to get the signature of. * @param sig The returned signature. Borrowed and valid for the lifetime of the function handle. @@ -11559,7 +12669,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_get_docs(duckdb_v2_table_f DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_get_signature(duckdb_v2_table_function_handle function, duckdb_v2_function_signature_handle *sig, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets arbitrary user data on the table function. * @@ -11569,7 +12681,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_get_signature(duckdb_v2_ta * the pointer with an optional destructor, invoked when the data is no longer needed. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the user data of. * @param data Opaque handle bundling the user data pointer plus an optional destructor. @@ -11580,7 +12692,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_get_signature(duckdb_v2_ta DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_user_data(duckdb_v2_table_function_handle function, duckdb_v2_opaque *data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the bind callback of the table function. * @@ -11590,7 +12704,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_user_data(duckdb_v2_ta * shared with all later callbacks. A bind callback must be set before registration. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the bind callback of. * @param callback The bind callback to set. @@ -11601,7 +12715,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_user_data(duckdb_v2_ta DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_bind_callback( duckdb_v2_table_function_handle function, duckdb_v2_table_function_bind_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the optional global init callback of the table function. * @@ -11610,7 +12726,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_bind_callback( * `duckdb_v2_table_function_init_global_set_max_threads()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the global init callback of. * @param callback The global init callback to set. @@ -11621,7 +12737,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_bind_callback( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_init_global_callback( duckdb_v2_table_function_handle function, duckdb_v2_table_function_init_global_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the optional local init callback of the table function. * @@ -11629,7 +12747,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_init_global_callback( * state", retrievable from the exec callback, typically derived from the shared global state. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the local init callback of. * @param callback The local init callback to set. @@ -11640,7 +12758,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_init_global_callback( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_init_local_callback( duckdb_v2_table_function_handle function, duckdb_v2_table_function_init_local_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the exec callback of the table function. * @@ -11649,7 +12769,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_init_local_callback( * callback must be set before registration. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the exec callback of. * @param callback The exec callback to set. @@ -11660,7 +12780,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_init_local_callback( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_exec_callback( duckdb_v2_table_function_handle function, duckdb_v2_table_function_exec_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the optional progress callback of the table function. * @@ -11669,7 +12791,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_exec_callback( * in a thread-safe way. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the progress callback of. * @param callback The progress callback to set. @@ -11680,7 +12802,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_exec_callback( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_progress_callback( duckdb_v2_table_function_handle function, duckdb_v2_table_function_progress_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets whether the table function supports projection pushdown. Defaults to false. * @@ -11691,7 +12815,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_progress_callback( * and the engine drops the unused ones itself. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to configure. * @param enable Whether the function supports projection pushdown. @@ -11702,7 +12826,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_progress_callback( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_projection_pushdown(duckdb_v2_table_function_handle function, bool enable, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the optional filter pushdown callback of the table function. * @@ -11715,7 +12841,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_projection_pushdown(du * once for the same query, each time with the predicates not yet accepted; it is not invoked when there are none. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the filter pushdown callback of. * @param callback The filter pushdown callback to set. @@ -11726,7 +12852,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_projection_pushdown(du DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_filter_pushdown_callback( duckdb_v2_table_function_handle function, duckdb_v2_table_function_filter_pushdown_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the optional "partition data" callback of the table function. * @@ -11737,7 +12865,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_filter_pushdown_callba * `TABLE_PARTITION_INFO_SINGLE_VALUE_PARTITIONS`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the partition data callback of. * @param callback The partition data callback to set. @@ -11748,7 +12876,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_filter_pushdown_callba DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_partition_data_callback( duckdb_v2_table_function_handle function, duckdb_v2_table_function_partition_data_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the optional "partitioning" callback of the table function. * @@ -11761,7 +12891,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_partition_data_callbac * partitioning column values once this one claims single-value partitions. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to set the partitioning callback of. * @param callback The partitioning callback to set. @@ -11772,7 +12902,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_partition_data_callbac DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_partitioning_callback( duckdb_v2_table_function_handle function, duckdb_v2_table_function_partitioning_callback_fn callback, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Declares one of the columns the function returns. * @@ -11782,7 +12914,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_partitioning_callback( * and type are borrowed and copied. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param name The name of the column. Borrowed and copied. @@ -11794,7 +12926,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_set_partitioning_callback( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_bind_add_result_column( duckdb_v2_table_function_bind_info_handle info, const duckdb_v2_identifier_t *name, duckdb_v2_logical_type_handle type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the estimated number of rows the scan will produce. * @@ -11802,7 +12936,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_bind_add_result_column( * it, the optimizer falls back on its own defaults. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param cardinality The estimated number of rows. @@ -11813,7 +12947,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_bind_add_result_column( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_bind_set_cardinality( duckdb_v2_table_function_bind_info_handle info, idx_t cardinality, bool is_exact, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the order guarantee of the rows this call of the function produces. Defaults to * `ORDER_PRESERVATION_INSERTION_ORDER`. @@ -11825,7 +12961,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_bind_set_cardinality( * `ERROR_INPUT_INVALID` when order is not one of the enum's declared values. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The bind info handle. * @param order The order guarantee of the produced rows. @@ -11836,12 +12972,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_bind_set_cardinality( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_bind_set_order_preservation( duckdb_v2_table_function_bind_info_handle info, DUCKDB_V2_ORDER_PRESERVATION order, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_table_function_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The global init info handle. * @param data Receives the user data pointer, or null if none was set. @@ -11851,12 +12989,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_bind_set_order_preservatio */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_global_get_user_data( duckdb_v2_table_function_init_global_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the bind data set by the function's bind callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The global init info handle. * @param data Receives the bind data pointer, or null if none was set. @@ -11866,7 +13006,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_global_get_user_data( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_global_get_bind_data( duckdb_v2_table_function_init_global_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the function's "global state" from the global init callback. * @@ -11875,7 +13017,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_global_get_bind_data( * opaque handle bundles the pointer with an optional destructor, invoked when the scan is done with the state. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The global init info handle. * @param data Opaque handle bundling the global state pointer plus an optional destructor. @@ -11885,7 +13027,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_global_get_bind_data( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_global_set_global_state( duckdb_v2_table_function_init_global_info_handle info, duckdb_v2_opaque *data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets how many threads may scan the function in parallel. * @@ -11893,7 +13037,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_global_set_global_sta * this many exec callbacks concurrently. It is an upper bound, not a request: the engine may use fewer threads. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The global init info handle. * @param max_threads The maximum number of threads. Must be at least 1. @@ -11903,7 +13047,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_global_set_global_sta */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_global_set_max_threads( duckdb_v2_table_function_init_global_info_handle info, idx_t max_threads, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the number of columns the scan produces. * @@ -11913,7 +13059,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_global_set_max_thread * (but excluding) this count. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The global init info handle. * @param count Receives the number of columns the scan produces. @@ -11923,7 +13069,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_global_set_max_thread */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_global_get_column_count( duckdb_v2_table_function_init_global_info_handle info, idx_t *count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns which declared column the scan's column at the given index stands for. * @@ -11932,7 +13080,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_global_get_column_cou * pushdown the mapping is the identity. Fails if the index is out of bounds. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The global init info handle. * @param index The index of the column in the scan's output. @@ -11944,12 +13092,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_global_get_column_cou DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_global_get_column_index( duckdb_v2_table_function_init_global_info_handle info, idx_t index, idx_t *column_index, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_table_function_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The local init info handle. * @param data Receives the user data pointer, or null if none was set. @@ -11959,12 +13109,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_global_get_column_ind */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_local_get_user_data( duckdb_v2_table_function_init_local_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the bind data set by the function's bind callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The local init info handle. * @param data Receives the bind data pointer, or null if none was set. @@ -11974,14 +13126,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_local_get_user_data( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_local_get_bind_data( duckdb_v2_table_function_init_local_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the global state set by the function's global init callback. * * Shared with every other thread scanning the function; access to it must be synchronized by the function. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The local init info handle. * @param data Receives the global state pointer, or null if none was set. @@ -11991,7 +13145,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_local_get_bind_data( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_local_get_global_state( duckdb_v2_table_function_init_local_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Sets the function's worker-local "local state" from the local init callback. * @@ -12001,7 +13157,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_local_get_global_stat * no longer needed. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The local init info handle. * @param data Opaque handle bundling the local state pointer plus an optional destructor. @@ -12011,7 +13167,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_local_get_global_stat */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_local_set_local_state( duckdb_v2_table_function_init_local_info_handle info, duckdb_v2_opaque *data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the number of columns the scan produces. * @@ -12021,7 +13179,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_local_set_local_state * (but excluding) this count. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The local init info handle. * @param count Receives the number of columns the scan produces. @@ -12031,7 +13189,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_local_set_local_state */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_local_get_column_count( duckdb_v2_table_function_init_local_info_handle info, idx_t *count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns which declared column the scan's column at the given index stands for. * @@ -12040,7 +13200,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_local_get_column_coun * pushdown the mapping is the identity. Fails if the index is out of bounds. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The local init info handle. * @param index The index of the column in the scan's output. @@ -12052,12 +13212,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_local_get_column_coun DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_init_local_get_column_index(duckdb_v2_table_function_init_local_info_handle info, idx_t index, idx_t *column_index, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_table_function_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The exec info handle. * @param data Receives the user data pointer, or null if none was set. @@ -12067,12 +13229,14 @@ duckdb_v2_table_function_init_local_get_column_index(duckdb_v2_table_function_in */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_exec_get_user_data(duckdb_v2_table_function_exec_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the bind data set by the function's bind callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The exec info handle. * @param data Receives the bind data pointer, or null if none was set. @@ -12082,14 +13246,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_exec_get_user_data(duckdb_ */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_exec_get_bind_data(duckdb_v2_table_function_exec_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the global state set by the function's global init callback. * * Shared with every other thread scanning the function; access to it must be synchronized by the function. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The exec info handle. * @param data Receives the global state pointer, or null if none was set. @@ -12099,12 +13265,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_exec_get_bind_data(duckdb_ */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_exec_get_global_state( duckdb_v2_table_function_exec_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the worker-local local state set by the function's local init callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The exec info handle. * @param data Receives the local state pointer for the executing thread, or null if none was set. @@ -12114,7 +13282,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_exec_get_global_state( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_exec_get_local_state( duckdb_v2_table_function_exec_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the output chunk the exec callback must write the next batch of rows into. * @@ -12125,7 +13295,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_exec_get_local_state( * after which the callback is not invoked again on that thread. Borrowed; valid only for the duration of the callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The exec info handle. * @param chunk Receives the borrowed output chunk to write into. @@ -12136,7 +13306,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_exec_get_local_state( DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_exec_get_output_chunk(duckdb_v2_table_function_exec_info_handle info, duckdb_v2_data_chunk_handle *chunk, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the number of columns the scan produces. * @@ -12146,7 +13318,7 @@ duckdb_v2_table_function_exec_get_output_chunk(duckdb_v2_table_function_exec_inf * excluding) this count. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The exec info handle. * @param count Receives the number of columns the scan produces. @@ -12156,7 +13328,9 @@ duckdb_v2_table_function_exec_get_output_chunk(duckdb_v2_table_function_exec_inf */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_exec_get_column_count( duckdb_v2_table_function_exec_info_handle info, idx_t *count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns which declared column the scan's column at the given index stands for. * @@ -12165,7 +13339,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_exec_get_column_count( * pushdown the mapping is the identity. Fails if the index is out of bounds. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The exec info handle. * @param index The index of the column in the scan's output. @@ -12176,12 +13350,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_exec_get_column_count( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_exec_get_column_index( duckdb_v2_table_function_exec_info_handle info, idx_t index, idx_t *column_index, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_table_function_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The progress info handle. * @param data Receives the user data pointer, or null if none was set. @@ -12191,12 +13367,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_exec_get_column_index( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_progress_get_user_data( duckdb_v2_table_function_progress_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the bind data set by the function's bind callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The progress info handle. * @param data Receives the bind data pointer, or null if none was set. @@ -12206,7 +13384,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_progress_get_user_data( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_progress_get_bind_data( duckdb_v2_table_function_progress_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the global state set by the function's global init callback. * @@ -12214,7 +13394,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_progress_get_bind_data( * state in a thread-safe way. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The progress info handle. * @param data Receives the global state pointer, or null if none was set. @@ -12224,7 +13404,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_progress_get_bind_data( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_progress_get_global_state( duckdb_v2_table_function_progress_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Reports how far the scan has advanced. * @@ -12232,7 +13414,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_progress_get_global_state( * callback that returns without calling this reports no progress. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The progress info handle. * @param progress The fraction of the scan that is complete, in [0.0, 1.0]. @@ -12242,12 +13424,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_progress_get_global_state( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_progress_set_progress( duckdb_v2_table_function_progress_info_handle info, double progress, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_table_function_set_user_data()`, or null if none was set. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The filter pushdown info handle. * @param data Receives the user data pointer. @@ -12257,7 +13441,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_progress_set_progress( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_filter_pushdown_get_user_data( duckdb_v2_table_function_filter_pushdown_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the bind data set via `duckdb_v2_function_bind_set_bind_data()`, or null if none was set. * @@ -12265,7 +13451,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_filter_pushdown_get_user_d * recorded in it for the scan to apply. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The filter pushdown info handle. * @param data Receives the bind data pointer. @@ -12275,7 +13461,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_filter_pushdown_get_user_d */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_filter_pushdown_get_bind_data( duckdb_v2_table_function_filter_pushdown_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the number of filter predicates offered to the function. * @@ -12284,7 +13472,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_filter_pushdown_get_bind_d * `0` up to (but excluding) this count. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The filter pushdown info handle. * @param count Receives the number of predicates. @@ -12294,7 +13482,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_filter_pushdown_get_bind_d */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_filter_pushdown_get_filter_count( duckdb_v2_table_function_filter_pushdown_info_handle info, idx_t *count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the filter predicate at the given index. * @@ -12304,7 +13494,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_filter_pushdown_get_filter * callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The filter pushdown info handle. * @param index The index of the predicate to retrieve. @@ -12316,7 +13506,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_filter_pushdown_get_filter DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_filter_pushdown_get_filter( duckdb_v2_table_function_filter_pushdown_info_handle info, idx_t index, duckdb_v2_expression_handle *filter, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Accepts the filter predicate at the given index: the function will apply it itself. * @@ -12325,7 +13517,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_filter_pushdown_get_filter * recognizes nothing can simply return. Fails if the index is out of bounds. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The filter pushdown info handle. * @param index The index of the predicate to accept. @@ -12335,7 +13527,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_filter_pushdown_get_filter */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_filter_pushdown_accept( duckdb_v2_table_function_filter_pushdown_info_handle info, idx_t index, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the number of columns the predicates can refer to. * @@ -12344,7 +13538,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_filter_pushdown_accept( * `duckdb_v2_table_function_filter_pushdown_get_column_index()` are `0` up to (but excluding) this count. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The filter pushdown info handle. * @param count Receives the number of referable columns. @@ -12354,7 +13548,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_filter_pushdown_accept( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_filter_pushdown_get_column_count( duckdb_v2_table_function_filter_pushdown_info_handle info, idx_t *count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Resolves a column reference found in a predicate to the declared column it refers to. * @@ -12363,7 +13559,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_filter_pushdown_get_column * bounds. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The filter pushdown info handle. * @param index The column index reported by a column reference node. @@ -12375,12 +13571,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_filter_pushdown_get_column DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_filter_pushdown_get_column_index( duckdb_v2_table_function_filter_pushdown_info_handle info, idx_t index, idx_t *column_index, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_table_function_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The partition data info handle. * @param data Receives the user data pointer, or null if none was set. @@ -12390,12 +13588,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_filter_pushdown_get_column */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partition_data_get_user_data( duckdb_v2_table_function_partition_data_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the bind data set by the function's bind callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The partition data info handle. * @param data Receives the bind data pointer, or null if none was set. @@ -12405,14 +13605,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partition_data_get_user_da */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partition_data_get_bind_data( duckdb_v2_table_function_partition_data_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the global state set by the function's global init callback. * * Shared with every other thread scanning the function; access to it must be synchronized by the function. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The partition data info handle. * @param data Receives the global state pointer, or null if none was set. @@ -12422,13 +13624,15 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partition_data_get_bind_da */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partition_data_get_global_state( duckdb_v2_table_function_partition_data_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the worker-local local state set by the function's local init callback, for the thread that produced the * batch this call reports on. No other thread observes it, so it needs no synchronization. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The partition data info handle. * @param data Receives the local state pointer, or null if none was set. @@ -12438,7 +13642,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partition_data_get_global_ */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partition_data_get_local_state( duckdb_v2_table_function_partition_data_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns whether a downstream operator needs this batch's ordering position. * @@ -12447,7 +13653,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partition_data_get_local_s * when this reports false. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The partition data info handle. * @param required Receives whether a batch index is required. @@ -12457,7 +13663,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partition_data_get_local_s */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partition_data_requires_batch_index( duckdb_v2_table_function_partition_data_info_handle info, bool *required, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns whether a downstream operator needs this batch's values for a set of partitioning columns. * @@ -12465,7 +13673,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partition_data_requires_ba * where `count` comes from `duckdb_v2_table_function_partition_data_get_partition_column_count()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The partition data info handle. * @param required Receives whether partitioning column values are required. @@ -12475,7 +13683,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partition_data_requires_ba */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partition_data_requires_partition_columns( duckdb_v2_table_function_partition_data_info_handle info, bool *required, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the number of partitioning columns a downstream operator is requesting values for. * @@ -12484,7 +13694,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partition_data_requires_pa * `duckdb_v2_table_function_partition_data_set_partition_value()` are `0` up to (but excluding) this count. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The partition data info handle. * @param count Receives the number of requested partitioning columns. @@ -12494,7 +13704,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partition_data_requires_pa */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partition_data_get_partition_column_count( duckdb_v2_table_function_partition_data_info_handle info, idx_t *count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns which declared column the requested partitioning column at the given index stands for. * @@ -12502,7 +13714,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partition_data_get_partiti * order. Fails if the index is out of bounds. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The partition data info handle. * @param index The index of the requested partitioning column. @@ -12514,7 +13726,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partition_data_get_partiti DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partition_data_get_partition_column_index( duckdb_v2_table_function_partition_data_info_handle info, idx_t index, idx_t *column_index, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Reports the ordering position of the batch the exec callback just produced. * @@ -12528,7 +13742,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partition_data_get_partiti * an unchanged value paired with changed partitioning columns fails the query once the callback returns. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The partition data info handle. * @param batch_index The batch's ordering position. @@ -12538,7 +13752,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partition_data_get_partiti */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partition_data_set_batch_index( duckdb_v2_table_function_partition_data_info_handle info, idx_t batch_index, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Reports the single value of the partitioning column at the given index, for the batch the exec callback just * produced. @@ -12553,7 +13769,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partition_data_set_batch_i * the value's type does not match. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The partition data info handle. * @param index The index of the partitioning column being reported. @@ -12565,12 +13781,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partition_data_set_batch_i DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partition_data_set_partition_value( duckdb_v2_table_function_partition_data_info_handle info, idx_t index, duckdb_v2_value_handle value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the user data set via `duckdb_v2_table_function_set_user_data()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The partitioning info handle. * @param data Receives the user data pointer, or null if none was set. @@ -12580,12 +13798,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partition_data_set_partiti */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partitioning_get_user_data( duckdb_v2_table_function_partitioning_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Retrieves the bind data set by the function's bind callback. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The partitioning info handle. * @param data Receives the bind data pointer, or null if none was set. @@ -12595,7 +13815,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partitioning_get_user_data */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partitioning_get_bind_data( duckdb_v2_table_function_partitioning_info_handle info, void **data, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the number of columns the optimizer is asking about: the candidate `GROUP BY` column set. * @@ -12603,7 +13825,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partitioning_get_bind_data * this count. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The partitioning info handle. * @param count Receives the number of columns in the candidate set. @@ -12613,7 +13835,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partitioning_get_bind_data */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partitioning_get_partition_column_count( duckdb_v2_table_function_partitioning_info_handle info, idx_t *count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns which declared column the candidate `GROUP BY` column at the given index stands for. * @@ -12621,7 +13845,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partitioning_get_partition * order. Fails if the index is out of bounds. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The partitioning info handle. * @param index The index of the candidate column. @@ -12633,7 +13857,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partitioning_get_partition DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partitioning_get_partition_column_index( duckdb_v2_table_function_partitioning_info_handle info, idx_t index, idx_t *column_index, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Reports whether every partition the scan produces carries exactly one distinct value for the candidate `GROUP BY` * column set. @@ -12644,7 +13870,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partitioning_get_partition * declared values. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param info The partitioning info handle. * @param partition_info Whether, and how, the scan is partitioned by the candidate column set. @@ -12655,7 +13881,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partitioning_get_partition DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partitioning_set_partition_info( duckdb_v2_table_function_partitioning_info_handle info, DUCKDB_V2_TABLE_PARTITION_INFO partition_info, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Registers the table function, making it available for use in SQL queries. * @@ -12668,7 +13896,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partitioning_set_partition * function. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param conn The connection to register on. * @param function The table function to register. @@ -12679,7 +13907,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_partitioning_set_partition DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_register_table_function(duckdb_v2_connection_handle conn, duckdb_v2_table_function_handle function, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Registers the table function, making it available for use in SQL queries. * @@ -12691,7 +13921,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_register_table_function(duckdb * registered function. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param extension The loading extension. * @param function The table function to register. @@ -12702,7 +13932,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_connection_register_table_function(duckdb DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_extension_register_table_function(duckdb_v2_extension_handle extension, duckdb_v2_table_function_handle function, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys the table function, releasing its resources. * @@ -12710,12 +13942,13 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_extension_register_table_function(duckdb_ * double-destruction. Destroying the handle after registration does not affect the registered function. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param function The function to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_table_function_destroy(duckdb_v2_table_function_handle *function); +#endif #if DUCKDB_V2_API_ALLOW_UNSTABLE /*! @@ -13161,19 +14394,22 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_multi_file_function_destroy(duckdb_v2_mul /* --- Functions for value --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys a value handle. * * Null-safe: passing nullptr or a slot already set to nullptr is a no-op. On success the slot is set to nullptr. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_destroy(duckdb_v2_value_handle *value); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value as a BOOLEAN. * @@ -13181,7 +14417,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_destroy(duckdb_v2_value_handle *val * An unsupported conversion returns ERROR_INPUT_INVALID, as does a NULL value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out Receives the payload as a bool. @@ -13190,7 +14426,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_destroy(duckdb_v2_value_handle *val */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_bool(duckdb_v2_value_handle value, bool *out, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value as a UTINYINT. * @@ -13198,7 +14436,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_bool(duckdb_v2_value_handle val * An unsupported conversion returns ERROR_INPUT_INVALID, as does a NULL value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out Receives the payload as a uint8_t. @@ -13207,7 +14445,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_bool(duckdb_v2_value_handle val */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_utinyint(duckdb_v2_value_handle value, uint8_t *out, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value as a USMALLINT. * @@ -13215,7 +14455,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_utinyint(duckdb_v2_value_handle * An unsupported conversion returns ERROR_INPUT_INVALID, as does a NULL value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out Receives the payload as a uint16_t. @@ -13224,7 +14464,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_utinyint(duckdb_v2_value_handle */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_usmallint(duckdb_v2_value_handle value, uint16_t *out, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value as a UINTEGER. * @@ -13232,7 +14474,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_usmallint(duckdb_v2_value_handl * An unsupported conversion returns ERROR_INPUT_INVALID, as does a NULL value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out Receives the payload as a uint32_t. @@ -13241,7 +14483,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_usmallint(duckdb_v2_value_handl */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_uint(duckdb_v2_value_handle value, uint32_t *out, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value as a UBIGINT. * @@ -13249,7 +14493,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_uint(duckdb_v2_value_handle val * An unsupported conversion returns ERROR_INPUT_INVALID, as does a NULL value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out Receives the payload as a uint64_t. @@ -13258,7 +14502,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_uint(duckdb_v2_value_handle val */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_ubigint(duckdb_v2_value_handle value, uint64_t *out, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value as a UHUGEINT. * @@ -13266,7 +14512,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_ubigint(duckdb_v2_value_handle * An unsupported conversion returns ERROR_INPUT_INVALID, as does a NULL value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out Receives the payload as a uint128_t. @@ -13275,7 +14521,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_ubigint(duckdb_v2_value_handle */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_uhugeint(duckdb_v2_value_handle value, duckdb_v2_uhugeint_t *out, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value as a TINYINT. * @@ -13283,7 +14531,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_uhugeint(duckdb_v2_value_handle * An unsupported conversion returns ERROR_INPUT_INVALID, as does a NULL value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out Receives the payload as an int8_t. @@ -13292,7 +14540,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_uhugeint(duckdb_v2_value_handle */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_tinyint(duckdb_v2_value_handle value, int8_t *out, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value as a SMALLINT. * @@ -13300,7 +14550,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_tinyint(duckdb_v2_value_handle * An unsupported conversion returns ERROR_INPUT_INVALID, as does a NULL value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out Receives the payload as an int16_t. @@ -13309,7 +14559,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_tinyint(duckdb_v2_value_handle */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_smallint(duckdb_v2_value_handle value, int16_t *out, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value as an INTEGER. * @@ -13317,7 +14569,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_smallint(duckdb_v2_value_handle * An unsupported conversion returns ERROR_INPUT_INVALID, as does a NULL value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out Receives the payload as an int32_t. @@ -13326,7 +14578,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_smallint(duckdb_v2_value_handle */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_int(duckdb_v2_value_handle value, int32_t *out, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value as a BIGINT. * @@ -13334,7 +14588,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_int(duckdb_v2_value_handle valu * An unsupported conversion returns ERROR_INPUT_INVALID, as does a NULL value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out Receives the payload as an int64_t. @@ -13343,7 +14597,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_int(duckdb_v2_value_handle valu */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_bigint(duckdb_v2_value_handle value, int64_t *out, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value as a HUGEINT. * @@ -13351,7 +14607,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_bigint(duckdb_v2_value_handle v * An unsupported conversion returns ERROR_INPUT_INVALID, as does a NULL value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out Receives the payload as an int128_t. @@ -13360,7 +14616,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_bigint(duckdb_v2_value_handle v */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_hugeint(duckdb_v2_value_handle value, duckdb_v2_hugeint_t *out, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value as a VARCHAR. * @@ -13369,7 +14627,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_hugeint(duckdb_v2_value_handle * ERROR_INPUT_INVALID. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out Receives the payload as a UTF-8 string. The returned string is borrowed and valid until the value handle @@ -13379,7 +14637,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_hugeint(duckdb_v2_value_handle */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_varchar(duckdb_v2_value_handle value, duckdb_v2_str *out, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value as a byte string: a BLOB, or the storage bytes of a BIT or BIGNUM. * @@ -13388,7 +14648,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_varchar(duckdb_v2_value_handle * ERROR_INPUT_INVALID. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out Receives the payload as a byte string. The returned string is borrowed and valid until the value handle is @@ -13398,7 +14658,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_varchar(duckdb_v2_value_handle */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_blob(duckdb_v2_value_handle value, duckdb_v2_str *out, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value as a FLOAT. * @@ -13406,7 +14668,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_blob(duckdb_v2_value_handle val * An unsupported conversion returns ERROR_INPUT_INVALID, as does a NULL value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out Receives the payload as a float. @@ -13415,7 +14677,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_blob(duckdb_v2_value_handle val */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_float(duckdb_v2_value_handle value, float *out, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value as a DOUBLE. * @@ -13423,7 +14687,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_float(duckdb_v2_value_handle va * An unsupported conversion returns ERROR_INPUT_INVALID, as does a NULL value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out Receives the payload as a double. @@ -13432,7 +14696,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_float(duckdb_v2_value_handle va */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_double(duckdb_v2_value_handle value, double *out, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value as a DATE. * @@ -13442,7 +14708,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_double(duckdb_v2_value_handle v * An unsupported conversion returns ERROR_INPUT_INVALID, as does a NULL value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out Receives the payload. @@ -13451,7 +14717,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_double(duckdb_v2_value_handle v */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_date(duckdb_v2_value_handle value, int32_t *out, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value as a TIME. * @@ -13461,7 +14729,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_date(duckdb_v2_value_handle val * An unsupported conversion returns ERROR_INPUT_INVALID, as does a NULL value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out Receives the payload. @@ -13470,7 +14738,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_date(duckdb_v2_value_handle val */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_time(duckdb_v2_value_handle value, int64_t *out, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value as a TIME_NS. * @@ -13480,7 +14750,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_time(duckdb_v2_value_handle val * An unsupported conversion returns ERROR_INPUT_INVALID, as does a NULL value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out Receives the payload. @@ -13489,7 +14759,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_time(duckdb_v2_value_handle val */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_time_ns(duckdb_v2_value_handle value, int64_t *out, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value as a TIME_TZ. * @@ -13500,7 +14772,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_time_ns(duckdb_v2_value_handle * An unsupported conversion returns ERROR_INPUT_INVALID, as does a NULL value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out Receives the payload. @@ -13509,7 +14781,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_time_ns(duckdb_v2_value_handle */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_time_tz(duckdb_v2_value_handle value, uint64_t *out, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value as a TIMESTAMP. * @@ -13519,7 +14793,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_time_tz(duckdb_v2_value_handle * An unsupported conversion returns ERROR_INPUT_INVALID, as does a NULL value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out Receives the payload. @@ -13528,7 +14802,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_time_tz(duckdb_v2_value_handle */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_timestamp(duckdb_v2_value_handle value, int64_t *out, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value as a TIMESTAMP_SEC. * @@ -13538,7 +14814,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_timestamp(duckdb_v2_value_handl * An unsupported conversion returns ERROR_INPUT_INVALID, as does a NULL value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out Receives the payload. @@ -13547,7 +14823,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_timestamp(duckdb_v2_value_handl */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_timestamp_sec(duckdb_v2_value_handle value, int64_t *out, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value as a TIMESTAMP_MS. * @@ -13557,7 +14835,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_timestamp_sec(duckdb_v2_value_h * An unsupported conversion returns ERROR_INPUT_INVALID, as does a NULL value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out Receives the payload. @@ -13566,7 +14844,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_timestamp_sec(duckdb_v2_value_h */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_timestamp_ms(duckdb_v2_value_handle value, int64_t *out, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value as a TIMESTAMP_NS. * @@ -13576,7 +14856,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_timestamp_ms(duckdb_v2_value_ha * An unsupported conversion returns ERROR_INPUT_INVALID, as does a NULL value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out Receives the payload. @@ -13585,7 +14865,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_timestamp_ms(duckdb_v2_value_ha */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_timestamp_ns(duckdb_v2_value_handle value, int64_t *out, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value as a TIMESTAMP_TZ. * @@ -13595,7 +14877,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_timestamp_ns(duckdb_v2_value_ha * An unsupported conversion returns ERROR_INPUT_INVALID, as does a NULL value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out Receives the payload. @@ -13604,7 +14886,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_timestamp_ns(duckdb_v2_value_ha */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_timestamp_tz(duckdb_v2_value_handle value, int64_t *out, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value as a TIMESTAMP_TZ_NS. * @@ -13614,7 +14898,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_timestamp_tz(duckdb_v2_value_ha * An unsupported conversion returns ERROR_INPUT_INVALID, as does a NULL value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out Receives the payload. @@ -13623,7 +14907,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_timestamp_tz(duckdb_v2_value_ha */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_timestamp_tz_ns(duckdb_v2_value_handle value, int64_t *out, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value as an INTERVAL. * @@ -13633,7 +14919,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_timestamp_tz_ns(duckdb_v2_value * An unsupported conversion returns ERROR_INPUT_INVALID, as does a NULL value. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out Receives the payload. @@ -13642,7 +14928,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_timestamp_tz_ns(duckdb_v2_value */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_interval(duckdb_v2_value_handle value, duckdb_v2_interval_t *out, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value as a UUID, in its internal 128-bit form. * @@ -13651,7 +14939,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_interval(duckdb_v2_value_handle * ERROR_INPUT_INVALID. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out Receives the internal 128-bit storage form. @@ -13660,7 +14948,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_interval(duckdb_v2_value_handle */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_uuid(duckdb_v2_value_handle value, duckdb_v2_hugeint_t *out, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the value as a DECIMAL: its backing integer plus the width and scale of its type. * @@ -13670,7 +14960,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_uuid(duckdb_v2_value_handle val * interpret it. A value of any other type id, and a NULL value, return ERROR_INPUT_INVALID. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out Receives the backing integer, scaled by 10^scale. @@ -13682,7 +14972,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_uuid(duckdb_v2_value_handle val DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_decimal(duckdb_v2_value_handle value, duckdb_v2_hugeint_t *out, uint8_t *out_width, uint8_t *out_scale, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Unwraps the logical type carried by a TYPE value. * @@ -13690,7 +14982,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_decimal(duckdb_v2_value_handle * must be destroyed via logical_type_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out_type Receives the owned logical type. @@ -13700,14 +14992,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_decimal(duckdb_v2_value_handle DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_type(duckdb_v2_value_handle value, duckdb_v2_logical_type_handle *out_type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a NULL value of the given logical type. * * The logical type is borrowed and copied into the value, so the caller can destroy it independently. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param type The borrowed logical type to attach to the NULL value. @@ -13719,14 +15013,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_null(duckdb_v2_factory_handl duckdb_v2_logical_type_handle type, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a BOOLEAN value from a bool. * * The input is copied in. The returned value is caller-owned; destroy it via value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The bool to wrap. @@ -13737,14 +15033,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_null(duckdb_v2_factory_handl DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_bool(duckdb_v2_factory_handle factory, bool in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a UTINYINT value from a uint8_t. * * The input is copied in. The returned value is caller-owned; destroy it via value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The uint8_t to wrap. @@ -13755,14 +15053,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_bool(duckdb_v2_factory_handl DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_utinyint(duckdb_v2_factory_handle factory, uint8_t in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a USMALLINT value from a uint16_t. * * The input is copied in. The returned value is caller-owned; destroy it via value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The uint16_t to wrap. @@ -13773,14 +15073,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_utinyint(duckdb_v2_factory_h DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_usmallint(duckdb_v2_factory_handle factory, uint16_t in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a UINTEGER value from a uint32_t. * * The input is copied in. The returned value is caller-owned; destroy it via value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The uint32_t to wrap. @@ -13791,14 +15093,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_usmallint(duckdb_v2_factory_ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_uint(duckdb_v2_factory_handle factory, uint32_t in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a UBIGINT value from a uint64_t. * * The input is copied in. The returned value is caller-owned; destroy it via value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The uint64_t to wrap. @@ -13809,14 +15113,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_uint(duckdb_v2_factory_handl DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_ubigint(duckdb_v2_factory_handle factory, uint64_t in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a UHUGEINT value from a uint128_t. * * The input is copied in. The returned value is caller-owned; destroy it via value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The uint128_t to wrap. @@ -13828,14 +15134,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_uhugeint(duckdb_v2_factory_h const duckdb_v2_uhugeint_t *in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a TINYINT value from an int8_t. * * The input is copied in. The returned value is caller-owned; destroy it via value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The int8_t to wrap. @@ -13846,14 +15154,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_uhugeint(duckdb_v2_factory_h DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_tinyint(duckdb_v2_factory_handle factory, int8_t in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a SMALLINT value from an int16_t. * * The input is copied in. The returned value is caller-owned; destroy it via value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The int16_t to wrap. @@ -13864,14 +15174,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_tinyint(duckdb_v2_factory_ha DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_smallint(duckdb_v2_factory_handle factory, int16_t in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates an INTEGER value from an int32_t. * * The input is copied in. The returned value is caller-owned; destroy it via value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The int32_t to wrap. @@ -13882,14 +15194,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_smallint(duckdb_v2_factory_h DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_int(duckdb_v2_factory_handle factory, int32_t in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a BIGINT value from an int64_t. * * The input is copied in. The returned value is caller-owned; destroy it via value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The int64_t to wrap. @@ -13900,14 +15214,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_int(duckdb_v2_factory_handle DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_bigint(duckdb_v2_factory_handle factory, int64_t in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a HUGEINT value from an int128_t. * * The input is copied in. The returned value is caller-owned; destroy it via value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The int128_t to wrap. @@ -13919,14 +15235,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_hugeint(duckdb_v2_factory_ha const duckdb_v2_hugeint_t *in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a VARCHAR value from a UTF-8 string. * * The input is copied in. The returned value is caller-owned; destroy it via value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The UTF-8 string to wrap. May be null only when len is 0 (empty string). @@ -13938,14 +15256,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_varchar(duckdb_v2_factory_ha const duckdb_v2_str *in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a BLOB value from a byte string. * * The input is copied in. The returned value is caller-owned; destroy it via value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The byte string to wrap. May be null only when len is 0 (empty string). @@ -13957,14 +15277,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_blob(duckdb_v2_factory_handl const duckdb_v2_str *in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a FLOAT value from a float. * * The input is copied in. The returned value is caller-owned; destroy it via value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The float to wrap. @@ -13975,14 +15297,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_blob(duckdb_v2_factory_handl DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_float(duckdb_v2_factory_handle factory, float in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a DOUBLE value from a double. * * The input is copied in. The returned value is caller-owned; destroy it via value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The double to wrap. @@ -13993,14 +15317,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_float(duckdb_v2_factory_hand DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_double(duckdb_v2_factory_handle factory, double in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a TYPE value from a logical type. * * The logical type is borrowed and copied into the value, so the caller can destroy it independently. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_type The borrowed logical type to wrap. @@ -14012,7 +15338,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_type(duckdb_v2_factory_handl duckdb_v2_logical_type_handle in_type, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a DATE value. * @@ -14020,7 +15348,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_type(duckdb_v2_factory_handl * is the validating path. The returned value is caller-owned; destroy it via value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The payload to wrap. @@ -14031,7 +15359,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_type(duckdb_v2_factory_handl DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_date(duckdb_v2_factory_handle factory, int32_t in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a TIME value. * @@ -14039,7 +15369,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_date(duckdb_v2_factory_handl * value_cast is the validating path. The returned value is caller-owned; destroy it via value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The payload to wrap. @@ -14050,7 +15380,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_date(duckdb_v2_factory_handl DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_time(duckdb_v2_factory_handle factory, int64_t in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a TIME_NS value. * @@ -14058,7 +15390,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_time(duckdb_v2_factory_handl * value_cast is the validating path. The returned value is caller-owned; destroy it via value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The payload to wrap. @@ -14069,7 +15401,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_time(duckdb_v2_factory_handl DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_time_ns(duckdb_v2_factory_handle factory, int64_t in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a TIME_TZ value. * @@ -14078,7 +15412,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_time_ns(duckdb_v2_factory_ha * value_cast is the validating path. The returned value is caller-owned; destroy it via value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The payload to wrap. @@ -14089,7 +15423,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_time_ns(duckdb_v2_factory_ha DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_time_tz(duckdb_v2_factory_handle factory, uint64_t in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a TIMESTAMP value. * @@ -14097,7 +15433,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_time_tz(duckdb_v2_factory_ha * here; value_cast is the validating path. The returned value is caller-owned; destroy it via value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The payload to wrap. @@ -14108,7 +15444,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_time_tz(duckdb_v2_factory_ha DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_timestamp(duckdb_v2_factory_handle factory, int64_t in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a TIMESTAMP_SEC value. * @@ -14116,7 +15454,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_timestamp(duckdb_v2_factory_ * value_cast is the validating path. The returned value is caller-owned; destroy it via value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The payload to wrap. @@ -14127,7 +15465,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_timestamp(duckdb_v2_factory_ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_timestamp_sec(duckdb_v2_factory_handle factory, int64_t in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a TIMESTAMP_MS value. * @@ -14135,7 +15475,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_timestamp_sec(duckdb_v2_fact * here; value_cast is the validating path. The returned value is caller-owned; destroy it via value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The payload to wrap. @@ -14146,7 +15486,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_timestamp_sec(duckdb_v2_fact DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_timestamp_ms(duckdb_v2_factory_handle factory, int64_t in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a TIMESTAMP_NS value. * @@ -14154,7 +15496,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_timestamp_ms(duckdb_v2_facto * here; value_cast is the validating path. The returned value is caller-owned; destroy it via value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The payload to wrap. @@ -14165,7 +15507,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_timestamp_ms(duckdb_v2_facto DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_timestamp_ns(duckdb_v2_factory_handle factory, int64_t in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a TIMESTAMP_TZ value. * @@ -14174,7 +15518,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_timestamp_ns(duckdb_v2_facto * value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The payload to wrap. @@ -14185,7 +15529,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_timestamp_ns(duckdb_v2_facto DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_timestamp_tz(duckdb_v2_factory_handle factory, int64_t in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a TIMESTAMP_TZ_NS value. * @@ -14194,7 +15540,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_timestamp_tz(duckdb_v2_facto * value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The payload to wrap. @@ -14205,7 +15551,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_timestamp_tz(duckdb_v2_facto DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_timestamp_tz_ns(duckdb_v2_factory_handle factory, int64_t in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a INTERVAL value. * @@ -14213,7 +15561,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_timestamp_tz_ns(duckdb_v2_fa * here; value_cast is the validating path. The returned value is caller-owned; destroy it via value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The payload to wrap. @@ -14225,7 +15573,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_interval(duckdb_v2_factory_h const duckdb_v2_interval_t *in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a DECIMAL value from its backing integer. * @@ -14235,7 +15585,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_interval(duckdb_v2_factory_h * width; value_cast is the validating path. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The backing integer, scaled by 10^scale. @@ -14249,7 +15599,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_decimal(duckdb_v2_factory_ha const duckdb_v2_hugeint_t *in_value, uint8_t width, uint8_t scale, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a UUID value from its internal 128-bit form. * @@ -14258,7 +15610,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_decimal(duckdb_v2_factory_ha * renders back. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The internal 128-bit storage form. @@ -14270,7 +15622,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_uuid(duckdb_v2_factory_handl const duckdb_v2_hugeint_t *in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a BIT value from its wire bytes. * @@ -14279,7 +15633,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_uuid(duckdb_v2_factory_handl * value_get_blob reports back. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The wire bytes, a padding header byte followed by data. Must be at least 1 byte. @@ -14290,7 +15644,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_uuid(duckdb_v2_factory_handl DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_bit(duckdb_v2_factory_handle factory, const duckdb_v2_str *in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a BIGNUM value from its storage bytes. * @@ -14299,7 +15655,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_bit(duckdb_v2_factory_handle * the input must exceed 3 bytes. These are the same bytes value_get_blob reports back, for bignum_decode to translate. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param in_value The opaque storage bytes from bignum_encode. Must exceed 3 bytes. @@ -14311,7 +15667,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_bignum(duckdb_v2_factory_han const duckdb_v2_str *in_value, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a LIST value from its elements. * @@ -14324,7 +15682,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_bignum(duckdb_v2_factory_han * so an alias on the outer LIST type is not preserved; value_cast is the alias-preserving path. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param child_type Optional. The element type. Pass NULL to resolve it from the elements. @@ -14339,7 +15697,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_list(duckdb_v2_factory_handl const duckdb_v2_value_handle *children, idx_t child_count, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates an ARRAY value from its elements, sized by their count. * @@ -14349,7 +15709,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_list(duckdb_v2_factory_handl * The elements are borrowed and copied in, and a NULL element becomes a typed NULL. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param child_type Optional. The element type. Pass NULL to resolve it from the elements. @@ -14364,7 +15724,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_array(duckdb_v2_factory_hand const duckdb_v2_value_handle *children, idx_t child_count, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a STRUCT value from named fields, in order. * @@ -14375,7 +15737,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_array(duckdb_v2_factory_hand * rejected. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param names An array of field_count field names. Pass NULL when field_count is 0. @@ -14390,7 +15752,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_struct(duckdb_v2_factory_han const duckdb_v2_value_handle *children, idx_t field_count, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a TUPLE value from positional fields. * @@ -14400,7 +15764,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_struct(duckdb_v2_factory_han * The children are borrowed and copied in, and a NULL child becomes a typed NULL. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param children An array of field_count field values. Borrowed (copied in). Pass NULL when field_count is 0. @@ -14413,7 +15777,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_tuple(duckdb_v2_factory_hand const duckdb_v2_value_handle *children, idx_t field_count, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates a MAP value from parallel key and value arrays. * @@ -14425,7 +15791,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_tuple(duckdb_v2_factory_hand * unique; both are enforced. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory to create with. * @param key_type Optional. The key type. Pass NULL to resolve it from the keys. @@ -14442,7 +15808,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_map( duckdb_v2_factory_handle factory, duckdb_v2_logical_type_handle key_type, duckdb_v2_logical_type_handle value_type, const duckdb_v2_value_handle *keys, const duckdb_v2_value_handle *values, idx_t entry_count, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the number of child values of a value. * @@ -14451,7 +15819,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_map( * NULL values of any nested type included. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out_count Receives the number of children. @@ -14460,7 +15828,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_create_map( */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_child_count(duckdb_v2_value_handle value, idx_t *out_count, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns one child of a composite value as an owned copy. * @@ -14476,7 +15846,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_child_count(duckdb_v2_value_han * value is caller-owned; destroy it via value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param index The child index, in [0, child_count). @@ -14487,7 +15857,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_child_count(duckdb_v2_value_han DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_child(duckdb_v2_value_handle value, idx_t index, duckdb_v2_value_handle *out_child, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Casts a value to a target type, using a factory. * @@ -14502,7 +15874,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_child(duckdb_v2_value_handle va * The input value and target type are borrowed. The returned value is caller-owned; destroy it via value_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param factory The factory supplying the cast functions. * @param value The borrowed value to cast. @@ -14514,12 +15886,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_child(duckdb_v2_value_handle va DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_cast(duckdb_v2_factory_handle factory, duckdb_v2_value_handle value, duckdb_v2_logical_type_handle target_type, duckdb_v2_value_handle *out_value, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns whether the value is NULL. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out_is_null Receives true if the value is NULL, false otherwise. @@ -14528,14 +15902,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_cast(duckdb_v2_factory_handle facto */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_is_null(duckdb_v2_value_handle value, bool *out_is_null, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the logical type of the value. * * The returned logical type is caller-owned; destroy it via logical_type_destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out_type Receives the owned logical type. @@ -14545,7 +15921,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_is_null(duckdb_v2_value_handle valu DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_logical_type(duckdb_v2_value_handle value, duckdb_v2_logical_type_handle *out_type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Renders the value as a human-readable string. Diagnostic only. * @@ -14559,7 +15937,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_logical_type(duckdb_v2_value_ha * string. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param value The value to read. * @param out_string Caller-owned buffer receiving the text plus a null terminator, or NULL to only report the required @@ -14573,6 +15951,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_get_logical_type(duckdb_v2_value_ha DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_value_to_string(duckdb_v2_value_handle value, char *out_string, idx_t out_capacity, idx_t *out_length, duckdb_v2_error_info_handle *err); +#endif /* --- Struct definitions for value --- */ @@ -14632,6 +16011,7 @@ typedef struct _duckdb_v2_arrow_result { /* --- Functions for arrow --- */ +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Resolves an Arrow schema into a reusable importer. * @@ -14649,7 +16029,7 @@ typedef struct _duckdb_v2_arrow_result { * set to NULL on failure. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param context The context used to resolve the Arrow types, extension types included. * @param schema The schema to resolve. Read, not consumed; the caller keeps ownership. @@ -14664,7 +16044,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_importer_create(duckdb_v2_context_h struct ArrowSchema *schema, idx_t batch_size, duckdb_v2_arrow_importer_handle *out_importer, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the resolved DuckDB schema. * @@ -14676,7 +16058,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_importer_create(duckdb_v2_context_h * on failure. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param importer The importer to read. * @param out_schema On success, receives an owned schema. Destroy via `duckdb_v2_schema_destroy()`. @@ -14687,7 +16069,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_importer_create(duckdb_v2_context_h DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_importer_get_schema(duckdb_v2_arrow_importer_handle importer, duckdb_v2_schema_handle *out_schema, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Gives the importer one array to convert. * @@ -14716,7 +16100,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_importer_get_schema(duckdb_v2_arrow * `ERROR_QUERY_NOT_IMPLEMENTED` when the column is converted. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param importer The importer to feed. * @param array The array to convert. Its `release` is set to NULL when `consume` is true. @@ -14731,7 +16115,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_importer_get_schema(duckdb_v2_arrow DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_importer_append(duckdb_v2_arrow_importer_handle importer, struct ArrowArray *array, bool consume, bool flush, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Produces the next chunk of the appended array, or NULL once the array is drained. * @@ -14744,7 +16130,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_importer_append(duckdb_v2_arrow_imp * to NULL on failure. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param importer The importer to drain. * @param out_chunk On success, receives the next chunk, or NULL once the array is drained. Destroy via @@ -14756,7 +16142,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_importer_append(duckdb_v2_arrow_imp DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_importer_next_chunk(duckdb_v2_arrow_importer_handle importer, duckdb_v2_data_chunk_handle *out_chunk, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys an importer. * @@ -14765,13 +16153,15 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_importer_next_chunk(duckdb_v2_arrow * drained is released here. Rows held back for a next array are dropped. On success the slot is set to NULL. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param importer The importer to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_importer_destroy(duckdb_v2_arrow_importer_handle *importer); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Creates an exporter for one fixed list of columns. * @@ -14787,7 +16177,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_importer_destroy(duckdb_v2_arrow_im * failure. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param context The context whose Arrow settings are captured and whose transaction resolves the types. * @param types An array of `count` column types. May be NULL only when `count` is 0. @@ -14806,7 +16196,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_exporter_create(duckdb_v2_context_h const duckdb_v2_str *names, idx_t count, idx_t batch_size, duckdb_v2_arrow_exporter_handle *out_exporter, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the Arrow schema of the arrays this exporter produces. * @@ -14815,7 +16207,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_exporter_create(duckdb_v2_context_h * the settings captured at creation. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param exporter The exporter to read. * @param out_schema Caller-allocated schema the library fills. Release it with `out_schema->release(out_schema)`. @@ -14826,7 +16218,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_exporter_create(duckdb_v2_context_h DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_exporter_get_schema(duckdb_v2_arrow_exporter_handle exporter, struct ArrowSchema *out_schema, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Gives the exporter one chunk to convert. * @@ -14847,7 +16241,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_exporter_get_schema(duckdb_v2_arrow * a table function's exec callback, which the caller does not own and must not destroy. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param exporter The exporter to feed. * @param chunk The chunk to convert. Destroyed and set to NULL only when `consume` is true. @@ -14861,7 +16255,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_exporter_get_schema(duckdb_v2_arrow DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_exporter_append(duckdb_v2_arrow_exporter_handle exporter, duckdb_v2_data_chunk_handle *chunk, bool consume, bool flush, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Takes the next completed array, or reports that none is ready. * @@ -14873,7 +16269,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_exporter_append(duckdb_v2_arrow_exp * and of every other array. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param exporter The exporter to drain. * @param out_array Caller-allocated array the library fills. Left released -- `release` NULL -- when none is ready. @@ -14885,7 +16281,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_exporter_append(duckdb_v2_arrow_exp DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_exporter_next_array(duckdb_v2_arrow_exporter_handle exporter, struct ArrowArray *out_array, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys an exporter. * @@ -14894,20 +16292,22 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_exporter_next_array(duckdb_v2_arrow * set to NULL. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param exporter The exporter to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_exporter_destroy(duckdb_v2_arrow_exporter_handle *exporter); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Executes a parsed statement. The result produces Arrow arrays. * * Works like `duckdb_v2_statement_execute()`. `*out_result` is set to NULL on failure. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param conn The connection to run the statement on. * @param statement The statement to execute. Not consumed. @@ -14927,14 +16327,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_statement_execute_arrow(duckdb_v2_connect idx_t parameter_count, idx_t batch_size, duckdb_v2_arrow_result_handle *out_result, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Executes a prepared statement. The result produces Arrow arrays. * * Works like `duckdb_v2_prepared_statement_execute()`. `*out_result` is set to NULL on failure. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param prepared The prepared statement to execute. Not consumed. * @param parameter_names Optional. As in `duckdb_v2_prepared_statement_execute()`. @@ -14952,18 +16354,22 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_prepared_statement_execute_arrow(duckdb_v idx_t parameter_count, idx_t batch_size, duckdb_v2_arrow_result_handle *out_result, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Destroys the result. Works like `duckdb_v2_result_destroy()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param result The result to destroy. * @return DUCKDB_V2_ERROR */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_result_destroy(duckdb_v2_arrow_result_handle *result); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Runs a bounded amount of the query and returns without blocking. * @@ -14971,7 +16377,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_result_destroy(duckdb_v2_arrow_resu * NULL. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param result The result to step. * @param out_array Caller-allocated array the library fills. Release it with `out_array->release(out_array)`. @@ -14984,14 +16390,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_result_step(duckdb_v2_arrow_result_ struct ArrowArray *out_array, DUCKDB_V2_RESULT_STEP_STATUS *out_status, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Blocks until the next array is ready. * * Works like `duckdb_v2_result_fetch_chunk()`. At the end of the result, `out_array->release` is NULL. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param result The result to fetch from. * @param out_array Caller-allocated array the library fills. Release it with `out_array->release(out_array)`. @@ -15002,12 +16410,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_result_step(duckdb_v2_arrow_result_ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_result_fetch_array(duckdb_v2_arrow_result_handle result, struct ArrowArray *out_array, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Blocks until `duckdb_v2_arrow_result_step()` can make progress. Works like `duckdb_v2_result_wait()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param result The result to wait on. * @param err Optional. On failure, receives an opaque info handle the caller must destroy via @@ -15016,12 +16426,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_result_fetch_array(duckdb_v2_arrow_ */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_result_wait(duckdb_v2_arrow_result_handle result, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Runs the query to the end and reports the changed-row count. Works like `duckdb_v2_result_drain()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param result The result to drain. * @param out_rows_changed Receives the changed-row count for an INSERT, UPDATE or DELETE, 0 otherwise. @@ -15031,12 +16443,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_result_wait(duckdb_v2_arrow_result_ */ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_result_drain(duckdb_v2_arrow_result_handle result, idx_t *out_rows_changed, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the shape of the result. Works like `duckdb_v2_result_get_result_type()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param result The result. * @param out_type Receives the result shape. @@ -15047,12 +16461,14 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_result_drain(duckdb_v2_arrow_result DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_result_get_result_type(duckdb_v2_arrow_result_handle result, DUCKDB_V2_RESULT_TYPE *out_type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the type of statement that produced the result. Works like `duckdb_v2_result_get_statement_type()`. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param result The result. * @param out_type Receives the statement type. @@ -15063,14 +16479,16 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_result_get_result_type(duckdb_v2_ar DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_result_get_statement_type(duckdb_v2_arrow_result_handle result, DUCKDB_V2_STATEMENT_TYPE *out_type, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Returns the Arrow schema of the result's arrays. * * Available whenever `duckdb_v2_result_get_schema()` would be. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param result The result. * @param out_schema Caller-allocated schema the library fills. Release it with `out_schema->release(out_schema)`. @@ -15081,7 +16499,9 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_result_get_statement_type(duckdb_v2 DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_result_get_schema(duckdb_v2_arrow_result_handle result, struct ArrowSchema *out_schema, duckdb_v2_error_info_handle *err); +#endif +#if DUCKDB_V2_API_ALLOW_UNSTABLE /*! * Turns the result into an ArrowArrayStream. * @@ -15093,7 +16513,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_result_get_schema(duckdb_v2_arrow_r * `get_schema` returns `EIO`; `get_last_error` has the message. * * history: - * - stable: v2.0.0 + * - unstable: v2.0.0 * * @param result The result to take over. Set to NULL on success. * @param out_stream Caller-allocated stream the library fills. Release it with `out_stream->release(out_stream)`. @@ -15104,6 +16524,7 @@ DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_result_get_schema(duckdb_v2_arrow_r DUCKDB_C_API DUCKDB_V2_ERROR duckdb_v2_arrow_result_to_arrow_c_stream(duckdb_v2_arrow_result_handle *result, struct ArrowArrayStream *out_stream, duckdb_v2_error_info_handle *err); +#endif /* --- Struct definitions for arrow --- */ diff --git a/src/duckdb/src/main/capi/v2/capi_v2_query_metrics.cpp b/src/duckdb/src/main/capi/v2/capi_v2_query_metrics.cpp new file mode 100644 index 000000000..f4a89a89a --- /dev/null +++ b/src/duckdb/src/main/capi/v2/capi_v2_query_metrics.cpp @@ -0,0 +1,220 @@ +#include "duckdb/main/capi_v2/capi_v2_internal.hpp" + +#include "duckdb/common/enum_util.hpp" +#include "duckdb/main/profiler/gathered_metrics.hpp" +#include "duckdb/main/profiler/profiling_node.hpp" +#include "duckdb/main/query_profiler.hpp" + +namespace duckdb::capiv2 { + +//! One node of a snapshot: the query as a whole, or one of its operators +struct CV2QueryMetricsNode { + string name; + //! Sorted by name + vector> metrics; + vector> children; +}; + +//! An owned snapshot of the metrics of a query, independent of the profiler it was taken from +struct CV2QueryMetrics { + CV2QueryMetricsNode root; +}; + +static auto Convert(duckdb_v2_query_metrics_handle metrics) -> CV2QueryMetrics * { + return reinterpret_cast(metrics); +} +static auto Convert(CV2QueryMetrics *metrics) -> duckdb_v2_query_metrics_handle { + return reinterpret_cast(metrics); +} +static auto Convert(duckdb_v2_query_metrics_node_handle node) -> CV2QueryMetricsNode * { + return reinterpret_cast(node); +} +static auto Convert(CV2QueryMetricsNode *node) -> duckdb_v2_query_metrics_node_handle { + return reinterpret_cast(node); +} + +//! Adds the numeric metrics, sorted by name: the others, e.g. the SQL text, are not measurements +static void AddQueryMetrics(CV2QueryMetricsNode &node, const profiler_metrics_t &metrics, const string &prefix) { + for (auto &entry : metrics) { + if (!entry.second.IsNull() && entry.second.type().IsNumeric()) { + node.metrics.emplace_back(prefix + entry.first, entry.second); + } + } + std::sort(node.metrics.begin(), node.metrics.end(), + [](const pair &a, const pair &b) { return a.first < b.first; }); +} + +static unique_ptr SnapshotQueryMetricsOperator(const GatheredMetrics &gathered, + const ProfilingNode &node) { + auto result = make_uniq(); + auto &info = node.GetOperatorMetrics(); + result->name = EnumUtil::ToString(info.operator_type); + // operator metrics are keyed without their group + AddQueryMetrics(*result, info.GetMetrics(gathered), "operator."); + for (auto &child : node.children) { + result->children.push_back(SnapshotQueryMetricsOperator(gathered, *child)); + } + return result; +} + +static CV2QueryMetricsNode &GetCheckedQueryMetricsChild(CV2QueryMetricsNode &node, idx_t index, const char *func) { + if (index >= node.children.size()) { + throw Exception(ExceptionType::OUT_OF_RANGE, + StringUtil::Format("Child index %llu is out of range for a node with %llu children in %s.", + static_cast(index), static_cast(node.children.size()), + func)); + } + return *node.children[index]; +} + +static pair &GetCheckedQueryMetric(CV2QueryMetricsNode &node, idx_t index, const char *func) { + if (index >= node.metrics.size()) { + throw Exception(ExceptionType::OUT_OF_RANGE, + StringUtil::Format("Metric index %llu is out of range for a node with %llu metrics in %s.", + static_cast(index), static_cast(node.metrics.size()), + func)); + } + return node.metrics[index]; +} + +} // namespace duckdb::capiv2 + +//---------------------------------------------------------------------------------------------------------------------- +// Public Functions +//---------------------------------------------------------------------------------------------------------------------- + +using namespace duckdb::capiv2; + +DUCKDB_V2_ERROR duckdb_v2_connection_get_query_metrics(duckdb_v2_connection_handle conn, + duckdb_v2_query_metrics_handle *metrics, + duckdb_v2_error_info_handle *err) { + DUCKDB_CHECK_ARG(conn); + DUCKDB_CHECK_ARG(metrics); + *metrics = nullptr; + return WithErrorHandler(err, [&]() { + auto &context = *Convert(conn)->context; + context.VerifyNoOpenResult(); + auto snapshot = duckdb::make_uniq(); + snapshot->root.name = "QUERY"; + duckdb::QueryProfiler::Get(context).GetFinalizedProfileUnderLock( + [&](duckdb::optional_ptr gathered, + duckdb::optional_ptr root) { + if (!gathered) { + return; + } + AddQueryMetrics(snapshot->root, gathered->GetMetrics(), ""); + if (root) { + snapshot->root.children.push_back(SnapshotQueryMetricsOperator(*gathered, *root)); + } + }); + *metrics = Convert(snapshot.release()); + }); +} + +DUCKDB_V2_ERROR duckdb_v2_connection_enable_profiling(duckdb_v2_connection_handle conn, bool enabled, + duckdb_v2_error_info_handle *err) { + DUCKDB_CHECK_ARG(conn); + return WithErrorHandler(err, [&]() { + auto &connection = *Convert(conn); + if (enabled) { + connection.EnableProfiling(); + } else { + connection.DisableProfiling(); + } + }); +} + +DUCKDB_V2_ERROR duckdb_v2_query_metrics_get_root(duckdb_v2_query_metrics_handle metrics, + duckdb_v2_query_metrics_node_handle *node, + duckdb_v2_error_info_handle *err) { + DUCKDB_CHECK_ARG(metrics); + DUCKDB_CHECK_ARG(node); + *node = nullptr; + return WithErrorHandler(err, [&]() { *node = Convert(&Convert(metrics)->root); }); +} + +DUCKDB_V2_ERROR duckdb_v2_query_metrics_node_get_name(duckdb_v2_query_metrics_node_handle node, duckdb_v2_str *name, + duckdb_v2_error_info_handle *err) { + DUCKDB_CHECK_ARG(node); + DUCKDB_CHECK_ARG(name); + *name = duckdb_v2_str {nullptr, 0}; + return WithErrorHandler(err, [&]() { *name = Convert(Convert(node)->name); }); +} + +DUCKDB_V2_ERROR duckdb_v2_query_metrics_node_get_child_count(duckdb_v2_query_metrics_node_handle node, idx_t *count, + duckdb_v2_error_info_handle *err) { + DUCKDB_CHECK_ARG(node); + DUCKDB_CHECK_ARG(count); + return WithErrorHandler(err, [&]() { *count = Convert(node)->children.size(); }); +} + +DUCKDB_V2_ERROR duckdb_v2_query_metrics_node_get_child(duckdb_v2_query_metrics_node_handle node, idx_t index, + duckdb_v2_query_metrics_node_handle *child, + duckdb_v2_error_info_handle *err) { + DUCKDB_CHECK_ARG(node); + DUCKDB_CHECK_ARG(child); + *child = nullptr; + return WithErrorHandler(err, + [&]() { *child = Convert(&GetCheckedQueryMetricsChild(*Convert(node), index, __func__)); }); +} + +DUCKDB_V2_ERROR duckdb_v2_query_metrics_node_get_metric_count(duckdb_v2_query_metrics_node_handle node, idx_t *count, + duckdb_v2_error_info_handle *err) { + DUCKDB_CHECK_ARG(node); + DUCKDB_CHECK_ARG(count); + return WithErrorHandler(err, [&]() { *count = Convert(node)->metrics.size(); }); +} + +DUCKDB_V2_ERROR duckdb_v2_query_metrics_node_get_metric_name(duckdb_v2_query_metrics_node_handle node, idx_t index, + duckdb_v2_str *name, duckdb_v2_error_info_handle *err) { + DUCKDB_CHECK_ARG(node); + DUCKDB_CHECK_ARG(name); + *name = duckdb_v2_str {nullptr, 0}; + return WithErrorHandler(err, + [&]() { *name = Convert(GetCheckedQueryMetric(*Convert(node), index, __func__).first); }); +} + +DUCKDB_V2_ERROR duckdb_v2_query_metrics_node_get_metric_value(duckdb_v2_query_metrics_node_handle node, idx_t index, + duckdb_v2_value_handle *value, + duckdb_v2_error_info_handle *err) { + DUCKDB_CHECK_ARG(node); + DUCKDB_CHECK_ARG(value); + *value = nullptr; + return WithErrorHandler(err, [&]() { + auto &metric = GetCheckedQueryMetric(*Convert(node), index, __func__); + *value = Convert(new duckdb::Value(metric.second)); + }); +} + +DUCKDB_V2_ERROR duckdb_v2_query_metrics_node_get_metric(duckdb_v2_query_metrics_node_handle node, + const duckdb_v2_str *name, duckdb_v2_value_handle *value, + bool *present, duckdb_v2_error_info_handle *err) { + DUCKDB_CHECK_ARG(node); + DUCKDB_CHECK_ARG(name); + DUCKDB_CHECK_ARG(value); + DUCKDB_CHECK_ARG(present); + *value = nullptr; + *present = false; + return WithErrorHandler(err, [&]() { + std::string_view key(name->ptr, name->len); + for (auto &metric : Convert(node)->metrics) { + if (metric.first == key) { + *value = Convert(new duckdb::Value(metric.second)); + *present = true; + return; + } + } + }); +} + +DUCKDB_V2_ERROR duckdb_v2_query_metrics_destroy(duckdb_v2_query_metrics_handle *metrics) { + return WithErrorHandler(nullptr, [&]() { + if (!metrics) { + return; + } + if (*metrics) { + delete Convert(*metrics); + *metrics = nullptr; + } + }); +} diff --git a/src/duckdb/src/main/extension.cpp b/src/duckdb/src/main/extension.cpp index ece345775..0594ab388 100644 --- a/src/duckdb/src/main/extension.cpp +++ b/src/duckdb/src/main/extension.cpp @@ -74,6 +74,13 @@ string ParsedExtensionMetaData::GetInvalidMetadataError() { "The file was built for DuckDB C API version '%s', but we can only load extensions " "built for DuckDB C API 'v%lld.x.y' or 'v%lld.x.y'.", duckdb_capi_version, DUCKDB_EXTENSION_API_VERSION_MAJOR, DUCKDB_EXTENSION_API_V2_VERSION_MAJOR); + } else if (major == DUCKDB_EXTENSION_API_V2_VERSION_MAJOR) { + // no V2 function is stable yet, so a V2 extension loads only when pinned to this DuckDB version + result += + StringUtil::Format("The file was built for DuckDB C API version '%s', but the V2 C API has no stable " + "surface yet: only V2 extensions built specifically for this version of DuckDB can " + "be loaded.", + duckdb_capi_version); } else if (!VersioningUtils::IsSupportedCAPIVersion(major, minor, patch)) { const auto max_minor = major == DUCKDB_EXTENSION_API_VERSION_MAJOR ? DUCKDB_EXTENSION_API_VERSION_MINOR : DUCKDB_EXTENSION_API_V2_VERSION_MINOR; diff --git a/src/duckdb/src/main/http/http_util.cpp b/src/duckdb/src/main/http/http_util.cpp index 435977999..eba3aa92f 100644 --- a/src/duckdb/src/main/http/http_util.cpp +++ b/src/duckdb/src/main/http/http_util.cpp @@ -190,9 +190,10 @@ unique_ptr HTTPUtil::Request(BaseRequest &request, unique_ptrconfig; - if (!config.CanAccessFile(request.url, FileType::FILE_TYPE_REGULAR)) { + auto &access_path = request.params.access_path.empty() ? request.url : request.params.access_path; + if (!config.CanAccessFile(access_path, FileType::FILE_TYPE_REGULAR)) { throw PermissionException("Cannot access \"%s\" - file system operations are disabled by configuration", - request.url); + access_path); } } auto response = SendRequest(request, client); diff --git a/src/duckdb/src/main/query_profiler.cpp b/src/duckdb/src/main/query_profiler.cpp index 7d9010747..bf6c29642 100644 --- a/src/duckdb/src/main/query_profiler.cpp +++ b/src/duckdb/src/main/query_profiler.cpp @@ -1008,6 +1008,17 @@ QueryProfileResult &QueryProfiler::GetResult() { return *result_tree; } +void QueryProfiler::GetFinalizedProfileUnderLock( + const std::function, optional_ptr)> &callback) const { + lock_guard guard(lock); + // a profile left over from before profiling was disabled is stale, and a running one is not finalized yet + if (!IsEnabled() || running || !metrics_finalized) { + callback(nullptr, nullptr); + return; + } + callback(metrics.get(), root.get()); +} + bool QueryProfiler::HasRoot() const { return root != nullptr; } diff --git a/src/duckdb/src/optimizer/rule/list_comprehension_rewrite.cpp b/src/duckdb/src/optimizer/rule/list_comprehension_rewrite.cpp index 0367106cc..ee4356164 100644 --- a/src/duckdb/src/optimizer/rule/list_comprehension_rewrite.cpp +++ b/src/duckdb/src/optimizer/rule/list_comprehension_rewrite.cpp @@ -43,14 +43,6 @@ bool IsStructPack(const BoundFunctionExpression &expr) { return expr.Function().GetName() == "struct_pack"; } -optional_ptr UnwrapCasts(optional_ptr expr) { - while (BoundCastExpression::IsCast(*expr)) { - auto &cast_expr = expr->Cast(); - expr = BoundCastExpression::ChildMutable(cast_expr).get(); - } - return expr; -} - optional_ptr FindStructPackChildByName(BoundFunctionExpression &struct_pack, const string &name) { D_ASSERT(struct_pack.GetReturnType().id() == LogicalTypeId::STRUCT); for (auto &child : struct_pack.GetChildren()) { @@ -95,8 +87,16 @@ void RemoveIndexInputSlot(unique_ptr &expr) { }); } -bool MatchesStructFieldProjection(Expression &expr, const string &field_name) { - auto base = UnwrapCasts(expr); +bool MatchesStructFieldProjection(Expression &expr, const string &field_name, bool allow_boolean_cast = false) { + optional_ptr base = expr; + if (allow_boolean_cast && BoundCastExpression::IsCast(*base) && base->GetReturnType() == LogicalType::BOOLEAN) { + auto &cast_expr = base->Cast(); + if (BoundCastExpression::IsTryCast(cast_expr)) { + return false; + } + // The rewritten filter recreates this single BOOLEAN cast. + base = BoundCastExpression::ChildMutable(cast_expr).get(); + } if (base->GetExpressionClass() != ExpressionClass::BOUND_FUNCTION) { return false; } @@ -105,7 +105,7 @@ bool MatchesStructFieldProjection(Expression &expr, const string &field_name) { return false; } - auto struct_arg = UnwrapCasts(*extract_expr.GetChildren()[0]); + auto &struct_arg = extract_expr.GetChildren()[0]; if (struct_arg->GetExpressionClass() != ExpressionClass::BOUND_REF) { return false; } @@ -114,7 +114,7 @@ bool MatchesStructFieldProjection(Expression &expr, const string &field_name) { return false; } - auto field_arg = UnwrapCasts(*extract_expr.GetChildren()[1]); + auto &field_arg = extract_expr.GetChildren()[1]; if (field_arg->GetExpressionClass() != ExpressionClass::BOUND_CONSTANT) { return false; } @@ -198,7 +198,7 @@ unique_ptr MatchListComprehensionRewrite(ClientContext & if (!list_filter_bind.lambda_expr || !root_bind.lambda_expr) { return nullptr; } - if (!MatchesStructFieldProjection(*list_filter_bind.lambda_expr, "filter") || + if (!MatchesStructFieldProjection(*list_filter_bind.lambda_expr, "filter", true) || !MatchesStructFieldProjection(*root_bind.lambda_expr, "result")) { return nullptr; } @@ -216,7 +216,7 @@ unique_ptr MatchListComprehensionRewrite(ClientContext & if (!inner_bind.lambda_expr) { return nullptr; } - auto inner_base = UnwrapCasts(*inner_bind.lambda_expr); + auto &inner_base = inner_bind.lambda_expr; if (inner_base->GetExpressionClass() != ExpressionClass::BOUND_FUNCTION) { return nullptr; } diff --git a/src/duckdb/src/parser/expression/operator_expression.cpp b/src/duckdb/src/parser/expression/operator_expression.cpp index 8b8e36f12..160bf37e7 100644 --- a/src/duckdb/src/parser/expression/operator_expression.cpp +++ b/src/duckdb/src/parser/expression/operator_expression.cpp @@ -1,7 +1,10 @@ #include "duckdb/parser/expression/operator_expression.hpp" #include "duckdb/parser/expression/function_expression.hpp" +#include "duckdb/parser/expression/constant_expression.hpp" #include "duckdb/common/exception.hpp" +#include "duckdb/common/serializer/serializer.hpp" +#include "duckdb/common/serializer/deserializer.hpp" namespace duckdb { @@ -31,4 +34,64 @@ unique_ptr OperatorExpression::EmptySliceBound() { return make_uniq("list_value", vector>()); } +namespace { + +//! Storage before v2.0 encodes an omitted slice bound as the constant INTEGER[] [] +Value LegacyEmptySliceBoundValue() { + return Value::LIST(LogicalType::INTEGER, vector()); +} + +//! Serializes as the pre-v2.0 ConstantExpression holding the legacy empty slice bound +struct LegacyEmptySliceBound { + void Serialize(Serializer &serializer) const { + serializer.WriteProperty(100, "class", ExpressionClass::CONSTANT); + serializer.WriteProperty(101, "type", ExpressionType::VALUE_CONSTANT); + serializer.WriteProperty(200, "value", LegacyEmptySliceBoundValue()); + } +}; + +bool IsSliceBound(const OperatorExpression &expr, idx_t child_idx) { + return expr.GetExpressionType() == ExpressionType::ARRAY_SLICE && (child_idx == 1 || child_idx == 2); +} + +bool IsEmptySliceBoundExpression(const ParsedExpression &expr) { + if (expr.GetExpressionClass() != ExpressionClass::FUNCTION) { + return false; + } + auto &function = expr.Cast(); + return function.FunctionName() == "list_value" && function.GetArguments().empty(); +} + +} // namespace + +void OperatorExpression::Serialize(Serializer &serializer) const { + ParsedExpression::Serialize(serializer); + if (serializer.ShouldSerialize(StorageVersion::V2_0_0) || GetExpressionType() != ExpressionType::ARRAY_SLICE) { + serializer.WritePropertyWithDefault>>(200, "children", children); + return; + } + LegacyEmptySliceBound legacy_bound; + serializer.WriteList(200, "children", children.size(), [&](Serializer::List &list, idx_t i) { + if (IsSliceBound(*this, i) && IsEmptySliceBoundExpression(*children[i])) { + list.WriteElement(optional_ptr(legacy_bound)); + } else { + list.WriteElement(children[i]); + } + }); +} + +unique_ptr OperatorExpression::Deserialize(Deserializer &deserializer) { + auto result = duckdb::unique_ptr(new OperatorExpression(deserializer.Get())); + deserializer.ReadPropertyWithDefault>>(200, "children", result->children); + if (result->GetExpressionType() == ExpressionType::ARRAY_SLICE) { + auto legacy_bound = ConstantExpression::FromValue(LegacyEmptySliceBoundValue()); + for (idx_t i = 0; i < result->children.size(); i++) { + if (IsSliceBound(*result, i) && result->children[i]->Equals(*legacy_bound)) { + result->children[i] = EmptySliceBound(); + } + } + } + return std::move(result); +} + } // namespace duckdb diff --git a/src/duckdb/src/planner/binder/expression/bind_window_expression.cpp b/src/duckdb/src/planner/binder/expression/bind_window_expression.cpp index d44038f98..daf7cb524 100644 --- a/src/duckdb/src/planner/binder/expression/bind_window_expression.cpp +++ b/src/duckdb/src/planner/binder/expression/bind_window_expression.cpp @@ -141,11 +141,18 @@ BindResult BaseSelectBinder::BindWindowExpression(WindowExpression &window, idx_ } vector> bound_partitions; for (auto &child : window.PartitionsMutable()) { - bound_partitions.push_back(BindChild(child, depth, error)); + auto bound_partition = BindChild(child, depth, error); + if (!error.HasError() && bound_partition->IsVolatile()) { + throw BinderException(error_context, "PARTITION BY window expressions cannot be volatile"); + } + bound_partitions.push_back(std::move(bound_partition)); } vector> bound_orders; for (auto &order : window.OrderByMutable()) { auto bound_order = BindChild(order.expression, depth, error); + if (!error.HasError() && bound_order->IsVolatile()) { + throw BinderException(error_context, "ORDER BY window expressions cannot be volatile"); + } // If the frame is a RANGE frame and the type is a time, // then we have to convert the time to a timestamp to avoid wrapping. diff --git a/src/duckdb/src/planner/expression/bound_cast_expression.cpp b/src/duckdb/src/planner/expression/bound_cast_expression.cpp index 26d925cb2..9519cdb49 100644 --- a/src/duckdb/src/planner/expression/bound_cast_expression.cpp +++ b/src/duckdb/src/planner/expression/bound_cast_expression.cpp @@ -352,6 +352,10 @@ bool BoundCastExpression::CastCanThrow(const LogicalType &source_type, const Log if (target_type.id() == LogicalTypeId::VARCHAR) { return false; } + // A geometry -> geometry cast only changes CRS metadata (incompatible CRSs are rejected at bind time) + if (source_type.id() == LogicalTypeId::GEOMETRY && target_type.id() == LogicalTypeId::GEOMETRY) { + return false; + } // Casting from a string requires parsing it, which throws whenever the string is not a valid representation of // the target type. Types that sit above VARCHAR in the coercion lattice (e.g. UUID, BLOB, BIT, nested types) // would otherwise be considered safe by the max-type check below. diff --git a/src/duckdb/src/storage/serialization/serialize_parsed_expression.cpp b/src/duckdb/src/storage/serialization/serialize_parsed_expression.cpp index 6612e100d..abf954d08 100644 --- a/src/duckdb/src/storage/serialization/serialize_parsed_expression.cpp +++ b/src/duckdb/src/storage/serialization/serialize_parsed_expression.cpp @@ -228,17 +228,6 @@ unique_ptr LambdaRefExpression::Deserialize(Deserializer &dese return std::move(result); } -void OperatorExpression::Serialize(Serializer &serializer) const { - ParsedExpression::Serialize(serializer); - serializer.WritePropertyWithDefault>>(200, "children", children); -} - -unique_ptr OperatorExpression::Deserialize(Deserializer &deserializer) { - auto result = duckdb::unique_ptr(new OperatorExpression(deserializer.Get())); - deserializer.ReadPropertyWithDefault>>(200, "children", result->children); - return std::move(result); -} - void ParameterExpression::Serialize(Serializer &serializer) const { ParsedExpression::Serialize(serializer); serializer.WritePropertyWithDefault(200, "identifier", identifier); diff --git a/src/duckdb/ub_src_main_capi_v2.cpp b/src/duckdb/ub_src_main_capi_v2.cpp index b94d045db..6efe4cbbe 100644 --- a/src/duckdb/ub_src_main_capi_v2.cpp +++ b/src/duckdb/ub_src_main_capi_v2.cpp @@ -68,6 +68,8 @@ #include "src/main/capi/v2/capi_v2_qname.cpp" +#include "src/main/capi/v2/capi_v2_query_metrics.cpp" + #include "src/main/capi/v2/capi_v2_replacement_scan.cpp" #include "src/main/capi/v2/capi_v2_result.cpp" From 25d901cd62ff3f4081a72ad9909c7df0312c7d02 Mon Sep 17 00:00:00 2001 From: DuckLabs GitHub Bot Date: Mon, 19 Oct 2026 11:10:04 +0000 Subject: [PATCH 2/2] Update vendored DuckDB sources to 5bf940c1318 --- src/duckdb/extension/json/json_reader.cpp | 12 ++++++++++++ .../generated_extension_loader_package_build.cpp | 8 ++++---- .../src/function/table/version/pragma_version.cpp | 6 +++--- .../src/include/duckdb/main/extension_entries.hpp | 4 ++++ .../src/optimizer/pushdown/pushdown_left_join.cpp | 8 ++++++-- .../src/optimizer/rule/empty_needle_removal.cpp | 11 +++++++++-- 6 files changed, 38 insertions(+), 11 deletions(-) diff --git a/src/duckdb/extension/json/json_reader.cpp b/src/duckdb/extension/json/json_reader.cpp index 1ecd229b1..54b9420fd 100644 --- a/src/duckdb/extension/json/json_reader.cpp +++ b/src/duckdb/extension/json/json_reader.cpp @@ -1171,6 +1171,16 @@ void JSONReader::PrepareForReadInternal(JSONReaderScanState &scan_state) { if (!scan_state.read_buffer.IsSet()) { scan_state.read_buffer = scan_state.global_allocator.Allocate(scan_state.buffer_capacity); scan_state.buffer_ptr = char_ptr_cast(scan_state.read_buffer.get()); + } else if (scan_state.read_buffer.GetSize() < scan_state.buffer_capacity) { + // the retained auto-detect buffer only holds what was read from the file - it cannot take a full read + auto buffer = scan_state.global_allocator.Allocate(scan_state.buffer_capacity); + if (scan_state.file_read_type == JSONFileReadType::SCAN_ENTIRE_FILE) { + memcpy(buffer.get(), scan_state.buffer_ptr + scan_state.prev_buffer_offset, + scan_state.prev_buffer_remainder); + } + scan_state.read_buffer = std::move(buffer); + scan_state.buffer_ptr = char_ptr_cast(scan_state.read_buffer.get()); + return; } if (scan_state.file_read_type == JSONFileReadType::SCAN_ENTIRE_FILE) { // Copy last bit of previous buffer to the beginning if we are doing a single-threaded read @@ -1256,6 +1266,7 @@ void JSONReader::ReadNextBufferSeek(JSONReaderScanState &scan_state) { } // Now read the file lock-free! + D_ASSERT(read_offset + scan_state.read_size + YYJSON_PADDING_SIZE <= scan_state.read_buffer.GetSize()); file_handle.ReadAtPosition(scan_state.buffer_ptr + read_offset, scan_state.read_size, scan_state.read_position, scan_state.thread_local_filehandle); } @@ -1284,6 +1295,7 @@ bool JSONReader::ReadNextBufferNoSeek(JSONReaderScanState &scan_state) { } scan_state.buffer_index = GetBufferIndex(); PrepareForReadInternal(scan_state); + D_ASSERT(read_offset + request_size + YYJSON_PADDING_SIZE <= scan_state.read_buffer.GetSize()); if (!file_handle.Read(scan_state.buffer_ptr + read_offset, read_size, request_size)) { return false; // Couldn't read anything } diff --git a/src/duckdb/generated_extension_loader_package_build.cpp b/src/duckdb/generated_extension_loader_package_build.cpp index e75186b0b..1c8c17860 100644 --- a/src/duckdb/generated_extension_loader_package_build.cpp +++ b/src/duckdb/generated_extension_loader_package_build.cpp @@ -45,7 +45,7 @@ int32_t duckdb_extension_core_functions_describe(duckdb_extension_descriptor *de descriptor->version = 1; descriptor->name = "core_functions"; descriptor->extension_version = EXT_VERSION_CORE_FUNCTIONS; - descriptor->api_version = "v2.0.0-alpha48841"; + descriptor->api_version = "v2.0.0-alpha48877"; descriptor->entry_cpp = (void (*)(void))core_functions_duckdb_cpp_init; return 0; } @@ -78,7 +78,7 @@ int32_t duckdb_extension_parquet_describe(duckdb_extension_descriptor *descripto descriptor->version = 1; descriptor->name = "parquet"; descriptor->extension_version = EXT_VERSION_PARQUET; - descriptor->api_version = "v2.0.0-alpha48841"; + descriptor->api_version = "v2.0.0-alpha48877"; descriptor->entry_cpp = (void (*)(void))parquet_duckdb_cpp_init; return 0; } @@ -111,7 +111,7 @@ int32_t duckdb_extension_icu_describe(duckdb_extension_descriptor *descriptor) { descriptor->version = 1; descriptor->name = "icu"; descriptor->extension_version = EXT_VERSION_ICU; - descriptor->api_version = "v2.0.0-alpha48841"; + descriptor->api_version = "v2.0.0-alpha48877"; descriptor->entry_cpp = (void (*)(void))icu_duckdb_cpp_init; return 0; } @@ -144,7 +144,7 @@ int32_t duckdb_extension_json_describe(duckdb_extension_descriptor *descriptor) descriptor->version = 1; descriptor->name = "json"; descriptor->extension_version = EXT_VERSION_JSON; - descriptor->api_version = "v2.0.0-alpha48841"; + descriptor->api_version = "v2.0.0-alpha48877"; descriptor->entry_cpp = (void (*)(void))json_duckdb_cpp_init; return 0; } diff --git a/src/duckdb/src/function/table/version/pragma_version.cpp b/src/duckdb/src/function/table/version/pragma_version.cpp index 04d9a7899..f357d3dcb 100644 --- a/src/duckdb/src/function/table/version/pragma_version.cpp +++ b/src/duckdb/src/function/table/version/pragma_version.cpp @@ -1,5 +1,5 @@ #ifndef DUCKDB_PATCH_VERSION -#define DUCKDB_PATCH_VERSION "0-alpha48841" +#define DUCKDB_PATCH_VERSION "0-alpha48877" #endif #ifndef DUCKDB_MINOR_VERSION #define DUCKDB_MINOR_VERSION 0 @@ -8,10 +8,10 @@ #define DUCKDB_MAJOR_VERSION 2 #endif #ifndef DUCKDB_VERSION -#define DUCKDB_VERSION "v2.0.0-alpha48841" +#define DUCKDB_VERSION "v2.0.0-alpha48877" #endif #ifndef DUCKDB_SOURCE_ID -#define DUCKDB_SOURCE_ID "804b3f2070" +#define DUCKDB_SOURCE_ID "5bf940c131" #endif #include "duckdb/function/table/system_functions.hpp" #include "duckdb/main/database.hpp" diff --git a/src/duckdb/src/include/duckdb/main/extension_entries.hpp b/src/duckdb/src/include/duckdb/main/extension_entries.hpp index 91b920f7b..fa5dde523 100644 --- a/src/duckdb/src/include/duckdb/main/extension_entries.hpp +++ b/src/duckdb/src/include/duckdb/main/extension_entries.hpp @@ -1295,6 +1295,8 @@ static constexpr ExtensionEntry EXTENSION_SETTINGS[] = { {"__iceberg_unsafe_struct_null_default_interp", "iceberg"}, {"allow_asterisks_in_http_paths", "httpfs"}, {"auto_fallback_to_full_download", "httpfs"}, + {"aws_default_credentials", "aws"}, + {"aws_network_calls_via_duckdb", "aws"}, {"azure_account_name", "azure"}, {"azure_context_caching", "azure"}, {"azure_credential_chain", "azure"}, @@ -1553,6 +1555,8 @@ static constexpr ExtensionEntry EXTENSION_SECRET_PROVIDERS[] = { {"r2/credential_chain", "aws"}, {"aws/credential_chain", "aws"}, {"rds/credential_chain", "aws"}, + {"s3/none", "aws"}, + {"aws/none", "aws"}, {"azure/access_token", "azure"}, {"azure/config", "azure"}, {"azure/credential_chain", "azure"}, diff --git a/src/duckdb/src/optimizer/pushdown/pushdown_left_join.cpp b/src/duckdb/src/optimizer/pushdown/pushdown_left_join.cpp index ce292fd70..129dc95ce 100644 --- a/src/duckdb/src/optimizer/pushdown/pushdown_left_join.cpp +++ b/src/duckdb/src/optimizer/pushdown/pushdown_left_join.cpp @@ -92,8 +92,12 @@ static bool FilterRemovesNull(ClientContext &context, ExpressionRewriter &rewrit return false; } // we flattened the result into a scalar, check if it is FALSE or NULL - auto val = - ExpressionExecutor::EvaluateScalar(context, *filter->expressions[i]).DefaultCastAs(LogicalType::BOOLEAN); + Value val; + if (!ExpressionExecutor::TryEvaluateScalar(context, *filter->expressions[i], val)) { + // an error does not show that the NULL rows are filtered out: it may never be evaluated + continue; + } + val = val.DefaultCastAs(LogicalType::BOOLEAN); // if the result of the expression with all expressions replaced with NULL is "NULL" or "false" // then any extra entries generated by the LEFT OUTER JOIN will be filtered out! // hence the LEFT OUTER JOIN is equivalent to an inner join diff --git a/src/duckdb/src/optimizer/rule/empty_needle_removal.cpp b/src/duckdb/src/optimizer/rule/empty_needle_removal.cpp index 12ab18a4d..e72ad0d8f 100644 --- a/src/duckdb/src/optimizer/rule/empty_needle_removal.cpp +++ b/src/duckdb/src/optimizer/rule/empty_needle_removal.cpp @@ -19,7 +19,11 @@ static unique_ptr TryRemoveEmptyStringConcat(ClientContext &context, if (!children[child_idx]->IsFoldable()) { continue; } - auto value = ExpressionExecutor::EvaluateScalar(context, *children[child_idx]); + Value value; + if (!ExpressionExecutor::TryEvaluateScalar(context, *children[child_idx], value)) { + // leave the error to execution, which may never evaluate it + continue; + } if (value.IsNull() || value.type().id() != LogicalTypeId::VARCHAR || !StringValue::Get(value).empty()) { continue; } @@ -55,7 +59,10 @@ unique_ptr EmptyNeedleRemovalRule::Apply(LogicalOperator &op, vector } D_ASSERT(root.GetReturnType().id() == LogicalTypeId::BOOLEAN); - auto prefix_value = ExpressionExecutor::EvaluateScalar(GetContext(), prefix_expr); + Value prefix_value; + if (!ExpressionExecutor::TryEvaluateScalar(GetContext(), prefix_expr, prefix_value)) { + return nullptr; + } if (prefix_value.IsNull()) { return make_uniq(Value(LogicalType::BOOLEAN));