SPB Git

Repository Public

duckdb.h 283.6 KB 10,395 lines c

1//===----------------------------------------------------------------------===//2//3//                         DuckDB4//5//6//===----------------------------------------------------------------------===//7//8// !!!!!!!9// WARNING: this file is autogenerated, manual changes will be overwritten10// !!!!!!!1112#pragma once1314#include <stdbool.h>15#include <stdint.h>16#include <stddef.h>1718#ifdef __cplusplus19extern "C" {20#endif2122#ifndef DUCKDB_C_API23#ifdef _WIN3224#ifdef DUCKDB_STATIC_BUILD25#define DUCKDB_C_API26#elif defined(DUCKDB_BUILD_LIBRARY) && !defined(DUCKDB_BUILD_LOADABLE_EXTENSION)27#define DUCKDB_C_API __declspec(dllexport)28#else29#define DUCKDB_C_API __declspec(dllimport)30#endif31#else32#if defined(__GNUC__) || defined(__clang__)33#define DUCKDB_C_API __attribute__((visibility("default")))34#else35#define DUCKDB_C_API36#endif37#endif38#endif3940#ifndef DUCKDB_EXTENSION_API41#ifdef _WIN3242#ifdef DUCKDB_STATIC_BUILD43#define DUCKDB_EXTENSION_API44#else45#define DUCKDB_EXTENSION_API __declspec(dllexport)46#endif47#else48#if defined(__GNUC__) || defined(__clang__)49#define DUCKDB_EXTENSION_API __attribute__((visibility("default")))50#else51#define DUCKDB_EXTENSION_API52#endif53#endif54#endif5556#if defined(__GNUC__) || defined(__clang__)57#define DUCKDB_DEPRECATED                                                                                              \58	__attribute__((deprecated("This function is deprecated and will be removed in a future version.")))59#elif defined(_MSC_VER)60#define DUCKDB_DEPRECATED __declspec(deprecated("This function is deprecated and will be removed in a future version."))61#else62#define DUCKDB_DEPRECATED63#endif6465//===--------------------------------------------------------------------===//66// API version67//===--------------------------------------------------------------------===//68//! The API version this translation unit targets. Define all three to compile against an69//! older surface than the one this header describes.70#if !defined(DUCKDB_API_VERSION_MAJOR) && !defined(DUCKDB_API_VERSION_MINOR) && !defined(DUCKDB_API_VERSION_PATCH)71#define DUCKDB_API_VERSION_MAJOR 172#define DUCKDB_API_VERSION_MINOR 573#define DUCKDB_API_VERSION_PATCH 674#elif !(defined(DUCKDB_API_VERSION_MAJOR) && defined(DUCKDB_API_VERSION_MINOR) && defined(DUCKDB_API_VERSION_PATCH))75#error "define all or none of the DUCKDB_API_VERSION_MAJOR / _MINOR / _PATCH macros"76#endif7778//! True when the targeted version is x.y.z or newer.79#define DUCKDB_API_VERSION_AT_LEAST(x, y, z)                                                                           \80	(DUCKDB_API_VERSION_MAJOR > (x) ||                                                                                 \81	 (DUCKDB_API_VERSION_MAJOR == (x) &&                                                                               \82	  (DUCKDB_API_VERSION_MINOR > (y) || (DUCKDB_API_VERSION_MINOR == (y) && DUCKDB_API_VERSION_PATCH >= (z)))))8384//! True when the targeted version is older than x.y.z.85#define DUCKDB_API_VERSION_BELOW(x, y, z) (!DUCKDB_API_VERSION_AT_LEAST((x), (y), (z)))8687//===--------------------------------------------------------------------===//88// Surface switches89//===--------------------------------------------------------------------===//90//! Set to 1 to compile the deprecated surface, 0 to omit it. Defaults from the91//! older DUCKDB_API_NO_DEPRECATED macro when that is what the consumer defines.92#if !defined(DUCKDB_API_ALLOW_DEPRECATED)93#ifdef DUCKDB_API_NO_DEPRECATED94#define DUCKDB_API_ALLOW_DEPRECATED 095#else96#define DUCKDB_API_ALLOW_DEPRECATED 197#endif98#endif99100//! Set to 1 to compile the unstable surface, 0 to omit it. Defaults from the101//! older DUCKDB_EXTENSION_API_VERSION_UNSTABLE macro when that is what the consumer defines.102#if !defined(DUCKDB_API_ALLOW_UNSTABLE)103#ifdef DUCKDB_EXTENSION_API_VERSION_UNSTABLE104#define DUCKDB_API_ALLOW_UNSTABLE 1105#else106#define DUCKDB_API_ALLOW_UNSTABLE 0107#endif108#endif109110//! The unstable surface is not a promise, so it is not part of any released111//! version: its constructs may change shape or vanish. Targeting an older version112//! while opting into it would hand back today's shapes under names that version113//! never promised, so the two are mutually exclusive.114#if DUCKDB_API_ALLOW_UNSTABLE && !DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)115#error "the unstable surface requires targeting the newest API version"116#endif117118//===--------------------------------------------------------------------===//119// General type definitions120//===--------------------------------------------------------------------===//121122//! The internal representation of a VARCHAR (string_t). If the VARCHAR does not123//! exceed 12 characters, then we inline it. Otherwise, we inline a four-byte prefix for faster124//! string comparisons and store a pointer to the remaining characters. This is a non-125//! owning structure, i.e., it does not have to be freed.126typedef struct {127	union {128		struct {129			uint32_t length;130			char prefix[4];131			char *ptr;132		} pointer;133		struct {134			uint32_t length;135			char inlined[12];136		} inlined;137	} value;138} duckdb_string_t;139140//! The returned state of different functions. Legacy naming: values use DuckDB prefix without underscore.141typedef enum duckdb_state { DuckDBSuccess = 0, DuckDBError = 1 } duckdb_state;142143struct ArrowSchema;144struct ArrowArray;145146typedef uint64_t idx_t;147148/* ============================================================================149 * MODULE: common_enums150 * ============================================================================ */151152/* --- Enums for common_enums --- */153154/*!155 * An enum over DuckDB's internal types.156 *157 * history:158 * - stable: v0.1.0159 */160typedef enum DUCKDB_TYPE {161	DUCKDB_TYPE_INVALID = 0,162163	//! bool164	DUCKDB_TYPE_BOOLEAN = 1,165166	//! int8_t167	DUCKDB_TYPE_TINYINT = 2,168169	//! int16_t170	DUCKDB_TYPE_SMALLINT = 3,171172	//! int32_t173	DUCKDB_TYPE_INTEGER = 4,174175	//! int64_t176	DUCKDB_TYPE_BIGINT = 5,177178	//! uint8_t179	DUCKDB_TYPE_UTINYINT = 6,180181	//! uint16_t182	DUCKDB_TYPE_USMALLINT = 7,183184	//! uint32_t185	DUCKDB_TYPE_UINTEGER = 8,186187	//! uint64_t188	DUCKDB_TYPE_UBIGINT = 9,189190	//! float191	DUCKDB_TYPE_FLOAT = 10,192193	//! double194	DUCKDB_TYPE_DOUBLE = 11,195196	//! duckdb_timestamp (microseconds)197	DUCKDB_TYPE_TIMESTAMP = 12,198199	//! duckdb_date200	DUCKDB_TYPE_DATE = 13,201202	//! duckdb_time203	DUCKDB_TYPE_TIME = 14,204205	//! duckdb_interval206	DUCKDB_TYPE_INTERVAL = 15,207208	//! duckdb_hugeint209	DUCKDB_TYPE_HUGEINT = 16,210211	//! const char*212	DUCKDB_TYPE_VARCHAR = 17,213214	//! duckdb_blob215	DUCKDB_TYPE_BLOB = 18,216217	//! duckdb_decimal218	DUCKDB_TYPE_DECIMAL = 19,219220	//! duckdb_timestamp_s (seconds)221	DUCKDB_TYPE_TIMESTAMP_S = 20,222223	//! duckdb_timestamp_ms (milliseconds)224	DUCKDB_TYPE_TIMESTAMP_MS = 21,225226	//! duckdb_timestamp_ns (nanoseconds)227	DUCKDB_TYPE_TIMESTAMP_NS = 22,228229	//! enum type, only useful as logical type230	DUCKDB_TYPE_ENUM = 23,231232	//! list type, only useful as logical type233	DUCKDB_TYPE_LIST = 24,234235	//! struct type, only useful as logical type236	DUCKDB_TYPE_STRUCT = 25,237238	//! map type, only useful as logical type239	DUCKDB_TYPE_MAP = 26,240241	//! duckdb_hugeint242	DUCKDB_TYPE_UUID = 27,243244	//! union type, only useful as logical type245	DUCKDB_TYPE_UNION = 28,246247	//! duckdb_bit248	DUCKDB_TYPE_BIT = 29,249250	//! duckdb_time_tz251	DUCKDB_TYPE_TIME_TZ = 30,252253	//! duckdb_timestamp (microseconds)254	DUCKDB_TYPE_TIMESTAMP_TZ = 31,255256	//! duckdb_uhugeint257	DUCKDB_TYPE_UHUGEINT = 32,258259	//! duckdb_array, only useful as logical type260	DUCKDB_TYPE_ARRAY = 33,261262	//! enum type, only useful as logical type263	DUCKDB_TYPE_ANY = 34,264265	//! duckdb_bignum266	DUCKDB_TYPE_BIGNUM = 35,267268	//! enum type, only useful as logical type269	DUCKDB_TYPE_SQLNULL = 36,270271	//! enum type, only useful as logical type272	DUCKDB_TYPE_STRING_LITERAL = 37,273274	//! enum type, only useful as logical type275	DUCKDB_TYPE_INTEGER_LITERAL = 38,276277	//! duckdb_time_ns (nanoseconds)278	DUCKDB_TYPE_TIME_NS = 39,279280	//! GEOMETRY type, WKB blob281	DUCKDB_TYPE_GEOMETRY = 40,282283	//! VARIANT type284	DUCKDB_TYPE_VARIANT = 41,285286	//! duckdb_timestamp (nanoseconds)287	DUCKDB_TYPE_TIMESTAMP_TZ_NS = 42,288} DUCKDB_TYPE;289290/*!291 * An enum over the pending state of a pending query result.292 *293 * history:294 * - stable: v0.5.0295 */296typedef enum duckdb_pending_state {297	DUCKDB_PENDING_RESULT_READY = 0,298	DUCKDB_PENDING_RESULT_NOT_READY = 1,299	DUCKDB_PENDING_ERROR = 2,300	DUCKDB_PENDING_NO_TASKS_AVAILABLE = 3,301} duckdb_pending_state;302303/*!304 * An enum over DuckDB's different result types.305 *306 * history:307 * - stable: v0.10.0308 */309typedef enum duckdb_result_type {310	DUCKDB_RESULT_TYPE_INVALID = 0,311	DUCKDB_RESULT_TYPE_CHANGED_ROWS = 1,312	DUCKDB_RESULT_TYPE_NOTHING = 2,313	DUCKDB_RESULT_TYPE_QUERY_RESULT = 3,314} duckdb_result_type;315316/*!317 * An enum over DuckDB's different statement types.318 *319 * history:320 * - stable: v0.10.0321 */322typedef enum duckdb_statement_type {323	DUCKDB_STATEMENT_TYPE_INVALID = 0,324	DUCKDB_STATEMENT_TYPE_SELECT = 1,325	DUCKDB_STATEMENT_TYPE_INSERT = 2,326	DUCKDB_STATEMENT_TYPE_UPDATE = 3,327	DUCKDB_STATEMENT_TYPE_EXPLAIN = 4,328	DUCKDB_STATEMENT_TYPE_DELETE = 5,329	DUCKDB_STATEMENT_TYPE_PREPARE = 6,330	DUCKDB_STATEMENT_TYPE_CREATE = 7,331	DUCKDB_STATEMENT_TYPE_EXECUTE = 8,332	DUCKDB_STATEMENT_TYPE_ALTER = 9,333	DUCKDB_STATEMENT_TYPE_TRANSACTION = 10,334	DUCKDB_STATEMENT_TYPE_COPY = 11,335	DUCKDB_STATEMENT_TYPE_ANALYZE = 12,336	DUCKDB_STATEMENT_TYPE_VARIABLE_SET = 13,337	DUCKDB_STATEMENT_TYPE_CREATE_FUNC = 14,338	DUCKDB_STATEMENT_TYPE_DROP = 15,339	DUCKDB_STATEMENT_TYPE_EXPORT = 16,340	DUCKDB_STATEMENT_TYPE_PRAGMA = 17,341	DUCKDB_STATEMENT_TYPE_VACUUM = 18,342	DUCKDB_STATEMENT_TYPE_CALL = 19,343	DUCKDB_STATEMENT_TYPE_SET = 20,344	DUCKDB_STATEMENT_TYPE_LOAD = 21,345	DUCKDB_STATEMENT_TYPE_RELATION = 22,346	DUCKDB_STATEMENT_TYPE_EXTENSION = 23,347	DUCKDB_STATEMENT_TYPE_LOGICAL_PLAN = 24,348	DUCKDB_STATEMENT_TYPE_ATTACH = 25,349	DUCKDB_STATEMENT_TYPE_DETACH = 26,350	DUCKDB_STATEMENT_TYPE_MULTI = 27,351	DUCKDB_STATEMENT_TYPE_COPY_DATABASE = 28,352	DUCKDB_STATEMENT_TYPE_UPDATE_EXTENSIONS = 29,353	DUCKDB_STATEMENT_TYPE_MERGE_INTO = 30,354} duckdb_statement_type;355356/*!357 * An enum over DuckDB's different error types.358 *359 * history:360 * - stable: v1.1.0361 */362typedef enum duckdb_error_type {363	DUCKDB_ERROR_INVALID = 0,364	DUCKDB_ERROR_OUT_OF_RANGE = 1,365	DUCKDB_ERROR_CONVERSION = 2,366	DUCKDB_ERROR_UNKNOWN_TYPE = 3,367	DUCKDB_ERROR_DECIMAL = 4,368	DUCKDB_ERROR_MISMATCH_TYPE = 5,369	DUCKDB_ERROR_DIVIDE_BY_ZERO = 6,370	DUCKDB_ERROR_OBJECT_SIZE = 7,371	DUCKDB_ERROR_INVALID_TYPE = 8,372	DUCKDB_ERROR_SERIALIZATION = 9,373	DUCKDB_ERROR_TRANSACTION = 10,374	DUCKDB_ERROR_NOT_IMPLEMENTED = 11,375	DUCKDB_ERROR_EXPRESSION = 12,376	DUCKDB_ERROR_CATALOG = 13,377	DUCKDB_ERROR_PARSER = 14,378	DUCKDB_ERROR_PLANNER = 15,379	DUCKDB_ERROR_SCHEDULER = 16,380	DUCKDB_ERROR_EXECUTOR = 17,381	DUCKDB_ERROR_CONSTRAINT = 18,382	DUCKDB_ERROR_INDEX = 19,383	DUCKDB_ERROR_STAT = 20,384	DUCKDB_ERROR_CONNECTION = 21,385	DUCKDB_ERROR_SYNTAX = 22,386	DUCKDB_ERROR_SETTINGS = 23,387	DUCKDB_ERROR_BINDER = 24,388	DUCKDB_ERROR_NETWORK = 25,389	DUCKDB_ERROR_OPTIMIZER = 26,390	DUCKDB_ERROR_NULL_POINTER = 27,391	DUCKDB_ERROR_IO = 28,392	DUCKDB_ERROR_INTERRUPT = 29,393	DUCKDB_ERROR_FATAL = 30,394	DUCKDB_ERROR_INTERNAL = 31,395	DUCKDB_ERROR_INVALID_INPUT = 32,396	DUCKDB_ERROR_OUT_OF_MEMORY = 33,397	DUCKDB_ERROR_PERMISSION = 34,398	DUCKDB_ERROR_PARAMETER_NOT_RESOLVED = 35,399	DUCKDB_ERROR_PARAMETER_NOT_ALLOWED = 36,400	DUCKDB_ERROR_DEPENDENCY = 37,401	DUCKDB_ERROR_HTTP = 38,402	DUCKDB_ERROR_MISSING_EXTENSION = 39,403	DUCKDB_ERROR_AUTOLOAD = 40,404	DUCKDB_ERROR_SEQUENCE = 41,405	DUCKDB_ERROR_DATA_CORRUPTION = 43,406	DUCKDB_INVALID_CONFIGURATION = 42,407	DUCKDB_ERROR_RESOURCE_IN_USE = 44,408} duckdb_error_type;409410/*!411 * An enum over DuckDB's different cast modes.412 *413 * history:414 * - stable: v1.1.0415 */416typedef enum duckdb_cast_mode {417	DUCKDB_CAST_NORMAL = 0,418	DUCKDB_CAST_TRY = 1,419} duckdb_cast_mode;420421/*!422 * Flags for opening files.423 *424 * history:425 * - unstable: v1.5.0426 * - stable: v1.5.6427 */428typedef enum duckdb_file_flag {429	DUCKDB_FILE_FLAG_INVALID = 0,430431	//! Open the file with read capabilities.432	DUCKDB_FILE_FLAG_READ = 1,433434	//! Open the file with write capabilities.435	DUCKDB_FILE_FLAG_WRITE = 2,436437	//! Create a new file, or open if it already exists.438	DUCKDB_FILE_FLAG_CREATE = 3,439440	//! Create a new file, or fail if it already exists.441	DUCKDB_FILE_FLAG_CREATE_NEW = 4,442443	//! Open the file in append mode.444	DUCKDB_FILE_FLAG_APPEND = 5,445} duckdb_file_flag;446447/*!448 * An enum over DuckDB's configuration option scopes.449 *450 * history:451 * - unstable: v1.5.0452 * - stable: v1.5.6453 */454typedef enum duckdb_config_option_scope {455	DUCKDB_CONFIG_OPTION_SCOPE_INVALID = 0,456457	//! The option is set for the duration of the current transaction only. CURRENTLY NOT IMPLEMENTED.458	DUCKDB_CONFIG_OPTION_SCOPE_LOCAL = 1,459460	//! The option is set for the current session/connection only.461	DUCKDB_CONFIG_OPTION_SCOPE_SESSION = 2,462463	//! Set the option globally for all sessions/connections.464	DUCKDB_CONFIG_OPTION_SCOPE_GLOBAL = 3,465} duckdb_config_option_scope;466467/*!468 * An enum over DuckDB's catalog entry types.469 *470 * history:471 * - unstable: v1.5.0472 * - stable: v1.5.6473 */474typedef enum duckdb_catalog_entry_type {475	DUCKDB_CATALOG_ENTRY_TYPE_INVALID = 0,476	DUCKDB_CATALOG_ENTRY_TYPE_TABLE = 1,477	DUCKDB_CATALOG_ENTRY_TYPE_SCHEMA = 2,478	DUCKDB_CATALOG_ENTRY_TYPE_VIEW = 3,479	DUCKDB_CATALOG_ENTRY_TYPE_INDEX = 4,480	DUCKDB_CATALOG_ENTRY_TYPE_PREPARED_STATEMENT = 5,481	DUCKDB_CATALOG_ENTRY_TYPE_SEQUENCE = 6,482	DUCKDB_CATALOG_ENTRY_TYPE_COLLATION = 7,483	DUCKDB_CATALOG_ENTRY_TYPE_TYPE = 8,484	DUCKDB_CATALOG_ENTRY_TYPE_DATABASE = 9,485} duckdb_catalog_entry_type;486487/* --- Struct forward declarations for common_enums --- */488489/* --- Types for common_enums --- */490491/*!492 * Alias for the DUCKDB_TYPE enum.493 *494 * history:495 * - stable: v0.1.0496 */497typedef DUCKDB_TYPE duckdb_type;498499/* --- Constants for common_enums --- */500501/* --- Function pointer typedefs for common_enums --- */502503/* --- Functions for common_enums --- */504505/* --- Struct definitions for common_enums --- */506507/* ============================================================================508 * MODULE: common_types509 * ============================================================================ */510511/* --- Enums for common_types --- */512513/* --- Struct forward declarations for common_types --- */514515typedef struct duckdb_date duckdb_date;516517typedef struct duckdb_date_struct duckdb_date_struct;518519typedef struct duckdb_time duckdb_time;520521typedef struct duckdb_time_struct duckdb_time_struct;522523typedef struct duckdb_time_ns duckdb_time_ns;524525typedef struct duckdb_time_tz duckdb_time_tz;526527typedef struct duckdb_time_tz_struct duckdb_time_tz_struct;528529typedef struct duckdb_timestamp duckdb_timestamp;530531typedef struct duckdb_timestamp_struct duckdb_timestamp_struct;532533typedef struct duckdb_timestamp_s duckdb_timestamp_s;534535typedef struct duckdb_timestamp_ms duckdb_timestamp_ms;536537typedef struct duckdb_timestamp_ns duckdb_timestamp_ns;538539typedef struct duckdb_interval duckdb_interval;540541typedef struct duckdb_hugeint duckdb_hugeint;542543typedef struct duckdb_uhugeint duckdb_uhugeint;544545typedef struct duckdb_decimal duckdb_decimal;546547typedef struct duckdb_query_progress_type duckdb_query_progress_type;548549typedef struct duckdb_list_entry duckdb_list_entry;550551typedef struct duckdb_column duckdb_column;552553typedef struct duckdb_string duckdb_string;554555typedef struct duckdb_blob duckdb_blob;556557typedef struct duckdb_bit duckdb_bit;558559typedef struct duckdb_bignum duckdb_bignum;560561typedef struct duckdb_result duckdb_result;562563/* --- Types for common_types --- */564565/* --- Constants for common_types --- */566567/* --- Function pointer typedefs for common_types --- */568569/* --- Functions for common_types --- */570571/* --- Struct definitions for common_types --- */572573/*!574 * DATE is stored as days since 1970-01-01.575 *576 * history:577 * - stable: v0.1.0578 */579struct duckdb_date {580	int32_t days;581};582583/*!584 * Decomposed date components.585 *586 * history:587 * - stable: v0.2.9588 */589struct duckdb_date_struct {590	int32_t year;591	int8_t month;592	int8_t day;593};594595/*!596 * TIME is stored as microseconds since 00:00:00.597 *598 * history:599 * - stable: v0.1.0600 */601struct duckdb_time {602	int64_t micros;603};604605/*!606 * Decomposed time components.607 *608 * history:609 * - stable: v0.2.9610 */611struct duckdb_time_struct {612	int8_t hour;613	int8_t min;614	int8_t sec;615	int32_t micros;616};617618/*!619 * TIME_NS is stored as nanoseconds since 00:00:00.620 *621 * history:622 * - unstable: v1.4.0623 * - stable: v1.5.6624 */625struct duckdb_time_ns {626	int64_t nanos;627};628629/*!630 * TIME_TZ stored as 40 bits for microseconds and 24 bits for offset.631 *632 * history:633 * - stable: v0.10.0634 */635struct duckdb_time_tz {636	uint64_t bits;637};638639/*!640 * Decomposed TIME_TZ components.641 *642 * history:643 * - stable: v0.10.0644 */645struct duckdb_time_tz_struct {646	duckdb_time_struct time;647	int32_t offset;648};649650/*!651 * TIMESTAMP is stored as microseconds since 1970-01-01.652 *653 * history:654 * - stable: v0.1.0655 */656struct duckdb_timestamp {657	int64_t micros;658};659660/*!661 * Decomposed timestamp components.662 *663 * history:664 * - stable: v0.2.9665 */666struct duckdb_timestamp_struct {667	duckdb_date_struct date;668	duckdb_time_struct time;669};670671/*!672 * TIMESTAMP_S is stored as seconds since 1970-01-01.673 *674 * history:675 * - stable: v1.2.0676 */677struct duckdb_timestamp_s {678	int64_t seconds;679};680681/*!682 * TIMESTAMP_MS is stored as milliseconds since 1970-01-01.683 *684 * history:685 * - stable: v1.2.0686 */687struct duckdb_timestamp_ms {688	int64_t millis;689};690691/*!692 * TIMESTAMP_NS is stored as nanoseconds since 1970-01-01.693 *694 * history:695 * - stable: v1.2.0696 */697struct duckdb_timestamp_ns {698	int64_t nanos;699};700701/*!702 * INTERVAL is stored in months, days, and micros.703 *704 * history:705 * - stable: v0.2.1706 */707struct duckdb_interval {708	int32_t months;709	int32_t days;710	int64_t micros;711};712713/*!714 * HUGEINT is composed of a lower and upper component. Value is upper * 2^64 + lower.715 *716 * history:717 * - stable: v0.2.1718 */719struct duckdb_hugeint {720	uint64_t lower;721	int64_t upper;722};723724/*!725 * UHUGEINT is composed of a lower and upper component. Value is upper * 2^64 + lower.726 *727 * history:728 * - stable: v0.10.0729 */730struct duckdb_uhugeint {731	uint64_t lower;732	uint64_t upper;733};734735/*!736 * DECIMAL is composed of a width and a scale. Value is stored in a HUGEINT.737 *738 * history:739 * - stable: v0.3.3740 */741struct duckdb_decimal {742	uint8_t width;743	uint8_t scale;744	duckdb_hugeint value;745};746747/*!748 * A type holding information about the query execution progress.749 *750 * history:751 * - stable: v0.10.0752 */753struct duckdb_query_progress_type {754	double percentage;755	uint64_t rows_processed;756	uint64_t total_rows_to_process;757};758759/*!760 * Internal representation of a LIST metadata entry.761 *762 * history:763 * - stable: v0.7.0764 */765struct duckdb_list_entry {766	uint64_t offset;767	uint64_t length;768};769770/*!771 * A column in a result. Use accessor functions rather than accessing fields directly.772 *773 * history:774 * - stable: v0.1.0775 */776struct duckdb_column {777	void *deprecated_data;778	bool *deprecated_nullmask;779	duckdb_type deprecated_type;780	char *deprecated_name;781	void *internal_data;782};783784/*!785 * A DuckDB string (char* + size). Free data with duckdb_free.786 *787 * history:788 * - stable: v0.6.0789 */790struct duckdb_string {791	char *data;792	idx_t size;793};794795/*!796 * A DuckDB BLOB (void* + size). Free data with duckdb_free.797 *798 * history:799 * - stable: v0.2.5800 */801struct duckdb_blob {802	void *data;803	idx_t size;804};805806/*!807 * A DuckDB BIT (uint8_t* + size). Free data with duckdb_free.808 *809 * history:810 * - stable: v1.2.0811 */812struct duckdb_bit {813	uint8_t *data;814	idx_t size;815};816817/*!818 * A DuckDB BIGNUM (uint8_t* + size + is_negative). The absolute value is stored in data in big endian format. Free data819 * with duckdb_free.820 *821 * history:822 * - stable: v1.2.0823 */824struct duckdb_bignum {825	uint8_t *data;826	idx_t size;827	bool is_negative;828};829830/*!831 * A query result. Must be freed with duckdb_destroy_result.832 *833 * history:834 * - stable: v0.1.0835 */836struct duckdb_result {837	idx_t deprecated_column_count;838	idx_t deprecated_row_count;839	idx_t deprecated_rows_changed;840	duckdb_column *deprecated_columns;841	char *deprecated_error_message;842	void *internal_data;843};844845/* ============================================================================846 * MODULE: common_handles847 * ============================================================================ */848849/* --- Enums for common_handles --- */850851/* --- Struct forward declarations for common_handles --- */852853/* --- Types for common_handles --- */854855/*!856 * A database instance cache. Must be destroyed with duckdb_destroy_instance_cache.857 *858 * history:859 * - unstable: v1.2.0860 * - stable: v1.5.6861 */862typedef struct _duckdb_instance_cache {863	void *internal_ptr;864} * duckdb_instance_cache;865866/*!867 * A database object. Must be closed with duckdb_close.868 *869 * history:870 * - stable: v0.1.0871 */872typedef struct _duckdb_database {873	void *internal_ptr;874} * duckdb_database;875876/*!877 * A connection to a duckdb database. Must be closed with duckdb_disconnect.878 *879 * history:880 * - stable: v0.1.0881 */882typedef struct _duckdb_connection {883	void *internal_ptr;884} * duckdb_connection;885886/*!887 * A client context of a duckdb connection. Must be destroyed with duckdb_destroy_client_context.888 *889 * history:890 * - unstable: v1.3.0891 * - stable: v1.5.6892 */893typedef struct _duckdb_client_context {894	void *internal_ptr;895} * duckdb_client_context;896897/*!898 * A prepared statement. Must be destroyed with duckdb_destroy_prepare.899 *900 * history:901 * - stable: v0.1.0902 */903typedef struct _duckdb_prepared_statement {904	void *internal_ptr;905} * duckdb_prepared_statement;906907/*!908 * Extracted statements. Must be destroyed with duckdb_destroy_extracted.909 *910 * history:911 * - stable: v0.7.0912 */913typedef struct _duckdb_extracted_statements {914	void *internal_ptr;915} * duckdb_extracted_statements;916917/*!918 * A pending query result. Must be destroyed with duckdb_destroy_pending.919 *920 * history:921 * - stable: v0.5.0922 */923typedef struct _duckdb_pending_result {924	void *internal_ptr;925} * duckdb_pending_result;926927/*!928 * The appender enables fast data loading into DuckDB. Must be destroyed with duckdb_appender_destroy.929 *930 * history:931 * - stable: v0.2.5932 */933typedef struct _duckdb_appender {934	void *internal_ptr;935} * duckdb_appender;936937/*!938 * The table description allows querying information about the table. Must be destroyed with939 * duckdb_table_description_destroy.940 *941 * history:942 * - stable: v1.1.0943 */944typedef struct _duckdb_table_description {945	void *internal_ptr;946} * duckdb_table_description;947948/*!949 * The configuration for opening a database. Must be destroyed with duckdb_destroy_config.950 *951 * history:952 * - stable: v0.2.8953 */954typedef struct _duckdb_config {955	void *internal_ptr;956} * duckdb_config;957958/*!959 * A custom configuration option instance. Must be destroyed with duckdb_destroy_config_option.960 *961 * history:962 * - unstable: v1.5.0963 * - stable: v1.5.6964 */965typedef struct _duckdb_config_option {966	void *internal_ptr;967} * duckdb_config_option;968969/*!970 * A logical type. Must be destroyed with duckdb_destroy_logical_type.971 *972 * history:973 * - stable: v0.3.3974 */975typedef struct _duckdb_logical_type {976	void *internal_ptr;977} * duckdb_logical_type;978979/*!980 * Holds extra information to register a custom logical type. Reserved for future use.981 *982 * history:983 * - stable: v1.1.0984 */985typedef struct _duckdb_create_type_info {986	void *internal_ptr;987} * duckdb_create_type_info;988989/*!990 * Contains a data chunk of a duckdb_result. Must be destroyed with duckdb_destroy_data_chunk.991 *992 * history:993 * - stable: v0.3.3994 */995typedef struct _duckdb_data_chunk {996	void *internal_ptr;997} * duckdb_data_chunk;998999/*!1000 * A value of a logical type. Must be destroyed with duckdb_destroy_value.1001 *1002 * history:1003 * - stable: v0.3.31004 */1005typedef struct _duckdb_value {1006	void *internal_ptr;1007} * duckdb_value;10081009/*!1010 * Holds a recursive tree containing profiling metrics.1011 *1012 * history:1013 * - stable: v1.1.01014 */1015typedef struct _duckdb_profiling_info {1016	void *internal_ptr;1017} * duckdb_profiling_info;10181019/*!1020 * Holds error data. Must be destroyed with duckdb_destroy_error_data.1021 *1022 * history:1023 * - unstable: v1.4.01024 * - stable: v1.5.61025 */1026typedef struct _duckdb_error_data {1027	void *internal_ptr;1028} * duckdb_error_data;10291030/*!1031 * Holds a bound expression. Must be destroyed with duckdb_destroy_expression.1032 *1033 * history:1034 * - unstable: v1.4.01035 * - stable: v1.5.61036 */1037typedef struct _duckdb_expression {1038	void *internal_ptr;1039} * duckdb_expression;10401041/*!1042 * A vector, either standalone or a column in a data chunk.1043 *1044 * history:1045 * - stable: v0.3.31046 */1047typedef struct _duckdb_vector {1048	void *internal_ptr;1049} * duckdb_vector;10501051/*!1052 * A selection vector defining a selection on top of a vector. Must be destroyed with duckdb_destroy_selection_vector.1053 *1054 * history:1055 * - unstable: v1.3.01056 * - stable: v1.5.61057 */1058typedef struct _duckdb_selection_vector {1059	void *internal_ptr;1060} * duckdb_selection_vector;10611062/*!1063 * Arrow options for transforming DuckDB schema/chunks to Arrow. Must be destroyed with duckdb_destroy_arrow_options.1064 *1065 * history:1066 * - unstable: v1.4.01067 * - stable: v1.5.61068 */1069typedef struct _duckdb_arrow_options {1070	void *internal_ptr;1071} * duckdb_arrow_options;10721073/*!1074 * An arrow result set. Must be destroyed with duckdb_destroy_arrow.1075 *1076 * history:1077 * - stable: v0.2.81078 * - deprecated: v1.5.61079 */1080typedef struct _duckdb_arrow {1081	void *internal_ptr;1082} * duckdb_arrow;10831084/*!1085 * An arrow stream wrapper. Must be destroyed with duckdb_destroy_arrow_stream.1086 *1087 * history:1088 * - stable: v0.9.01089 * - deprecated: v1.5.61090 */1091typedef struct _duckdb_arrow_stream {1092	void *internal_ptr;1093} * duckdb_arrow_stream;10941095/*!1096 * An arrow schema wrapper.1097 *1098 * history:1099 * - stable: v0.2.81100 * - deprecated: v1.5.61101 */1102typedef struct _duckdb_arrow_schema {1103	void *internal_ptr;1104} * duckdb_arrow_schema;11051106/*!1107 * An arrow array wrapper.1108 *1109 * history:1110 * - stable: v0.2.81111 * - deprecated: v1.5.61112 */1113typedef struct _duckdb_arrow_array {1114	void *internal_ptr;1115} * duckdb_arrow_array;11161117/*!1118 * Holds a converted Arrow schema. Must be destroyed with duckdb_destroy_arrow_converted_schema.1119 *1120 * history:1121 * - unstable: v1.4.01122 * - stable: v1.5.61123 */1124typedef struct _duckdb_arrow_converted_schema {1125	void *internal_ptr;1126} * duckdb_arrow_converted_schema;11271128/*!1129 * File open options. Must be destroyed with duckdb_destroy_file_open_options.1130 *1131 * history:1132 * - unstable: v1.5.01133 * - stable: v1.5.61134 */1135typedef struct _duckdb_file_open_options {1136	void *internal_ptr;1137} * duckdb_file_open_options;11381139/*!1140 * A file system instance. Must be destroyed with duckdb_destroy_file_system.1141 *1142 * history:1143 * - unstable: v1.5.01144 * - stable: v1.5.61145 */1146typedef struct _duckdb_file_system {1147	void *internal_ptr;1148} * duckdb_file_system;11491150/*!1151 * A file handle. Must be destroyed with duckdb_destroy_file_handle.1152 *1153 * history:1154 * - unstable: v1.5.01155 * - stable: v1.5.61156 */1157typedef struct _duckdb_file_handle {1158	void *internal_ptr;1159} * duckdb_file_handle;11601161/*!1162 * A handle to a database catalog. Must be destroyed with duckdb_destroy_catalog.1163 *1164 * history:1165 * - unstable: v1.5.01166 * - stable: v1.5.61167 */1168typedef struct _duckdb_catalog {1169	void *internal_ptr;1170} * duckdb_catalog;11711172/*!1173 * A handle to a catalog entry. Must be destroyed with duckdb_destroy_catalog_entry.1174 *1175 * history:1176 * - unstable: v1.5.01177 * - stable: v1.5.61178 */1179typedef struct _duckdb_catalog_entry {1180	void *internal_ptr;1181} * duckdb_catalog_entry;11821183/*!1184 * Used for threading, contains a task state. Must be destroyed with duckdb_destroy_task_state.1185 *1186 * history:1187 * - stable: v0.5.01188 */1189typedef void *duckdb_task_state;11901191/*!1192 * A scalar function. Must be destroyed with duckdb_destroy_scalar_function.1193 *1194 * history:1195 * - stable: v1.1.01196 */1197typedef struct _duckdb_scalar_function {1198	void *internal_ptr;1199} * duckdb_scalar_function;12001201/*!1202 * A scalar function set. Must be destroyed with duckdb_destroy_scalar_function_set.1203 *1204 * history:1205 * - stable: v1.1.01206 */1207typedef struct _duckdb_scalar_function_set {1208	void *internal_ptr;1209} * duckdb_scalar_function_set;12101211/*!1212 * An aggregate function. Must be destroyed with duckdb_destroy_aggregate_function.1213 *1214 * history:1215 * - stable: v1.1.01216 */1217typedef struct _duckdb_aggregate_function {1218	void *internal_ptr;1219} * duckdb_aggregate_function;12201221/*!1222 * An aggregate function set. Must be destroyed with duckdb_destroy_aggregate_function_set.1223 *1224 * history:1225 * - stable: v1.1.01226 */1227typedef struct _duckdb_aggregate_function_set {1228	void *internal_ptr;1229} * duckdb_aggregate_function_set;12301231/*!1232 * The state of an aggregate function.1233 *1234 * history:1235 * - stable: v1.1.01236 */1237typedef struct _duckdb_aggregate_state {1238	void *internal_ptr;1239} * duckdb_aggregate_state;12401241/*!1242 * A table function. Must be destroyed with duckdb_destroy_table_function.1243 *1244 * history:1245 * - stable: v0.3.31246 */1247typedef struct _duckdb_table_function {1248	void *internal_ptr;1249} * duckdb_table_function;12501251/*!1252 * A cast function. Must be destroyed with duckdb_destroy_cast_function.1253 *1254 * history:1255 * - stable: v1.1.01256 */1257typedef struct _duckdb_cast_function {1258	void *internal_ptr;1259} * duckdb_cast_function;12601261/*!1262 * A COPY function. Must be destroyed with duckdb_destroy_copy_function.1263 *1264 * history:1265 * - unstable: v1.5.01266 * - stable: v1.5.61267 */1268typedef struct _duckdb_copy_function {1269	void *internal_ptr;1270} * duckdb_copy_function;12711272/*!1273 * Info for the bind function of a COPY function.1274 *1275 * history:1276 * - unstable: v1.5.01277 * - stable: v1.5.61278 */1279typedef struct _duckdb_copy_function_bind_info {1280	void *internal_ptr;1281} * duckdb_copy_function_bind_info;12821283/*!1284 * Info for the global initialization function of a COPY function.1285 *1286 * history:1287 * - unstable: v1.5.01288 * - stable: v1.5.61289 */1290typedef struct _duckdb_copy_function_global_init_info {1291	void *internal_ptr;1292} * duckdb_copy_function_global_init_info;12931294/*!1295 * Info for the sink function of a COPY function.1296 *1297 * history:1298 * - unstable: v1.5.01299 * - stable: v1.5.61300 */1301typedef struct _duckdb_copy_function_sink_info {1302	void *internal_ptr;1303} * duckdb_copy_function_sink_info;13041305/*!1306 * Info for the finalize function of a COPY function.1307 *1308 * history:1309 * - unstable: v1.5.01310 * - stable: v1.5.61311 */1312typedef struct _duckdb_copy_function_finalize_info {1313	void *internal_ptr;1314} * duckdb_copy_function_finalize_info;13151316/*!1317 * Info passed to a replacement scan callback.1318 *1319 * history:1320 * - stable: v0.3.31321 */1322typedef struct _duckdb_replacement_scan_info {1323	void *internal_ptr;1324} * duckdb_replacement_scan_info;13251326/*!1327 * A log storage instance. Must be destroyed with duckdb_destroy_log_storage.1328 *1329 * history:1330 * - unstable: v1.5.01331 * - stable: v1.5.61332 */1333typedef struct _duckdb_log_storage {1334	void *internal_ptr;1335} * duckdb_log_storage;13361337/*!1338 * Additional function info.1339 *1340 * history:1341 * - stable: v0.3.31342 */1343typedef struct _duckdb_function_info {1344	void *internal_ptr;1345} * duckdb_function_info;13461347/*!1348 * The bind info of a function.1349 *1350 * history:1351 * - stable: v0.3.31352 */1353typedef struct _duckdb_bind_info {1354	void *internal_ptr;1355} * duckdb_bind_info;13561357/*!1358 * Additional function initialization info.1359 *1360 * history:1361 * - stable: v0.3.31362 */1363typedef struct _duckdb_init_info {1364	void *internal_ptr;1365} * duckdb_init_info;13661367/*!1368 * Holds the state of the C API extension initialization process.1369 *1370 * history:1371 * - stable: v1.1.01372 */1373typedef struct _duckdb_extension_info {1374	void *internal_ptr;1375} * duckdb_extension_info;13761377/*!1378 * Type definition for the data pointers of selection vectors.1379 *1380 * history:1381 * - unstable: v1.3.01382 * - stable: v1.5.61383 */1384#ifndef DUCKDB_TYPEDEF_SEL_T1385#define DUCKDB_TYPEDEF_SEL_T1386typedef uint32_t sel_t;1387#endif13881389/* --- Constants for common_handles --- */13901391/* --- Function pointer typedefs for common_handles --- */13921393/*!1394 * The callback to destroy data.1395 *1396 * history:1397 * - stable: v0.3.31398 */1399typedef void (*duckdb_delete_callback_t)(void *data);14001401/*!1402 * The callback to copy data.1403 *1404 * history:1405 * - unstable: v1.4.01406 * - stable: v1.5.61407 */1408typedef void *(*duckdb_copy_callback_t)(void *data);14091410/*!1411 * The bind function of a table function.1412 *1413 * history:1414 * - stable: v0.3.31415 */1416typedef void (*duckdb_table_function_bind_t)(duckdb_bind_info info);14171418/*!1419 * The init function of a table function.1420 *1421 * history:1422 * - stable: v0.3.31423 */1424typedef void (*duckdb_table_function_init_t)(duckdb_init_info info);14251426/*!1427 * The main function of a table function.1428 *1429 * history:1430 * - stable: v0.3.31431 */1432typedef void (*duckdb_table_function_t)(duckdb_function_info info, duckdb_data_chunk output);14331434/*!1435 * The callback function for replacement scans.1436 *1437 * history:1438 * - stable: v0.3.31439 */1440typedef void (*duckdb_replacement_callback_t)(duckdb_replacement_scan_info info, const char *table_name, void *data);14411442/*!1443 * The callback to write a log entry.1444 *1445 * history:1446 * - unstable: v1.5.01447 * - stable: v1.5.61448 */1449typedef void (*duckdb_logger_write_log_entry_t)(void *extra_data, duckdb_timestamp *timestamp, const char *level,1450                                                const char *log_type, const char *log_message);14511452/*!1453 * The sink function of a copy function.1454 *1455 * history:1456 * - unstable: v1.5.01457 * - stable: v1.5.61458 */1459typedef void (*duckdb_copy_function_sink_t)(duckdb_copy_function_sink_info info, duckdb_data_chunk input);14601461/*!1462 * The finalize function of a copy function.1463 *1464 * history:1465 * - unstable: v1.5.01466 * - stable: v1.5.61467 */1468typedef void (*duckdb_copy_function_finalize_t)(duckdb_copy_function_finalize_info info);14691470/*!1471 * A function to get the size of an aggregate state.1472 *1473 * history:1474 * - stable: v1.1.01475 */1476typedef idx_t (*duckdb_aggregate_state_size)(duckdb_function_info info);14771478/*!1479 * A function to initialize an aggregate state.1480 *1481 * history:1482 * - stable: v1.1.01483 */1484typedef void (*duckdb_aggregate_init_t)(duckdb_function_info info, duckdb_aggregate_state state);14851486/*!1487 * An optional function to destroy an aggregate state.1488 *1489 * history:1490 * - stable: v1.1.01491 */1492typedef void (*duckdb_aggregate_destroy_t)(duckdb_aggregate_state *states, idx_t count);14931494/*!1495 * A function to update a set of aggregate states with new values.1496 *1497 * history:1498 * - stable: v1.1.01499 */1500typedef void (*duckdb_aggregate_update_t)(duckdb_function_info info, duckdb_data_chunk input,1501                                          duckdb_aggregate_state *states);15021503/*!1504 * A function to combine aggregate states.1505 *1506 * history:1507 * - stable: v1.1.01508 */1509typedef void (*duckdb_aggregate_combine_t)(duckdb_function_info info, duckdb_aggregate_state *source,1510                                           duckdb_aggregate_state *target, idx_t count);15111512/*!1513 * A function to finalize aggregate states into a result vector.1514 *1515 * history:1516 * - stable: v1.1.01517 */1518typedef void (*duckdb_aggregate_finalize_t)(duckdb_function_info info, duckdb_aggregate_state *source,1519                                            duckdb_vector result, idx_t count, idx_t offset);15201521/*!1522 * The bind function of a scalar function.1523 *1524 * history:1525 * - unstable: v1.3.01526 * - stable: v1.5.61527 */1528typedef void (*duckdb_scalar_function_bind_t)(duckdb_bind_info info);15291530/*!1531 * The init function of a scalar function.1532 *1533 * history:1534 * - unstable: v1.5.01535 * - stable: v1.5.61536 */1537typedef void (*duckdb_scalar_function_init_t)(duckdb_init_info info);15381539/*!1540 * The main function of a scalar function.1541 *1542 * history:1543 * - stable: v1.1.01544 */1545typedef void (*duckdb_scalar_function_t)(duckdb_function_info info, duckdb_data_chunk input, duckdb_vector output);15461547/*!1548 * The function to cast from an input vector to an output vector.1549 *1550 * history:1551 * - stable: v1.1.01552 */1553typedef bool (*duckdb_cast_function_t)(duckdb_function_info info, idx_t count, duckdb_vector input,1554                                       duckdb_vector output);15551556/*!1557 * The bind function of a copy function.1558 *1559 * history:1560 * - unstable: v1.5.01561 * - stable: v1.5.61562 */1563typedef void (*duckdb_copy_function_bind_t)(duckdb_copy_function_bind_info info);15641565/*!1566 * The global initialization function of a copy function.1567 *1568 * history:1569 * - unstable: v1.5.01570 * - stable: v1.5.61571 */1572typedef void (*duckdb_copy_function_global_init_t)(duckdb_copy_function_global_init_info info);15731574/* --- Functions for common_handles --- */15751576/* --- Struct definitions for common_handles --- */15771578/* ============================================================================1579 * MODULE: datetime_helpers1580 * ============================================================================ */15811582/* --- Enums for datetime_helpers --- */15831584/* --- Struct forward declarations for datetime_helpers --- */15851586/* --- Types for datetime_helpers --- */15871588/* --- Constants for datetime_helpers --- */15891590/* --- Function pointer typedefs for datetime_helpers --- */15911592/* --- Functions for datetime_helpers --- */15931594#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9)1595/*!1596 * Decompose a `duckdb_date` object into year, month and date (stored as `duckdb_date_struct`).1597 *1598 * history:1599 * - stable: v0.2.91600 *1601 * @param date The date object, as obtained from a `DUCKDB_TYPE_DATE` column.1602 * @return duckdb_date_struct1603 */1604DUCKDB_C_API duckdb_date_struct duckdb_from_date(duckdb_date date);1605#endif16061607#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9)1608/*!1609 * Re-compose a `duckdb_date` from year, month and date (`duckdb_date_struct`).1610 *1611 * If the year, month and day do not form a valid date the result will be 0.1612 *1613 * history:1614 * - stable: v0.2.91615 *1616 * @param date The year, month and date stored in a `duckdb_date_struct`.1617 * @return duckdb_date1618 */1619DUCKDB_C_API duckdb_date duckdb_to_date(duckdb_date_struct date);1620#endif16211622#if DUCKDB_API_VERSION_AT_LEAST(0, 10, 0)1623/*!1624 * Test a `duckdb_date` to see if it is a finite value.1625 *1626 * history:1627 * - stable: v0.10.01628 *1629 * @param date The date object, as obtained from a `DUCKDB_TYPE_DATE` column.1630 * @return bool1631 */1632DUCKDB_C_API bool duckdb_is_finite_date(duckdb_date date);1633#endif16341635#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9)1636/*!1637 * Decompose a `duckdb_time` object into hour, minute, second and microsecond (stored as `duckdb_time_struct`).1638 *1639 * history:1640 * - stable: v0.2.91641 *1642 * @param time The time object, as obtained from a `DUCKDB_TYPE_TIME` column.1643 * @return duckdb_time_struct1644 */1645DUCKDB_C_API duckdb_time_struct duckdb_from_time(duckdb_time time);1646#endif16471648#if DUCKDB_API_VERSION_AT_LEAST(0, 10, 0)1649/*!1650 * Create a `duckdb_time_tz` object from micros and a timezone offset.1651 *1652 * history:1653 * - stable: v0.10.01654 *1655 * @param micros The microsecond component of the time.1656 * @param offset The timezone offset component of the time.1657 * @return duckdb_time_tz1658 */1659DUCKDB_C_API duckdb_time_tz duckdb_create_time_tz(int64_t micros, int32_t offset);1660#endif16611662#if DUCKDB_API_VERSION_AT_LEAST(0, 10, 0)1663/*!1664 * Decompose a TIME_TZ objects into micros and a timezone offset.1665 *1666 * Use `duckdb_from_time` to further decompose the micros into hour, minute, second and microsecond.1667 *1668 * history:1669 * - stable: v0.10.01670 *1671 * @param micros The time object, as obtained from a `DUCKDB_TYPE_TIME_TZ` column.1672 * @return duckdb_time_tz_struct1673 */1674DUCKDB_C_API duckdb_time_tz_struct duckdb_from_time_tz(duckdb_time_tz micros);1675#endif16761677#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9)1678/*!1679 * Re-compose a `duckdb_time` from hour, minute, second and microsecond (`duckdb_time_struct`).1680 *1681 * history:1682 * - stable: v0.2.91683 *1684 * @param time The hour, minute, second and microsecond in a `duckdb_time_struct`.1685 * @return duckdb_time1686 */1687DUCKDB_C_API duckdb_time duckdb_to_time(duckdb_time_struct time);1688#endif16891690#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9)1691/*!1692 * Decompose a `duckdb_timestamp` object into a `duckdb_timestamp_struct`.1693 *1694 * history:1695 * - stable: v0.2.91696 *1697 * @param ts The ts object, as obtained from a `DUCKDB_TYPE_TIMESTAMP` column.1698 * @return duckdb_timestamp_struct1699 */1700DUCKDB_C_API duckdb_timestamp_struct duckdb_from_timestamp(duckdb_timestamp ts);1701#endif17021703#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9)1704/*!1705 * Re-compose a `duckdb_timestamp` from a duckdb_timestamp_struct.1706 *1707 * If the date is not valid or the timestamp is out of range the result will be 0.1708 *1709 * history:1710 * - stable: v0.2.91711 *1712 * @param ts The de-composed elements in a `duckdb_timestamp_struct`.1713 * @return duckdb_timestamp1714 */1715DUCKDB_C_API duckdb_timestamp duckdb_to_timestamp(duckdb_timestamp_struct ts);1716#endif17171718#if DUCKDB_API_VERSION_AT_LEAST(0, 10, 0)1719/*!1720 * Test a `duckdb_timestamp` to see if it is a finite value.1721 *1722 * history:1723 * - stable: v0.10.01724 *1725 * @param ts The duckdb_timestamp object, as obtained from a `DUCKDB_TYPE_TIMESTAMP` column.1726 * @return bool1727 */1728DUCKDB_C_API bool duckdb_is_finite_timestamp(duckdb_timestamp ts);1729#endif17301731#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)1732/*!1733 * Test a `duckdb_timestamp_s` to see if it is a finite value.1734 *1735 * history:1736 * - stable: v1.2.01737 *1738 * @param ts The duckdb_timestamp_s object, as obtained from a `DUCKDB_TYPE_TIMESTAMP_S` column.1739 * @return bool1740 */1741DUCKDB_C_API bool duckdb_is_finite_timestamp_s(duckdb_timestamp_s ts);1742#endif17431744#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)1745/*!1746 * Test a `duckdb_timestamp_ms` to see if it is a finite value.1747 *1748 * history:1749 * - stable: v1.2.01750 *1751 * @param ts The duckdb_timestamp_ms object, as obtained from a `DUCKDB_TYPE_TIMESTAMP_MS` column.1752 * @return bool1753 */1754DUCKDB_C_API bool duckdb_is_finite_timestamp_ms(duckdb_timestamp_ms ts);1755#endif17561757#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)1758/*!1759 * Test a `duckdb_timestamp_ns` to see if it is a finite value.1760 *1761 * history:1762 * - stable: v1.2.01763 *1764 * @param ts The duckdb_timestamp_ns object, as obtained from a `DUCKDB_TYPE_TIMESTAMP_NS` column.1765 * @return bool1766 */1767DUCKDB_C_API bool duckdb_is_finite_timestamp_ns(duckdb_timestamp_ns ts);1768#endif17691770#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9)1771/*!1772 * Converts a duckdb_hugeint object (as obtained from a `DUCKDB_TYPE_HUGEINT` column) into a double.1773 *1774 * history:1775 * - stable: v0.2.91776 *1777 * @param val The hugeint value.1778 * @return double1779 */1780DUCKDB_C_API double duckdb_hugeint_to_double(duckdb_hugeint val);1781#endif17821783#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9)1784/*!1785 * Converts a double value to a duckdb_hugeint object.1786 *1787 * If the conversion fails because the double value is too big the result will be 0.1788 *1789 * history:1790 * - stable: v0.2.91791 *1792 * @param val The double value.1793 * @return duckdb_hugeint1794 */1795DUCKDB_C_API duckdb_hugeint duckdb_double_to_hugeint(double val);1796#endif17971798#if DUCKDB_API_VERSION_AT_LEAST(0, 10, 0)1799/*!1800 * Converts a duckdb_uhugeint object (as obtained from a `DUCKDB_TYPE_UHUGEINT` column) into a double.1801 *1802 * history:1803 * - stable: v0.10.01804 *1805 * @param val The uhugeint value.1806 * @return double1807 */1808DUCKDB_C_API double duckdb_uhugeint_to_double(duckdb_uhugeint val);1809#endif18101811#if DUCKDB_API_VERSION_AT_LEAST(0, 10, 0)1812/*!1813 * Converts a double value to a duckdb_uhugeint object.1814 *1815 * If the conversion fails because the double value is too big the result will be 0.1816 *1817 * history:1818 * - stable: v0.10.01819 *1820 * @param val The double value.1821 * @return duckdb_uhugeint1822 */1823DUCKDB_C_API duckdb_uhugeint duckdb_double_to_uhugeint(double val);1824#endif18251826#if DUCKDB_API_VERSION_AT_LEAST(0, 6, 0)1827/*!1828 * Converts a double value to a duckdb_decimal object.1829 *1830 * If the conversion fails because the double value is too big, or the width/scale are invalid the result will be 0.1831 *1832 * history:1833 * - stable: v0.6.01834 *1835 * @param val The double value.1836 * @param width1837 * @param scale1838 * @return duckdb_decimal1839 */1840DUCKDB_C_API duckdb_decimal duckdb_double_to_decimal(double val, uint8_t width, uint8_t scale);1841#endif18421843#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)1844/*!1845 * Converts a duckdb_decimal object (as obtained from a `DUCKDB_TYPE_DECIMAL` column) into a double.1846 *1847 * history:1848 * - stable: v0.3.31849 *1850 * @param val The decimal value.1851 * @return double1852 */1853DUCKDB_C_API double duckdb_decimal_to_double(duckdb_decimal val);1854#endif18551856/* --- Struct definitions for datetime_helpers --- */18571858/* ============================================================================1859 * MODULE: aggregate_function1860 * ============================================================================ */18611862/* --- Enums for aggregate_function --- */18631864/* --- Struct forward declarations for aggregate_function --- */18651866/* --- Types for aggregate_function --- */18671868/* --- Constants for aggregate_function --- */18691870/* --- Function pointer typedefs for aggregate_function --- */18711872/* --- Functions for aggregate_function --- */18731874#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)1875/*!1876 * Creates a new empty aggregate function.1877 *1878 * The return value should be destroyed with `duckdb_destroy_aggregate_function`.1879 *1880 * history:1881 * - stable: v1.1.01882 *1883 * @return duckdb_aggregate_function1884 */1885DUCKDB_C_API duckdb_aggregate_function duckdb_create_aggregate_function(void);1886#endif18871888#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)1889/*!1890 * Destroys the given aggregate function object.1891 *1892 * history:1893 * - stable: v1.1.01894 *1895 * @param aggregate_function1896 * @return void1897 */1898DUCKDB_C_API void duckdb_destroy_aggregate_function(duckdb_aggregate_function *aggregate_function);1899#endif19001901#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)1902/*!1903 * Sets the name of the given aggregate function.1904 *1905 * history:1906 * - stable: v1.1.01907 *1908 * @param aggregate_function The aggregate function1909 * @param name The name of the aggregate function1910 * @return void1911 */1912DUCKDB_C_API void duckdb_aggregate_function_set_name(duckdb_aggregate_function aggregate_function, const char *name);1913#endif19141915#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)1916/*!1917 * Adds a parameter to the aggregate function.1918 *1919 * history:1920 * - stable: v1.1.01921 *1922 * @param aggregate_function The aggregate function.1923 * @param type The parameter type. Cannot contain INVALID.1924 * @return void1925 */1926DUCKDB_C_API void duckdb_aggregate_function_add_parameter(duckdb_aggregate_function aggregate_function,1927                                                          duckdb_logical_type type);1928#endif19291930#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)1931/*!1932 * Sets the return type of the aggregate function.1933 *1934 * history:1935 * - stable: v1.1.01936 *1937 * @param aggregate_function The aggregate function.1938 * @param type The return type. Cannot contain INVALID or ANY.1939 * @return void1940 */1941DUCKDB_C_API void duckdb_aggregate_function_set_return_type(duckdb_aggregate_function aggregate_function,1942                                                            duckdb_logical_type type);1943#endif19441945#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)1946/*!1947 * Sets the main functions of the aggregate function.1948 *1949 * history:1950 * - stable: v1.1.01951 *1952 * @param aggregate_function The aggregate function1953 * @param state_size state size1954 * @param state_init state init function1955 * @param update update states1956 * @param combine combine states1957 * @param finalize finalize states1958 * @return void1959 */1960DUCKDB_C_API void duckdb_aggregate_function_set_functions(duckdb_aggregate_function aggregate_function,1961                                                          duckdb_aggregate_state_size state_size,1962                                                          duckdb_aggregate_init_t state_init,1963                                                          duckdb_aggregate_update_t update,1964                                                          duckdb_aggregate_combine_t combine,1965                                                          duckdb_aggregate_finalize_t finalize);1966#endif19671968#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)1969/*!1970 * Sets the state destructor callback of the aggregate function (optional)1971 *1972 * history:1973 * - stable: v1.1.01974 *1975 * @param aggregate_function The aggregate function1976 * @param destroy state destroy callback1977 * @return void1978 */1979DUCKDB_C_API void duckdb_aggregate_function_set_destructor(duckdb_aggregate_function aggregate_function,1980                                                           duckdb_aggregate_destroy_t destroy);1981#endif19821983#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)1984/*!1985 * Register the aggregate function object within the given connection.1986 *1987 * The function requires at least a name, functions and a return type.1988 *1989 * If the function is incomplete or a function with this name already exists DuckDBError is returned.1990 *1991 * history:1992 * - stable: v1.1.01993 *1994 * @param con The connection to register it in.1995 * @param aggregate_function1996 * @return duckdb_state1997 */1998DUCKDB_C_API duckdb_state duckdb_register_aggregate_function(duckdb_connection con,1999                                                             duckdb_aggregate_function aggregate_function);2000#endif20012002#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)2003/*!2004 * Sets the NULL handling of the aggregate function to SPECIAL_HANDLING.2005 *2006 * history:2007 * - stable: v1.1.02008 *2009 * @param aggregate_function The aggregate function2010 * @return void2011 */2012DUCKDB_C_API void duckdb_aggregate_function_set_special_handling(duckdb_aggregate_function aggregate_function);2013#endif20142015#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)2016/*!2017 * Assigns extra information to the scalar function that can be fetched during binding, etc.2018 *2019 * history:2020 * - stable: v1.1.02021 *2022 * @param aggregate_function The aggregate function2023 * @param extra_info The extra information2024 * @param destroy The callback that will be called to destroy the extra information (if any)2025 * @return void2026 */2027DUCKDB_C_API void duckdb_aggregate_function_set_extra_info(duckdb_aggregate_function aggregate_function,2028                                                           void *extra_info, duckdb_delete_callback_t destroy);2029#endif20302031#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)2032/*!2033 * Retrieves the extra info of the function as set in `duckdb_aggregate_function_set_extra_info`.2034 *2035 * history:2036 * - stable: v1.1.02037 *2038 * @param info The info object2039 * @return void*2040 */2041DUCKDB_C_API void *duckdb_aggregate_function_get_extra_info(duckdb_function_info info);2042#endif20432044#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)2045/*!2046 * Report that an error has occurred while executing the aggregate function.2047 *2048 * history:2049 * - stable: v1.1.02050 *2051 * @param info The info object2052 * @param error The error message2053 * @return void2054 */2055DUCKDB_C_API void duckdb_aggregate_function_set_error(duckdb_function_info info, const char *error);2056#endif20572058#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)2059/*!2060 * Creates a new empty aggregate function set.2061 *2062 * The return value should be destroyed with `duckdb_destroy_aggregate_function_set`.2063 *2064 * history:2065 * - stable: v1.1.02066 *2067 * @param name2068 * @return duckdb_aggregate_function_set2069 */2070DUCKDB_C_API duckdb_aggregate_function_set duckdb_create_aggregate_function_set(const char *name);2071#endif20722073#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)2074/*!2075 * Destroys the given aggregate function set object.2076 *2077 * history:2078 * - stable: v1.1.02079 *2080 * @param aggregate_function_set2081 * @return void2082 */2083DUCKDB_C_API void duckdb_destroy_aggregate_function_set(duckdb_aggregate_function_set *aggregate_function_set);2084#endif20852086#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)2087/*!2088 * Adds the aggregate function as a new overload to the aggregate function set.2089 *2090 * Returns DuckDBError if the function could not be added, for example if the overload already exists.2091 *2092 * history:2093 * - stable: v1.1.02094 *2095 * @param set The aggregate function set2096 * @param function The function to add2097 * @return duckdb_state2098 */2099DUCKDB_C_API duckdb_state duckdb_add_aggregate_function_to_set(duckdb_aggregate_function_set set,2100                                                               duckdb_aggregate_function function);2101#endif21022103#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)2104/*!2105 * Register the aggregate function set within the given connection.2106 *2107 * The set requires at least a single valid overload.2108 *2109 * If the set is incomplete or a function with this name already exists DuckDBError is returned.2110 *2111 * history:2112 * - stable: v1.1.02113 *2114 * @param con The connection to register it in.2115 * @param set The function set to register2116 * @return duckdb_state2117 */2118DUCKDB_C_API duckdb_state duckdb_register_aggregate_function_set(duckdb_connection con,2119                                                                 duckdb_aggregate_function_set set);2120#endif21212122/* --- Struct definitions for aggregate_function --- */21232124/* ============================================================================2125 * MODULE: appender2126 * ============================================================================ */21272128/* --- Enums for appender --- */21292130/* --- Struct forward declarations for appender --- */21312132/* --- Types for appender --- */21332134/* --- Constants for appender --- */21352136/* --- Function pointer typedefs for appender --- */21372138/* --- Functions for appender --- */21392140#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5)2141/*!2142 * Creates an appender object.2143 *2144 * Note that the object must be destroyed with `duckdb_appender_destroy`.2145 *2146 * history:2147 * - stable: v0.2.52148 *2149 * @param connection The connection context to create the appender in.2150 * @param schema The schema of the table to append to, or `nullptr` for the default schema.2151 * @param table The table name to append to.2152 * @param out_appender The resulting appender object.2153 * @return duckdb_state2154 */2155DUCKDB_C_API duckdb_state duckdb_appender_create(duckdb_connection connection, const char *schema, const char *table,2156                                                 duckdb_appender *out_appender);2157#endif21582159#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)2160/*!2161 * Creates an appender object.2162 *2163 * Note that the object must be destroyed with `duckdb_appender_destroy`.2164 *2165 * history:2166 * - stable: v1.2.02167 *2168 * @param connection The connection context to create the appender in.2169 * @param catalog The catalog of the table to append to, or `nullptr` for the default catalog.2170 * @param schema The schema of the table to append to, or `nullptr` for the default schema.2171 * @param table The table name to append to.2172 * @param out_appender The resulting appender object.2173 * @return duckdb_state2174 */2175DUCKDB_C_API duckdb_state duckdb_appender_create_ext(duckdb_connection connection, const char *catalog,2176                                                     const char *schema, const char *table,2177                                                     duckdb_appender *out_appender);2178#endif21792180#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)2181/*!2182 * Creates an appender object that executes the given query with any data appended to it.2183 *2184 * Note that the object must be destroyed with `duckdb_appender_destroy`.2185 *2186 * history:2187 * - unstable: v1.4.02188 * - stable: v1.5.62189 *2190 * @param connection The connection context to create the appender in.2191 * @param query The query to execute, can be an INSERT, DELETE, UPDATE or MERGE INTO statement.2192 * @param column_count The number of columns to append.2193 * @param types The types of the columns to append.2194 * @param table_name (optionally) the table name used to refer to the appended data, defaults to "appended_data".2195 * @param column_names (optionally) the list of column names, defaults to "col1", "col2", ...2196 * @param out_appender The resulting appender object.2197 * @return duckdb_state2198 */2199DUCKDB_C_API duckdb_state duckdb_appender_create_query(duckdb_connection connection, const char *query,2200                                                       idx_t column_count, duckdb_logical_type *types,2201                                                       const char *table_name, const char **column_names,2202                                                       duckdb_appender *out_appender);2203#endif22042205#if DUCKDB_API_VERSION_AT_LEAST(0, 10, 0)2206/*!2207 * Returns the number of columns that belong to the appender. If there is no active column list, then this equals the2208 * table's physical columns.2209 *2210 * history:2211 * - stable: v0.10.02212 *2213 * @param appender The appender to get the column count from.2214 * @return idx_t2215 */2216DUCKDB_C_API idx_t duckdb_appender_column_count(duckdb_appender appender);2217#endif22182219#if DUCKDB_API_VERSION_AT_LEAST(0, 10, 0)2220/*!2221 * Returns the type of the column at the specified index. This is either a type in the active column list, or the same2222 * type as a column in the receiving table.2223 *2224 * Note: The resulting type must be destroyed with `duckdb_destroy_logical_type`.2225 *2226 * history:2227 * - stable: v0.10.02228 *2229 * @param appender The appender to get the column type from.2230 * @param col_idx The index of the column to get the type of.2231 * @return duckdb_logical_type2232 */2233DUCKDB_C_API duckdb_logical_type duckdb_appender_column_type(duckdb_appender appender, idx_t col_idx);2234#endif22352236#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)2237/*!2238 * Returns the error data associated with the appender. Must be destroyed with duckdb_destroy_error_data.2239 *2240 * history:2241 * - unstable: v1.4.02242 * - stable: v1.5.62243 *2244 * @param appender The appender to get the error data from.2245 * @return duckdb_error_data2246 */2247DUCKDB_C_API duckdb_error_data duckdb_appender_error_data(duckdb_appender appender);2248#endif22492250#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5)2251/*!2252 * Flush the appender to the table, forcing the cache of the appender to be cleared. Requires a connection with no open2253 * result. If flushing the data triggers a constraint violation or any other error, then all data is invalidated, and2254 * this function returns DuckDBError. It is not possible to append more values. Call duckdb_appender_error_data to2255 * obtain the error data followed by duckdb_appender_destroy to destroy the invalidated appender.2256 *2257 * history:2258 * - stable: v0.2.52259 *2260 * @param appender The appender to flush.2261 * @return duckdb_state2262 */2263DUCKDB_C_API duckdb_state duckdb_appender_flush(duckdb_appender appender);2264#endif22652266#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)2267/*!2268 * Clears all buffered data from the appender without flushing it to the table. This discards any data that has been2269 * appended but not yet written. The appender can continue to be used after clearing.2270 *2271 * history:2272 * - unstable: v1.5.02273 * - stable: v1.5.62274 *2275 * @param appender The appender to clear.2276 * @return duckdb_state2277 */2278DUCKDB_C_API duckdb_state duckdb_appender_clear(duckdb_appender appender);2279#endif22802281#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5)2282/*!2283 * Closes the appender by flushing all intermediate states and closing it for further appends. If flushing the data2284 * triggers a constraint violation or any other error, then all data is invalidated, and this function returns2285 * DuckDBError. Call duckdb_appender_error_data to obtain the error data followed by duckdb_appender_destroy to destroy2286 * the invalidated appender.2287 *2288 * history:2289 * - stable: v0.2.52290 *2291 * @param appender The appender to flush and close.2292 * @return duckdb_state2293 */2294DUCKDB_C_API duckdb_state duckdb_appender_close(duckdb_appender appender);2295#endif22962297#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5)2298/*!2299 * Closes the appender by flushing all intermediate states to the table and destroying it. By destroying it, this2300 * function de-allocates all memory associated with the appender. If flushing the data triggers a constraint violation,2301 * then all data is invalidated, and this function returns DuckDBError. Due to the destruction of the appender, it is no2302 * longer possible to obtain the specific error message with duckdb_appender_error. Therefore, call2303 * duckdb_appender_close before destroying the appender, if you need insights into the specific error.2304 *2305 * history:2306 * - stable: v0.2.52307 *2308 * @param appender The appender to flush, close and destroy.2309 * @return duckdb_state2310 */2311DUCKDB_C_API duckdb_state duckdb_appender_destroy(duckdb_appender *appender);2312#endif23132314#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)2315/*!2316 * Appends a column to the active column list of the appender. Immediately flushes all previous data.2317 *2318 * The active column list specifies all columns that are expected when flushing the data. Any non-active columns are2319 * filled with their default values, or NULL.2320 *2321 * history:2322 * - stable: v1.2.02323 *2324 * @param appender The appender to add the column to.2325 * @param name2326 * @return duckdb_state2327 */2328DUCKDB_C_API duckdb_state duckdb_appender_add_column(duckdb_appender appender, const char *name);2329#endif23302331#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)2332/*!2333 * Removes all columns from the active column list of the appender, resetting the appender to treat all columns as2334 * active. Immediately flushes all previous data.2335 *2336 * history:2337 * - stable: v1.2.02338 *2339 * @param appender The appender to clear the columns from.2340 * @return duckdb_state2341 */2342DUCKDB_C_API duckdb_state duckdb_appender_clear_columns(duckdb_appender appender);2343#endif23442345#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5)2346/*!2347 * A nop function, provided for backwards compatibility reasons. Does nothing. Only `duckdb_appender_end_row` is2348 * required.2349 *2350 * history:2351 * - stable: v0.2.52352 *2353 * @param appender2354 * @return duckdb_state2355 */2356DUCKDB_C_API duckdb_state duckdb_appender_begin_row(duckdb_appender appender);2357#endif23582359#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5)2360/*!2361 * Finish the current row of appends. After end_row is called, the next row can be appended.2362 *2363 * history:2364 * - stable: v0.2.52365 *2366 * @param appender The appender.2367 * @return duckdb_state2368 */2369DUCKDB_C_API duckdb_state duckdb_appender_end_row(duckdb_appender appender);2370#endif23712372#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)2373/*!2374 * Append a DEFAULT value (NULL if DEFAULT not available for column) to the appender.2375 *2376 * history:2377 * - stable: v1.1.02378 *2379 * @param appender2380 * @return duckdb_state2381 */2382DUCKDB_C_API duckdb_state duckdb_append_default(duckdb_appender appender);2383#endif23842385#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)2386/*!2387 * Append a DEFAULT value, at the specified row and column, (NULL if DEFAULT not available for column) to the chunk2388 * created from the specified appender. The default value of the column must be a constant value. Non-deterministic2389 * expressions like nextval('seq') or random() are not supported.2390 *2391 * history:2392 * - unstable: v1.2.02393 * - stable: v1.5.62394 *2395 * @param appender The appender to get the default value from.2396 * @param chunk The data chunk to append the default value to.2397 * @param col The chunk column index to append the default value to.2398 * @param row The chunk row index to append the default value to.2399 * @return duckdb_state2400 */2401DUCKDB_C_API duckdb_state duckdb_append_default_to_chunk(duckdb_appender appender, duckdb_data_chunk chunk, idx_t col,2402                                                         idx_t row);2403#endif24042405#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5)2406/*!2407 * Append a bool value to the appender.2408 *2409 * history:2410 * - stable: v0.2.52411 *2412 * @param appender2413 * @param value2414 * @return duckdb_state2415 */2416DUCKDB_C_API duckdb_state duckdb_append_bool(duckdb_appender appender, bool value);2417#endif24182419#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5)2420/*!2421 * Append an int8_t value to the appender.2422 *2423 * history:2424 * - stable: v0.2.52425 *2426 * @param appender2427 * @param value2428 * @return duckdb_state2429 */2430DUCKDB_C_API duckdb_state duckdb_append_int8(duckdb_appender appender, int8_t value);2431#endif24322433#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5)2434/*!2435 * Append an int16_t value to the appender.2436 *2437 * history:2438 * - stable: v0.2.52439 *2440 * @param appender2441 * @param value2442 * @return duckdb_state2443 */2444DUCKDB_C_API duckdb_state duckdb_append_int16(duckdb_appender appender, int16_t value);2445#endif24462447#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5)2448/*!2449 * Append an int32_t value to the appender.2450 *2451 * history:2452 * - stable: v0.2.52453 *2454 * @param appender2455 * @param value2456 * @return duckdb_state2457 */2458DUCKDB_C_API duckdb_state duckdb_append_int32(duckdb_appender appender, int32_t value);2459#endif24602461#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5)2462/*!2463 * Append an int64_t value to the appender.2464 *2465 * history:2466 * - stable: v0.2.52467 *2468 * @param appender2469 * @param value2470 * @return duckdb_state2471 */2472DUCKDB_C_API duckdb_state duckdb_append_int64(duckdb_appender appender, int64_t value);2473#endif24742475#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9)2476/*!2477 * Append a duckdb_hugeint value to the appender.2478 *2479 * history:2480 * - stable: v0.2.92481 *2482 * @param appender2483 * @param value2484 * @return duckdb_state2485 */2486DUCKDB_C_API duckdb_state duckdb_append_hugeint(duckdb_appender appender, duckdb_hugeint value);2487#endif24882489#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5)2490/*!2491 * Append a uint8_t value to the appender.2492 *2493 * history:2494 * - stable: v0.2.52495 *2496 * @param appender2497 * @param value2498 * @return duckdb_state2499 */2500DUCKDB_C_API duckdb_state duckdb_append_uint8(duckdb_appender appender, uint8_t value);2501#endif25022503#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5)2504/*!2505 * Append a uint16_t value to the appender.2506 *2507 * history:2508 * - stable: v0.2.52509 *2510 * @param appender2511 * @param value2512 * @return duckdb_state2513 */2514DUCKDB_C_API duckdb_state duckdb_append_uint16(duckdb_appender appender, uint16_t value);2515#endif25162517#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5)2518/*!2519 * Append a uint32_t value to the appender.2520 *2521 * history:2522 * - stable: v0.2.52523 *2524 * @param appender2525 * @param value2526 * @return duckdb_state2527 */2528DUCKDB_C_API duckdb_state duckdb_append_uint32(duckdb_appender appender, uint32_t value);2529#endif25302531#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5)2532/*!2533 * Append a uint64_t value to the appender.2534 *2535 * history:2536 * - stable: v0.2.52537 *2538 * @param appender2539 * @param value2540 * @return duckdb_state2541 */2542DUCKDB_C_API duckdb_state duckdb_append_uint64(duckdb_appender appender, uint64_t value);2543#endif25442545#if DUCKDB_API_VERSION_AT_LEAST(0, 10, 0)2546/*!2547 * Append a duckdb_uhugeint value to the appender.2548 *2549 * history:2550 * - stable: v0.10.02551 *2552 * @param appender2553 * @param value2554 * @return duckdb_state2555 */2556DUCKDB_C_API duckdb_state duckdb_append_uhugeint(duckdb_appender appender, duckdb_uhugeint value);2557#endif25582559#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5)2560/*!2561 * Append a float value to the appender.2562 *2563 * history:2564 * - stable: v0.2.52565 *2566 * @param appender2567 * @param value2568 * @return duckdb_state2569 */2570DUCKDB_C_API duckdb_state duckdb_append_float(duckdb_appender appender, float value);2571#endif25722573#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5)2574/*!2575 * Append a double value to the appender.2576 *2577 * history:2578 * - stable: v0.2.52579 *2580 * @param appender2581 * @param value2582 * @return duckdb_state2583 */2584DUCKDB_C_API duckdb_state duckdb_append_double(duckdb_appender appender, double value);2585#endif25862587#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9)2588/*!2589 * Append a duckdb_date value to the appender.2590 *2591 * history:2592 * - stable: v0.2.92593 *2594 * @param appender2595 * @param value2596 * @return duckdb_state2597 */2598DUCKDB_C_API duckdb_state duckdb_append_date(duckdb_appender appender, duckdb_date value);2599#endif26002601#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9)2602/*!2603 * Append a duckdb_time value to the appender.2604 *2605 * history:2606 * - stable: v0.2.92607 *2608 * @param appender2609 * @param value2610 * @return duckdb_state2611 */2612DUCKDB_C_API duckdb_state duckdb_append_time(duckdb_appender appender, duckdb_time value);2613#endif26142615#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9)2616/*!2617 * Append a duckdb_timestamp value to the appender.2618 *2619 * history:2620 * - stable: v0.2.92621 *2622 * @param appender2623 * @param value2624 * @return duckdb_state2625 */2626DUCKDB_C_API duckdb_state duckdb_append_timestamp(duckdb_appender appender, duckdb_timestamp value);2627#endif26282629#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9)2630/*!2631 * Append a duckdb_interval value to the appender.2632 *2633 * history:2634 * - stable: v0.2.92635 *2636 * @param appender2637 * @param value2638 * @return duckdb_state2639 */2640DUCKDB_C_API duckdb_state duckdb_append_interval(duckdb_appender appender, duckdb_interval value);2641#endif26422643#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5)2644/*!2645 * Append a varchar value to the appender.2646 *2647 * history:2648 * - stable: v0.2.52649 *2650 * @param appender2651 * @param val2652 * @return duckdb_state2653 */2654DUCKDB_C_API duckdb_state duckdb_append_varchar(duckdb_appender appender, const char *val);2655#endif26562657#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5)2658/*!2659 * Append a varchar value to the appender.2660 *2661 * history:2662 * - stable: v0.2.52663 *2664 * @param appender2665 * @param val2666 * @param length2667 * @return duckdb_state2668 */2669DUCKDB_C_API duckdb_state duckdb_append_varchar_length(duckdb_appender appender, const char *val, idx_t length);2670#endif26712672#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5)2673/*!2674 * Append a blob value to the appender.2675 *2676 * history:2677 * - stable: v0.2.52678 *2679 * @param appender2680 * @param data2681 * @param length2682 * @return duckdb_state2683 */2684DUCKDB_C_API duckdb_state duckdb_append_blob(duckdb_appender appender, const void *data, idx_t length);2685#endif26862687#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5)2688/*!2689 * Append a NULL value to the appender (of any type).2690 *2691 * history:2692 * - stable: v0.2.52693 *2694 * @param appender2695 * @return duckdb_state2696 */2697DUCKDB_C_API duckdb_state duckdb_append_null(duckdb_appender appender);2698#endif26992700#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)2701/*!2702 * Append a duckdb_value to the appender.2703 *2704 * history:2705 * - stable: v1.2.02706 *2707 * @param appender2708 * @param value2709 * @return duckdb_state2710 */2711DUCKDB_C_API duckdb_state duckdb_append_value(duckdb_appender appender, duckdb_value value);2712#endif27132714#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)2715/*!2716 * Appends a pre-filled data chunk to the specified appender. Attempts casting, if the data chunk types do not match the2717 * active appender types.2718 *2719 * history:2720 * - stable: v0.3.32721 *2722 * @param appender The appender to append to.2723 * @param chunk The data chunk to append.2724 * @return duckdb_state2725 */2726DUCKDB_C_API duckdb_state duckdb_append_data_chunk(duckdb_appender appender, duckdb_data_chunk chunk);2727#endif27282729#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9) && (DUCKDB_API_VERSION_BELOW(1, 4, 0) || DUCKDB_API_ALLOW_DEPRECATED)2730/*!2731 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release. Use duckdb_appender_error_data2732 * instead.2733 *2734 * Returns the error message associated with the appender. If the appender has no error message, this returns `nullptr`2735 * instead.2736 *2737 * The error message should not be freed. It will be de-allocated when `duckdb_appender_destroy` is called.2738 *2739 * history:2740 * - stable: v0.2.92741 * - deprecated: v1.4.02742 *2743 * @param appender The appender to get the error from.2744 * @return const char*2745 */2746DUCKDB_C_API const char *duckdb_appender_error(duckdb_appender appender);2747#endif27482749/* --- Struct definitions for appender --- */27502751/* ============================================================================2752 * MODULE: arrow2753 * ============================================================================ */27542755/* --- Enums for arrow --- */27562757/* --- Struct forward declarations for arrow --- */27582759/* --- Types for arrow --- */27602761/* --- Constants for arrow --- */27622763/* --- Function pointer typedefs for arrow --- */27642765/* --- Functions for arrow --- */27662767#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)2768/*!2769 * Transforms a DuckDB Schema into an Arrow Schema2770 *2771 * history:2772 * - unstable: v1.4.02773 * - stable: v1.5.62774 *2775 * @param arrow_options The Arrow settings used to produce arrow.2776 * @param types The DuckDB logical types for each column in the schema.2777 * @param names The names for each column in the schema.2778 * @param column_count The number of columns that exist in the schema.2779 * @param out_schema The resulting arrow schema. Must be destroyed with `out_schema->release(out_schema)`.2780 * @return duckdb_error_data2781 */2782DUCKDB_C_API duckdb_error_data duckdb_to_arrow_schema(duckdb_arrow_options arrow_options, duckdb_logical_type *types,2783                                                      const char **names, idx_t column_count,2784                                                      struct ArrowSchema *out_schema);2785#endif27862787#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)2788/*!2789 * Transforms a DuckDB data chunk into an Arrow array.2790 *2791 * history:2792 * - unstable: v1.4.02793 * - stable: v1.5.62794 *2795 * @param arrow_options The Arrow settings used to produce arrow.2796 * @param chunk The DuckDB data chunk to convert.2797 * @param out_arrow_array The output Arrow structure that will hold the converted data. Must be released with2798 * `out_arrow_array->release(out_arrow_array)`2799 * @return duckdb_error_data2800 */2801DUCKDB_C_API duckdb_error_data duckdb_data_chunk_to_arrow(duckdb_arrow_options arrow_options, duckdb_data_chunk chunk,2802                                                          struct ArrowArray *out_arrow_array);2803#endif28042805#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)2806/*!2807 * Transforms an Arrow Schema into a DuckDB Schema.2808 *2809 * history:2810 * - unstable: v1.4.02811 * - stable: v1.5.62812 *2813 * @param connection The connection to get the transformation settings from.2814 * @param schema The input Arrow schema. Must be released with `schema->release(schema)`.2815 * @param out_types The Arrow converted schema with extra information about the arrow types. Must be destroyed with2816 * `duckdb_destroy_arrow_converted_schema`.2817 * @return duckdb_error_data2818 */2819DUCKDB_C_API duckdb_error_data duckdb_schema_from_arrow(duckdb_connection connection, struct ArrowSchema *schema,2820                                                        duckdb_arrow_converted_schema *out_types);2821#endif28222823#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)2824/*!2825 * Transforms an Arrow array into a DuckDB data chunk. The data chunk will retain ownership of the underlying Arrow2826 * data.2827 *2828 * history:2829 * - unstable: v1.4.02830 * - stable: v1.5.62831 *2832 * @param connection The connection to get the transformation settings from.2833 * @param arrow_array The input Arrow array. Data ownership is passed on to DuckDB's DataChunk, the underlying object2834 * does not need to be released and won't have ownership of the data.2835 * @param converted_schema The Arrow converted schema with extra information about the arrow types.2836 * @param out_chunk The resulting DuckDB data chunk. Must be destroyed by duckdb_destroy_data_chunk.2837 * @return duckdb_error_data2838 */2839DUCKDB_C_API duckdb_error_data duckdb_data_chunk_from_arrow(duckdb_connection connection,2840                                                            struct ArrowArray *arrow_array,2841                                                            duckdb_arrow_converted_schema converted_schema,2842                                                            duckdb_data_chunk *out_chunk);2843#endif28442845#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)2846/*!2847 * Destroys the arrow converted schema and de-allocates all memory allocated for that arrow converted schema.2848 *2849 * history:2850 * - unstable: v1.4.02851 * - stable: v1.5.62852 *2853 * @param arrow_converted_schema The arrow converted schema to destroy.2854 * @return void2855 */2856DUCKDB_C_API void duckdb_destroy_arrow_converted_schema(duckdb_arrow_converted_schema *arrow_converted_schema);2857#endif28582859#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 8) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)2860/*!2861 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.2862 *2863 * Executes a SQL query within a connection and stores the full (materialized) result in an arrow structure. If the2864 * query fails to execute, DuckDBError is returned and the error message can be retrieved by calling2865 * `duckdb_query_arrow_error`.2866 *2867 * Note that after running `duckdb_query_arrow`, `duckdb_destroy_arrow` must be called on the result object even if the2868 * query fails, otherwise the error stored within the result will not be freed correctly.2869 *2870 * history:2871 * - stable: v0.2.82872 * - deprecated: v1.0.02873 *2874 * @param connection The connection to perform the query in.2875 * @param query The SQL query to run.2876 * @param out_result The query result.2877 * @return duckdb_state2878 */2879DUCKDB_C_API duckdb_state duckdb_query_arrow(duckdb_connection connection, const char *query, duckdb_arrow *out_result);2880#endif28812882#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 8) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)2883/*!2884 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.2885 *2886 * Fetch the internal arrow schema from the arrow result. Remember to call release on the respective ArrowSchema object.2887 *2888 * history:2889 * - stable: v0.2.82890 * - deprecated: v1.0.02891 *2892 * @param result The result to fetch the schema from.2893 * @param out_schema The output schema.2894 * @return duckdb_state2895 */2896DUCKDB_C_API duckdb_state duckdb_query_arrow_schema(duckdb_arrow result, duckdb_arrow_schema *out_schema);2897#endif28982899#if DUCKDB_API_VERSION_AT_LEAST(0, 9, 0) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)2900/*!2901 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.2902 *2903 * Fetch the internal arrow schema from the prepared statement. Remember to call release on the respective ArrowSchema2904 * object.2905 *2906 * history:2907 * - stable: v0.9.02908 * - deprecated: v1.0.02909 *2910 * @param prepared The prepared statement to fetch the schema from.2911 * @param out_schema The output schema.2912 * @return duckdb_state2913 */2914DUCKDB_C_API duckdb_state duckdb_prepared_arrow_schema(duckdb_prepared_statement prepared,2915                                                       duckdb_arrow_schema *out_schema);2916#endif29172918#if DUCKDB_API_VERSION_AT_LEAST(0, 10, 0) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)2919/*!2920 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.2921 *2922 * Convert a data chunk into an arrow struct array. Remember to call release on the respective ArrowArray object.2923 *2924 * history:2925 * - stable: v0.10.02926 * - deprecated: v1.0.02927 *2928 * @param result The result object the data chunk have been fetched from.2929 * @param chunk The data chunk to convert.2930 * @param out_array The output array.2931 * @return void2932 */2933DUCKDB_C_API void duckdb_result_arrow_array(duckdb_result result, duckdb_data_chunk chunk,2934                                            duckdb_arrow_array *out_array);2935#endif29362937#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 8) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)2938/*!2939 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.2940 *2941 * Fetch an internal arrow struct array from the arrow result. Remember to call release on the respective ArrowArray2942 * object.2943 *2944 * This function can be called multiple time to get next chunks, which will free the previous out_array. So consume the2945 * out_array before calling this function again.2946 *2947 * history:2948 * - stable: v0.2.82949 * - deprecated: v1.0.02950 *2951 * @param result The result to fetch the array from.2952 * @param out_array The output array.2953 * @return duckdb_state2954 */2955DUCKDB_C_API duckdb_state duckdb_query_arrow_array(duckdb_arrow result, duckdb_arrow_array *out_array);2956#endif29572958#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 8) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)2959/*!2960 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.2961 *2962 * Returns the number of columns present in the arrow result object.2963 *2964 * history:2965 * - stable: v0.2.82966 * - deprecated: v1.0.02967 *2968 * @param result The result object.2969 * @return idx_t2970 */2971DUCKDB_C_API idx_t duckdb_arrow_column_count(duckdb_arrow result);2972#endif29732974#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 8) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)2975/*!2976 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.2977 *2978 * Returns the number of rows present in the arrow result object.2979 *2980 * history:2981 * - stable: v0.2.82982 * - deprecated: v1.0.02983 *2984 * @param result The result object.2985 * @return idx_t2986 */2987DUCKDB_C_API idx_t duckdb_arrow_row_count(duckdb_arrow result);2988#endif29892990#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 8) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)2991/*!2992 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.2993 *2994 * Returns the number of rows changed by the query stored in the arrow result. This is relevant only for2995 * INSERT/UPDATE/DELETE queries. For other queries the rows_changed will be 0.2996 *2997 * history:2998 * - stable: v0.2.82999 * - deprecated: v1.0.03000 *3001 * @param result The result object.3002 * @return idx_t3003 */3004DUCKDB_C_API idx_t duckdb_arrow_rows_changed(duckdb_arrow result);3005#endif30063007#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 8) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)3008/*!3009 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.3010 *3011 *  Returns the error message contained within the result. The error is only set if `duckdb_query_arrow` returns3012 * `DuckDBError`.3013 *3014 * The error message should not be freed. It will be de-allocated when `duckdb_destroy_arrow` is called.3015 *3016 * history:3017 * - stable: v0.2.83018 * - deprecated: v1.0.03019 *3020 * @param result The result object to fetch the error from.3021 * @return const char*3022 */3023DUCKDB_C_API const char *duckdb_query_arrow_error(duckdb_arrow result);3024#endif30253026#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 8) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)3027/*!3028 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.3029 *3030 * Closes the result and de-allocates all memory allocated for the arrow result.3031 *3032 * history:3033 * - stable: v0.2.83034 * - deprecated: v1.0.03035 *3036 * @param result The result to destroy.3037 * @return void3038 */3039DUCKDB_C_API void duckdb_destroy_arrow(duckdb_arrow *result);3040#endif30413042#if DUCKDB_API_VERSION_AT_LEAST(0, 10, 0) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)3043/*!3044 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.3045 *3046 * Releases the arrow array stream and de-allocates its memory.3047 *3048 * history:3049 * - stable: v0.10.03050 * - deprecated: v1.0.03051 *3052 * @param stream_p The arrow array stream to destroy.3053 * @return void3054 */3055DUCKDB_C_API void duckdb_destroy_arrow_stream(duckdb_arrow_stream *stream_p);3056#endif30573058#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 8) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)3059/*!3060 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.3061 *3062 * Executes the prepared statement with the given bound parameters, and returns an arrow query result. Note that after3063 * running `duckdb_execute_prepared_arrow`, `duckdb_destroy_arrow` must be called on the result object.3064 *3065 * history:3066 * - stable: v0.2.83067 * - deprecated: v1.0.03068 *3069 * @param prepared_statement The prepared statement to execute.3070 * @param out_result The query result.3071 * @return duckdb_state3072 */3073DUCKDB_C_API duckdb_state duckdb_execute_prepared_arrow(duckdb_prepared_statement prepared_statement,3074                                                        duckdb_arrow *out_result);3075#endif30763077#if DUCKDB_API_VERSION_AT_LEAST(0, 9, 0) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)3078/*!3079 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.3080 *3081 * Scans the Arrow stream and creates a view with the given name.3082 *3083 * history:3084 * - stable: v0.9.03085 * - deprecated: v1.0.03086 *3087 * @param connection The connection on which to execute the scan.3088 * @param table_name Name of the temporary view to create.3089 * @param arrow Arrow stream wrapper.3090 * @return duckdb_state3091 */3092DUCKDB_C_API duckdb_state duckdb_arrow_scan(duckdb_connection connection, const char *table_name,3093                                            duckdb_arrow_stream arrow);3094#endif30953096#if DUCKDB_API_VERSION_AT_LEAST(0, 9, 0) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)3097/*!3098 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.3099 *3100 * Scans the Arrow array and creates a view with the given name. Note that after running `duckdb_arrow_array_scan`,3101 * `duckdb_destroy_arrow_stream` must be called on the out stream.3102 *3103 * history:3104 * - stable: v0.9.03105 * - deprecated: v1.0.03106 *3107 * @param connection The connection on which to execute the scan.3108 * @param table_name Name of the temporary view to create.3109 * @param arrow_schema Arrow schema wrapper.3110 * @param arrow_array Arrow array wrapper.3111 * @param out_stream Output array stream that wraps around the passed schema, for releasing/deleting once done.3112 * @return duckdb_state3113 */3114DUCKDB_C_API duckdb_state duckdb_arrow_array_scan(duckdb_connection connection, const char *table_name,3115                                                  duckdb_arrow_schema arrow_schema, duckdb_arrow_array arrow_array,3116                                                  duckdb_arrow_stream *out_stream);3117#endif31183119/* --- Struct definitions for arrow --- */31203121/* ============================================================================3122 * MODULE: cast_function3123 * ============================================================================ */31243125/* --- Enums for cast_function --- */31263127/* --- Struct forward declarations for cast_function --- */31283129/* --- Types for cast_function --- */31303131/* --- Constants for cast_function --- */31323133/* --- Function pointer typedefs for cast_function --- */31343135/* --- Functions for cast_function --- */31363137#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)3138/*!3139 * Creates a new cast function object.3140 *3141 * history:3142 * - stable: v1.1.03143 *3144 * @return duckdb_cast_function3145 */3146DUCKDB_C_API duckdb_cast_function duckdb_create_cast_function(void);3147#endif31483149#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)3150/*!3151 * Sets the source type of the cast function.3152 *3153 * history:3154 * - stable: v1.1.03155 *3156 * @param cast_function The cast function object.3157 * @param source_type The source type to set.3158 * @return void3159 */3160DUCKDB_C_API void duckdb_cast_function_set_source_type(duckdb_cast_function cast_function,3161                                                       duckdb_logical_type source_type);3162#endif31633164#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)3165/*!3166 * Sets the target type of the cast function.3167 *3168 * history:3169 * - stable: v1.1.03170 *3171 * @param cast_function The cast function object.3172 * @param target_type The target type to set.3173 * @return void3174 */3175DUCKDB_C_API void duckdb_cast_function_set_target_type(duckdb_cast_function cast_function,3176                                                       duckdb_logical_type target_type);3177#endif31783179#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)3180/*!3181 * Sets the "cost" of implicitly casting the source type to the target type using this function.3182 *3183 * history:3184 * - stable: v1.1.03185 *3186 * @param cast_function The cast function object.3187 * @param cost The cost to set.3188 * @return void3189 */3190DUCKDB_C_API void duckdb_cast_function_set_implicit_cast_cost(duckdb_cast_function cast_function, int64_t cost);3191#endif31923193#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)3194/*!3195 * Sets the actual cast function to use.3196 *3197 * history:3198 * - stable: v1.1.03199 *3200 * @param cast_function The cast function object.3201 * @param function The function to set.3202 * @return void3203 */3204DUCKDB_C_API void duckdb_cast_function_set_function(duckdb_cast_function cast_function,3205                                                    duckdb_cast_function_t function);3206#endif32073208#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)3209/*!3210 * Assigns extra information to the cast function that can be fetched during execution, etc.3211 *3212 * history:3213 * - stable: v1.1.03214 *3215 * @param cast_function3216 * @param extra_info The extra information3217 * @param destroy The callback that will be called to destroy the extra information (if any)3218 * @return void3219 */3220DUCKDB_C_API void duckdb_cast_function_set_extra_info(duckdb_cast_function cast_function, void *extra_info,3221                                                      duckdb_delete_callback_t destroy);3222#endif32233224#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)3225/*!3226 * Retrieves the extra info of the function as set in `duckdb_cast_function_set_extra_info`.3227 *3228 * history:3229 * - stable: v1.1.03230 *3231 * @param info The info object.3232 * @return void*3233 */3234DUCKDB_C_API void *duckdb_cast_function_get_extra_info(duckdb_function_info info);3235#endif32363237#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)3238/*!3239 * Get the cast execution mode from the given function info.3240 *3241 * history:3242 * - stable: v1.1.03243 *3244 * @param info The info object.3245 * @return duckdb_cast_mode3246 */3247DUCKDB_C_API duckdb_cast_mode duckdb_cast_function_get_cast_mode(duckdb_function_info info);3248#endif32493250#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)3251/*!3252 * Report that an error has occurred while executing the cast function.3253 *3254 * history:3255 * - stable: v1.1.03256 *3257 * @param info The info object.3258 * @param error The error message.3259 * @return void3260 */3261DUCKDB_C_API void duckdb_cast_function_set_error(duckdb_function_info info, const char *error);3262#endif32633264#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)3265/*!3266 * Report that an error has occurred while executing the cast function, setting the corresponding output row to NULL.3267 *3268 * history:3269 * - stable: v1.1.03270 *3271 * @param info The info object.3272 * @param error The error message.3273 * @param row The index of the row within the output vector to set to NULL.3274 * @param output The output vector.3275 * @return void3276 */3277DUCKDB_C_API void duckdb_cast_function_set_row_error(duckdb_function_info info, const char *error, idx_t row,3278                                                     duckdb_vector output);3279#endif32803281#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)3282/*!3283 * Registers a cast function within the given connection.3284 *3285 * history:3286 * - stable: v1.1.03287 *3288 * @param con The connection to use.3289 * @param cast_function The cast function to register.3290 * @return duckdb_state3291 */3292DUCKDB_C_API duckdb_state duckdb_register_cast_function(duckdb_connection con, duckdb_cast_function cast_function);3293#endif32943295#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)3296/*!3297 * Destroys the cast function object.3298 *3299 * history:3300 * - stable: v1.1.03301 *3302 * @param cast_function The cast function object.3303 * @return void3304 */3305DUCKDB_C_API void duckdb_destroy_cast_function(duckdb_cast_function *cast_function);3306#endif33073308/* --- Struct definitions for cast_function --- */33093310/* ============================================================================3311 * MODULE: catalog3312 * ============================================================================ */33133314/* --- Enums for catalog --- */33153316/* --- Struct forward declarations for catalog --- */33173318/* --- Types for catalog --- */33193320/* --- Constants for catalog --- */33213322/* --- Function pointer typedefs for catalog --- */33233324/* --- Functions for catalog --- */33253326#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3327/*!3328 * Retrieve a database catalog instance by name. This function can only be called from within the context of an active3329 * transaction, e.g. during execution of a registered function callback. Otherwise returns `nullptr`.3330 *3331 * history:3332 * - unstable: v1.5.03333 * - stable: v1.5.63334 *3335 * @param context The client context.3336 * @param catalog_name The name of the catalog.3337 * @return duckdb_catalog3338 */3339DUCKDB_C_API duckdb_catalog duckdb_client_context_get_catalog(duckdb_client_context context, const char *catalog_name);3340#endif33413342#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3343/*!3344 * Retrieve the "type name" of the given catalog. E.g. for a DuckDB database, this returns 'duckdb'. The returned string3345 * is owned by the catalog and remains valid until the catalog is destroyed.3346 *3347 * history:3348 * - unstable: v1.5.03349 * - stable: v1.5.63350 *3351 * @param catalog The catalog.3352 * @return const char*3353 */3354DUCKDB_C_API const char *duckdb_catalog_get_type_name(duckdb_catalog catalog);3355#endif33563357#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3358/*!3359 * Retrieve a catalog entry from the given catalog by type, schema name and entry name. The returned catalog entry3360 * remains valid for the duration of the current transaction.3361 *3362 * history:3363 * - unstable: v1.5.03364 * - stable: v1.5.63365 *3366 * @param catalog The catalog.3367 * @param context The client context.3368 * @param entry_type The type of the catalog entry to retrieve.3369 * @param schema_name The schema name of the catalog entry.3370 * @param entry_name The name of the catalog entry.3371 * @return duckdb_catalog_entry3372 */3373DUCKDB_C_API duckdb_catalog_entry duckdb_catalog_get_entry(duckdb_catalog catalog, duckdb_client_context context,3374                                                           duckdb_catalog_entry_type entry_type,3375                                                           const char *schema_name, const char *entry_name);3376#endif33773378#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3379/*!3380 * Destroys the given catalog instance.3381 *3382 * Note that this does not actually "drop" the contents of the catalog; it merely frees the C API handle.3383 *3384 * history:3385 * - unstable: v1.5.03386 * - stable: v1.5.63387 *3388 * @param catalog The catalog instance to destroy.3389 * @return void3390 */3391DUCKDB_C_API void duckdb_destroy_catalog(duckdb_catalog *catalog);3392#endif33933394#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3395/*!3396 * Get the type of the given catalog entry.3397 *3398 * history:3399 * - unstable: v1.5.03400 * - stable: v1.5.63401 *3402 * @param entry The catalog entry.3403 * @return duckdb_catalog_entry_type3404 */3405DUCKDB_C_API duckdb_catalog_entry_type duckdb_catalog_entry_get_type(duckdb_catalog_entry entry);3406#endif34073408#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3409/*!3410 * Get the name of the given catalog entry.3411 *3412 * history:3413 * - unstable: v1.5.03414 * - stable: v1.5.63415 *3416 * @param entry The catalog entry.3417 * @return const char*3418 */3419DUCKDB_C_API const char *duckdb_catalog_entry_get_name(duckdb_catalog_entry entry);3420#endif34213422#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3423/*!3424 * Destroys the given catalog entry instance.3425 *3426 * Note that this does not actually "drop" the catalog entry from the database catalog; it merely frees the C API3427 * handle.3428 *3429 * history:3430 * - unstable: v1.5.03431 * - stable: v1.5.63432 *3433 * @param entry The catalog entry instance to destroy.3434 * @return void3435 */3436DUCKDB_C_API void duckdb_destroy_catalog_entry(duckdb_catalog_entry *entry);3437#endif34383439/* --- Struct definitions for catalog --- */34403441/* ============================================================================3442 * MODULE: config_option3443 * ============================================================================ */34443445/* --- Enums for config_option --- */34463447/* --- Struct forward declarations for config_option --- */34483449/* --- Types for config_option --- */34503451/* --- Constants for config_option --- */34523453/* --- Function pointer typedefs for config_option --- */34543455/* --- Functions for config_option --- */34563457#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3458/*!3459 * Creates a configuration option instance.3460 *3461 * history:3462 * - unstable: v1.5.03463 * - stable: v1.5.63464 *3465 * @return duckdb_config_option3466 */3467DUCKDB_C_API duckdb_config_option duckdb_create_config_option(void);3468#endif34693470#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3471/*!3472 * Destroys the given configuration option instance.3473 *3474 * history:3475 * - unstable: v1.5.03476 * - stable: v1.5.63477 *3478 * @param option The configuration option instance to destroy.3479 * @return void3480 */3481DUCKDB_C_API void duckdb_destroy_config_option(duckdb_config_option *option);3482#endif34833484#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3485/*!3486 * Sets the name of the configuration option.3487 *3488 * history:3489 * - unstable: v1.5.03490 * - stable: v1.5.63491 *3492 * @param option The configuration option instance.3493 * @param name The name to set.3494 * @return void3495 */3496DUCKDB_C_API void duckdb_config_option_set_name(duckdb_config_option option, const char *name);3497#endif34983499#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3500/*!3501 * Sets the type of the configuration option.3502 *3503 * history:3504 * - unstable: v1.5.03505 * - stable: v1.5.63506 *3507 * @param option The configuration option instance.3508 * @param type The type to set.3509 * @return void3510 */3511DUCKDB_C_API void duckdb_config_option_set_type(duckdb_config_option option, duckdb_logical_type type);3512#endif35133514#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3515/*!3516 * Sets the default value of the configuration option. If the type of this option has already been set with3517 * `duckdb_config_option_set_type`, the value is cast to the type. Otherwise, the type is inferred from the value.3518 *3519 * history:3520 * - unstable: v1.5.03521 * - stable: v1.5.63522 *3523 * @param option The configuration option instance.3524 * @param default_value The default value to set.3525 * @return void3526 */3527DUCKDB_C_API void duckdb_config_option_set_default_value(duckdb_config_option option, duckdb_value default_value);3528#endif35293530#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3531/*!3532 * Sets the default scope of the configuration option. If not set, this defaults to3533 * `DUCKDB_CONFIG_OPTION_SCOPE_SESSION`.3534 *3535 * history:3536 * - unstable: v1.5.03537 * - stable: v1.5.63538 *3539 * @param option The configuration option instance.3540 * @param default_scope The default scope to set.3541 * @return void3542 */3543DUCKDB_C_API void duckdb_config_option_set_default_scope(duckdb_config_option option,3544                                                         duckdb_config_option_scope default_scope);3545#endif35463547#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3548/*!3549 * Sets the description of the configuration option.3550 *3551 * history:3552 * - unstable: v1.5.03553 * - stable: v1.5.63554 *3555 * @param option The configuration option instance.3556 * @param description The description to set.3557 * @return void3558 */3559DUCKDB_C_API void duckdb_config_option_set_description(duckdb_config_option option, const char *description);3560#endif35613562#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3563/*!3564 * Registers the given configuration option on the specified connection.3565 *3566 * history:3567 * - unstable: v1.5.03568 * - stable: v1.5.63569 *3570 * @param connection The connection to register the option on.3571 * @param option The configuration option instance to register.3572 * @return duckdb_state3573 */3574DUCKDB_C_API duckdb_state duckdb_register_config_option(duckdb_connection connection, duckdb_config_option option);3575#endif35763577#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3578/*!3579 * Retrieves the value of a configuration option by name from the given client context.3580 *3581 * history:3582 * - unstable: v1.5.03583 * - stable: v1.5.63584 *3585 * @param context The client context.3586 * @param name The name of the configuration option to retrieve.3587 * @param out_scope Output parameter to optionally store the scope that the configuration option was retrieved from. If3588 * this is `nullptr`, the scope is not returned. If the requested option does not exist the scope is set to3589 * `DUCKDB_CONFIG_OPTION_SCOPE_INVALID`.3590 * @return duckdb_value3591 */3592DUCKDB_C_API duckdb_value duckdb_client_context_get_config_option(duckdb_client_context context, const char *name,3593                                                                  duckdb_config_option_scope *out_scope);3594#endif35953596#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)3597/*!3598 * Returns the root node of the profiling information. Returns nullptr, if profiling is not enabled.3599 *3600 * history:3601 * - stable: v1.1.03602 *3603 * @param connection A connection object.3604 * @return duckdb_profiling_info3605 */3606DUCKDB_C_API duckdb_profiling_info duckdb_get_profiling_info(duckdb_connection connection);3607#endif36083609#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)3610/*!3611 * Returns the value of the metric of the current profiling info node. Returns nullptr, if the metric does not exist or3612 * is not enabled. Currently, the value holds a string, and you can retrieve the string by calling the corresponding3613 * function: char *duckdb_get_varchar(duckdb_value value).3614 *3615 * history:3616 * - stable: v1.1.03617 *3618 * @param info A profiling information object.3619 * @param key The name of the requested metric.3620 * @return duckdb_value3621 */3622DUCKDB_C_API duckdb_value duckdb_profiling_info_get_value(duckdb_profiling_info info, const char *key);3623#endif36243625#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)3626/*!3627 * Returns the key-value metric map of this profiling node as a MAP duckdb_value. The individual elements are accessible3628 * via the duckdb_value MAP functions.3629 *3630 * history:3631 * - stable: v1.1.03632 *3633 * @param info A profiling information object.3634 * @return duckdb_value3635 */3636DUCKDB_C_API duckdb_value duckdb_profiling_info_get_metrics(duckdb_profiling_info info);3637#endif36383639#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)3640/*!3641 * Returns the number of children in the current profiling info node.3642 *3643 * history:3644 * - stable: v1.1.03645 *3646 * @param info A profiling information object.3647 * @return idx_t3648 */3649DUCKDB_C_API idx_t duckdb_profiling_info_get_child_count(duckdb_profiling_info info);3650#endif36513652#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)3653/*!3654 * Returns the child node at the specified index.3655 *3656 * history:3657 * - stable: v1.1.03658 *3659 * @param info A profiling information object.3660 * @param index The index of the child node.3661 * @return duckdb_profiling_info3662 */3663DUCKDB_C_API duckdb_profiling_info duckdb_profiling_info_get_child(duckdb_profiling_info info, idx_t index);3664#endif36653666/* --- Struct definitions for config_option --- */36673668/* ============================================================================3669 * MODULE: connection3670 * ============================================================================ */36713672/* --- Enums for connection --- */36733674/* --- Struct forward declarations for connection --- */36753676/* --- Types for connection --- */36773678/* --- Constants for connection --- */36793680/* --- Function pointer typedefs for connection --- */36813682/* --- Functions for connection --- */36833684/*!3685 * Opens a connection to a database. Connections are required to query the database, and store transactional state3686 * associated with the connection. The instantiated connection should be closed using 'duckdb_disconnect'.3687 *3688 * history:3689 * - stable: v0.1.03690 *3691 * @param database The database file to connect to.3692 * @param out_connection The result connection object.3693 * @return duckdb_state3694 */3695DUCKDB_C_API duckdb_state duckdb_connect(duckdb_database database, duckdb_connection *out_connection);36963697#if DUCKDB_API_VERSION_AT_LEAST(0, 9, 0)3698/*!3699 * Interrupt running query3700 *3701 * history:3702 * - stable: v0.9.03703 *3704 * @param connection The connection to interrupt3705 * @return void3706 */3707DUCKDB_C_API void duckdb_interrupt(duckdb_connection connection);3708#endif37093710#if DUCKDB_API_VERSION_AT_LEAST(0, 10, 0)3711/*!3712 * Get the progress of the running query.3713 *3714 * history:3715 * - stable: v0.10.03716 *3717 * @param connection The connection running the query.3718 * @return duckdb_query_progress_type3719 */3720DUCKDB_C_API duckdb_query_progress_type duckdb_query_progress(duckdb_connection connection);3721#endif37223723/*!3724 * Closes the specified connection and de-allocates all memory allocated for that connection.3725 *3726 * history:3727 * - stable: v0.1.03728 *3729 * @param connection The connection to close.3730 * @return void3731 */3732DUCKDB_C_API void duckdb_disconnect(duckdb_connection *connection);37333734#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3735/*!3736 * Retrieves the client context of the connection.3737 *3738 * history:3739 * - unstable: v1.3.03740 * - stable: v1.5.63741 *3742 * @param connection The connection.3743 * @param out_context The client context of the connection. Must be destroyed with `duckdb_destroy_client_context`.3744 * @return void3745 */3746DUCKDB_C_API void duckdb_connection_get_client_context(duckdb_connection connection,3747                                                       duckdb_client_context *out_context);3748#endif37493750#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3751/*!3752 * Retrieves the arrow options of the connection.3753 *3754 * history:3755 * - unstable: v1.4.03756 * - stable: v1.5.63757 *3758 * @param connection The connection.3759 * @param out_arrow_options3760 * @return void3761 */3762DUCKDB_C_API void duckdb_connection_get_arrow_options(duckdb_connection connection,3763                                                      duckdb_arrow_options *out_arrow_options);3764#endif37653766#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3767/*!3768 * Returns the connection id of the client context.3769 *3770 * history:3771 * - unstable: v1.3.03772 * - stable: v1.5.63773 *3774 * @param context The client context.3775 * @return idx_t3776 */3777DUCKDB_C_API idx_t duckdb_client_context_get_connection_id(duckdb_client_context context);3778#endif37793780#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3781/*!3782 * Destroys the client context and deallocates its memory.3783 *3784 * history:3785 * - unstable: v1.3.03786 * - stable: v1.5.63787 *3788 * @param context The client context to destroy.3789 * @return void3790 */3791DUCKDB_C_API void duckdb_destroy_client_context(duckdb_client_context *context);3792#endif37933794#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3795/*!3796 * Destroys the arrow options and deallocates its memory.3797 *3798 * history:3799 * - unstable: v1.4.03800 * - stable: v1.5.63801 *3802 * @param arrow_options The arrow options to destroy.3803 * @return void3804 */3805DUCKDB_C_API void duckdb_destroy_arrow_options(duckdb_arrow_options *arrow_options);3806#endif38073808#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3809/*!3810 * Get the list of (fully qualified) table names of the query.3811 *3812 * history:3813 * - unstable: v1.3.03814 * - stable: v1.5.63815 *3816 * @param connection The connection for which to get the table names.3817 * @param query The query for which to get the table names.3818 * @param qualified Returns fully qualified table names (catalog.schema.table), if set to true, else only the (not3819 * escaped) table names.3820 * @return duckdb_value3821 */3822DUCKDB_C_API duckdb_value duckdb_get_table_names(duckdb_connection connection, const char *query, bool qualified);3823#endif38243825/* --- Struct definitions for connection --- */38263827/* ============================================================================3828 * MODULE: copy_function3829 * ============================================================================ */38303831/* --- Enums for copy_function --- */38323833/* --- Struct forward declarations for copy_function --- */38343835/* --- Types for copy_function --- */38363837/* --- Constants for copy_function --- */38383839/* --- Function pointer typedefs for copy_function --- */38403841/* --- Functions for copy_function --- */38423843#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3844/*!3845 * Creates a new empty copy function.3846 *3847 * The return value must be destroyed with `duckdb_destroy_copy_function`.3848 *3849 * history:3850 * - unstable: v1.5.03851 * - stable: v1.5.63852 *3853 * @return duckdb_copy_function3854 */3855DUCKDB_C_API duckdb_copy_function duckdb_create_copy_function(void);3856#endif38573858#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3859/*!3860 * Sets the name of the copy function.3861 *3862 * history:3863 * - unstable: v1.5.03864 * - stable: v1.5.63865 *3866 * @param copy_function The copy function3867 * @param name The name to set3868 * @return void3869 */3870DUCKDB_C_API void duckdb_copy_function_set_name(duckdb_copy_function copy_function, const char *name);3871#endif38723873#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3874/*!3875 * Sets the extra info pointer of the copy function, which can be used to store arbitrary data.3876 *3877 * history:3878 * - unstable: v1.5.03879 * - stable: v1.5.63880 *3881 * @param copy_function The copy function3882 * @param extra_info The extra info pointer3883 * @param destructor A destructor function to call to destroy the extra info3884 * @return void3885 */3886DUCKDB_C_API void duckdb_copy_function_set_extra_info(duckdb_copy_function copy_function, void *extra_info,3887                                                      duckdb_delete_callback_t destructor);3888#endif38893890#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3891/*!3892 * Registers the given copy function on the database connection under the specified name.3893 *3894 * history:3895 * - unstable: v1.5.03896 * - stable: v1.5.63897 *3898 * @param connection The database connection3899 * @param copy_function The copy function to register3900 * @return duckdb_state3901 */3902DUCKDB_C_API duckdb_state duckdb_register_copy_function(duckdb_connection connection,3903                                                        duckdb_copy_function copy_function);3904#endif39053906#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3907/*!3908 * Destroys the given copy function object.3909 *3910 * history:3911 * - unstable: v1.5.03912 * - stable: v1.5.63913 *3914 * @param copy_function The copy function to destroy.3915 * @return void3916 */3917DUCKDB_C_API void duckdb_destroy_copy_function(duckdb_copy_function *copy_function);3918#endif39193920#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3921/*!3922 * Sets the bind function of the copy function, to use when binding `COPY ... TO`.3923 *3924 * history:3925 * - unstable: v1.5.03926 * - stable: v1.5.63927 *3928 * @param copy_function3929 * @param bind The bind function3930 * @return void3931 */3932DUCKDB_C_API void duckdb_copy_function_set_bind(duckdb_copy_function copy_function, duckdb_copy_function_bind_t bind);3933#endif39343935#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3936/*!3937 * Report that an error occurred during the binding-phase of a `COPY ... TO` function.3938 *3939 * history:3940 * - unstable: v1.5.03941 * - stable: v1.5.63942 *3943 * @param info The bind info provided to the bind function3944 * @param error The error message3945 * @return void3946 */3947DUCKDB_C_API void duckdb_copy_function_bind_set_error(duckdb_copy_function_bind_info info, const char *error);3948#endif39493950#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3951/*!3952 * Retrieves the extra info pointer of the copy function.3953 *3954 * history:3955 * - unstable: v1.5.03956 * - stable: v1.5.63957 *3958 * @param info The bind info provided to the bind function3959 * @return void*3960 */3961DUCKDB_C_API void *duckdb_copy_function_bind_get_extra_info(duckdb_copy_function_bind_info info);3962#endif39633964#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3965/*!3966 * Retrieves the client context of the current connection binding the `COPY ... TO` function.3967 *3968 * Must be destroyed with `duckdb_destroy_client_context`3969 *3970 * history:3971 * - unstable: v1.5.03972 * - stable: v1.5.63973 *3974 * @param info The bind info provided to the bind function3975 * @return duckdb_client_context3976 */3977DUCKDB_C_API duckdb_client_context duckdb_copy_function_bind_get_client_context(duckdb_copy_function_bind_info info);3978#endif39793980#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3981/*!3982 * Retrieves the number of columns that will be provided to the `COPY ... TO` function.3983 *3984 * history:3985 * - unstable: v1.5.03986 * - stable: v1.5.63987 *3988 * @param info The bind info provided to the bind function3989 * @return idx_t3990 */3991DUCKDB_C_API idx_t duckdb_copy_function_bind_get_column_count(duckdb_copy_function_bind_info info);3992#endif39933994#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)3995/*!3996 * Retrieves the type of a column that will be provided to the `COPY ... TO` function.3997 *3998 * history:3999 * - unstable: v1.5.04000 * - stable: v1.5.64001 *4002 * @param info The bind info provided to the bind function4003 * @param col_idx The index of the column to retrieve the type for4004 * @return duckdb_logical_type4005 */4006DUCKDB_C_API duckdb_logical_type duckdb_copy_function_bind_get_column_type(duckdb_copy_function_bind_info info,4007                                                                           idx_t col_idx);4008#endif40094010#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4011/*!4012 * Retrieves all values for the given options provided to the `COPY ... TO` function.4013 *4014 * history:4015 * - unstable: v1.5.04016 * - stable: v1.5.64017 *4018 * @param info The bind info provided to the bind function4019 * @return duckdb_value4020 */4021DUCKDB_C_API duckdb_value duckdb_copy_function_bind_get_options(duckdb_copy_function_bind_info info);4022#endif40234024#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4025/*!4026 * Sets the bind data of the copy function, to be provided to the init, sink and finalize functions.4027 *4028 * history:4029 * - unstable: v1.5.04030 * - stable: v1.5.64031 *4032 * @param info The bind info provided to the bind function4033 * @param bind_data The bind data pointer4034 * @param destructor A destructor function to call to destroy the bind data4035 * @return void4036 */4037DUCKDB_C_API void duckdb_copy_function_bind_set_bind_data(duckdb_copy_function_bind_info info, void *bind_data,4038                                                          duckdb_delete_callback_t destructor);4039#endif40404041#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4042/*!4043 * Sets the initialization function of the copy function, called right before executing `COPY ... TO`.4044 *4045 * history:4046 * - unstable: v1.5.04047 * - stable: v1.5.64048 *4049 * @param copy_function4050 * @param init The init function4051 * @return void4052 */4053DUCKDB_C_API void duckdb_copy_function_set_global_init(duckdb_copy_function copy_function,4054                                                       duckdb_copy_function_global_init_t init);4055#endif40564057#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4058/*!4059 * Report that an error occurred during the initialization-phase of a `COPY ... TO` function.4060 *4061 * history:4062 * - unstable: v1.5.04063 * - stable: v1.5.64064 *4065 * @param info The init info provided to the init function4066 * @param error The error message4067 * @return void4068 */4069DUCKDB_C_API void duckdb_copy_function_global_init_set_error(duckdb_copy_function_global_init_info info,4070                                                             const char *error);4071#endif40724073#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4074/*!4075 * Retrieves the extra info pointer of the copy function.4076 *4077 * history:4078 * - unstable: v1.5.04079 * - stable: v1.5.64080 *4081 * @param info The init info provided to the init function4082 * @return void*4083 */4084DUCKDB_C_API void *duckdb_copy_function_global_init_get_extra_info(duckdb_copy_function_global_init_info info);4085#endif40864087#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4088/*!4089 * Retrieves the client context of the current connection initializing the `COPY ... TO` function.4090 *4091 * Must be destroyed with `duckdb_destroy_client_context`4092 *4093 * history:4094 * - unstable: v1.5.04095 * - stable: v1.5.64096 *4097 * @param info The init info provided to the init function4098 * @return duckdb_client_context4099 */4100DUCKDB_C_API duckdb_client_context4101duckdb_copy_function_global_init_get_client_context(duckdb_copy_function_global_init_info info);4102#endif41034104#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4105/*!4106 * Retrieves the bind data provided during the binding-phase of a `COPY ... TO` function.4107 *4108 * history:4109 * - unstable: v1.5.04110 * - stable: v1.5.64111 *4112 * @param info The init info provided to the init function4113 * @return void*4114 */4115DUCKDB_C_API void *duckdb_copy_function_global_init_get_bind_data(duckdb_copy_function_global_init_info info);4116#endif41174118#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4119/*!4120 * Retrieves the file path provided to the `COPY ... TO` function.4121 *4122 * Lives for the duration of the initialization callback, must not be destroyed.4123 *4124 * history:4125 * - unstable: v1.5.04126 * - stable: v1.5.64127 *4128 * @param info The init info provided to the init function4129 * @return const char*4130 */4131DUCKDB_C_API const char *duckdb_copy_function_global_init_get_file_path(duckdb_copy_function_global_init_info info);4132#endif41334134#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4135/*!4136 * Sets the global state of the copy function, to be provided to all subsequent local init, sink and finalize functions.4137 *4138 * history:4139 * - unstable: v1.5.04140 * - stable: v1.5.64141 *4142 * @param info The init info provided to the init function4143 * @param global_state The global state pointer4144 * @param destructor A destructor function to call to destroy the global state4145 * @return void4146 */4147DUCKDB_C_API void duckdb_copy_function_global_init_set_global_state(duckdb_copy_function_global_init_info info,4148                                                                    void *global_state,4149                                                                    duckdb_delete_callback_t destructor);4150#endif41514152#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4153/*!4154 * Sets the sink function of the copy function, called during `COPY ... TO`.4155 *4156 * history:4157 * - unstable: v1.5.04158 * - stable: v1.5.64159 *4160 * @param copy_function4161 * @param function The sink function4162 * @return void4163 */4164DUCKDB_C_API void duckdb_copy_function_set_sink(duckdb_copy_function copy_function,4165                                                duckdb_copy_function_sink_t function);4166#endif41674168#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4169/*!4170 * Report that an error occurred during the sink-phase of a `COPY ... TO` function.4171 *4172 * history:4173 * - unstable: v1.5.04174 * - stable: v1.5.64175 *4176 * @param info The sink info provided to the sink function4177 * @param error The error message4178 * @return void4179 */4180DUCKDB_C_API void duckdb_copy_function_sink_set_error(duckdb_copy_function_sink_info info, const char *error);4181#endif41824183#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4184/*!4185 * Retrieves the extra info pointer of the copy function.4186 *4187 * history:4188 * - unstable: v1.5.04189 * - stable: v1.5.64190 *4191 * @param info The sink info provided to the sink function4192 * @return void*4193 */4194DUCKDB_C_API void *duckdb_copy_function_sink_get_extra_info(duckdb_copy_function_sink_info info);4195#endif41964197#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4198/*!4199 * Retrieves the client context of the current connection during the sink-phase of the `COPY ... TO` function.4200 *4201 * Must be destroyed with `duckdb_destroy_client_context`4202 *4203 * history:4204 * - unstable: v1.5.04205 * - stable: v1.5.64206 *4207 * @param info The sink info provided to the sink function4208 * @return duckdb_client_context4209 */4210DUCKDB_C_API duckdb_client_context duckdb_copy_function_sink_get_client_context(duckdb_copy_function_sink_info info);4211#endif42124213#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4214/*!4215 * Retrieves the bind data provided during the binding-phase of a `COPY ... TO` function.4216 *4217 * history:4218 * - unstable: v1.5.04219 * - stable: v1.5.64220 *4221 * @param info The sink info provided to the sink function4222 * @return void*4223 */4224DUCKDB_C_API void *duckdb_copy_function_sink_get_bind_data(duckdb_copy_function_sink_info info);4225#endif42264227#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4228/*!4229 * Retrieves the global state provided during the init-phase of a `COPY ... TO` function.4230 *4231 * history:4232 * - unstable: v1.5.04233 * - stable: v1.5.64234 *4235 * @param info The sink info provided to the sink function4236 * @return void*4237 */4238DUCKDB_C_API void *duckdb_copy_function_sink_get_global_state(duckdb_copy_function_sink_info info);4239#endif42404241#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4242/*!4243 * Sets the finalize function of the copy function, called at the end of `COPY ... TO`.4244 *4245 * history:4246 * - unstable: v1.5.04247 * - stable: v1.5.64248 *4249 * @param copy_function4250 * @param finalize The finalize function4251 * @return void4252 */4253DUCKDB_C_API void duckdb_copy_function_set_finalize(duckdb_copy_function copy_function,4254                                                    duckdb_copy_function_finalize_t finalize);4255#endif42564257#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4258/*!4259 * Report that an error occurred during the finalize-phase of a `COPY ... TO` function4260 *4261 * history:4262 * - unstable: v1.5.04263 * - stable: v1.5.64264 *4265 * @param info The finalize info provided to the finalize function4266 * @param error The error message4267 * @return void4268 */4269DUCKDB_C_API void duckdb_copy_function_finalize_set_error(duckdb_copy_function_finalize_info info, const char *error);4270#endif42714272#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4273/*!4274 * Retrieves the extra info pointer of the copy function.4275 *4276 * history:4277 * - unstable: v1.5.04278 * - stable: v1.5.64279 *4280 * @param info The finalize info provided to the finalize function4281 * @return void*4282 */4283DUCKDB_C_API void *duckdb_copy_function_finalize_get_extra_info(duckdb_copy_function_finalize_info info);4284#endif42854286#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4287/*!4288 * Retrieves the client context of the current connection during the finalize-phase of the `COPY ... TO` function.4289 *4290 * Must be destroyed with `duckdb_destroy_client_context`4291 *4292 * history:4293 * - unstable: v1.5.04294 * - stable: v1.5.64295 *4296 * @param info The finalize info provided to the finalize function4297 * @return duckdb_client_context4298 */4299DUCKDB_C_API duckdb_client_context4300duckdb_copy_function_finalize_get_client_context(duckdb_copy_function_finalize_info info);4301#endif43024303#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4304/*!4305 * Retrieves the bind data provided during the binding-phase of a `COPY ... TO` function.4306 *4307 * history:4308 * - unstable: v1.5.04309 * - stable: v1.5.64310 *4311 * @param info The finalize info provided to the finalize function4312 * @return void*4313 */4314DUCKDB_C_API void *duckdb_copy_function_finalize_get_bind_data(duckdb_copy_function_finalize_info info);4315#endif43164317#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4318/*!4319 * Retrieves the global state provided during the init-phase of a `COPY ... TO` function.4320 *4321 * history:4322 * - unstable: v1.5.04323 * - stable: v1.5.64324 *4325 * @param info The finalize info provided to the finalize function4326 * @return void*4327 */4328DUCKDB_C_API void *duckdb_copy_function_finalize_get_global_state(duckdb_copy_function_finalize_info info);4329#endif43304331#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4332/*!4333 * Sets the table function to use when executing a `COPY ... FROM (...)` statement with this copy function.4334 *4335 * The table function must have a `duckdb_table_function_bind_t`, `duckdb_table_function_init_t` and4336 * `duckdb_table_function_t` set.4337 *4338 * The table function must take a single VARCHAR parameter (the file path).4339 *4340 * Options passed to the `COPY ... FROM (...)` statement are forwarded as named parameters to the table function.4341 *4342 * Since `COPY ... FROM` copies into an already existing table, the table function should not define its own result4343 * columns using `duckdb_bind_add_result_column` when binding . Instead use4344 * `duckdb_table_function_bind_get_result_column_count` and related functions in the bind callback of the table function4345 * to retrieve the schema of the target table of the `COPY ... FROM` statement.4346 *4347 * history:4348 * - unstable: v1.5.04349 * - stable: v1.5.64350 *4351 * @param copy_function The copy function4352 * @param table_function The table function to use for `COPY ... FROM`4353 * @return void4354 */4355DUCKDB_C_API void duckdb_copy_function_set_copy_from_function(duckdb_copy_function copy_function,4356                                                              duckdb_table_function table_function);4357#endif43584359/* --- Struct definitions for copy_function --- */43604361/* ============================================================================4362 * MODULE: data_chunk4363 * ============================================================================ */43644365/* --- Enums for data_chunk --- */43664367/* --- Struct forward declarations for data_chunk --- */43684369/* --- Types for data_chunk --- */43704371/* --- Constants for data_chunk --- */43724373/* --- Function pointer typedefs for data_chunk --- */43744375/* --- Functions for data_chunk --- */43764377#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)4378/*!4379 * Creates an empty data chunk with the specified column types. The result must be destroyed with4380 * `duckdb_destroy_data_chunk`.4381 *4382 * history:4383 * - stable: v0.3.34384 *4385 * @param types An array of column types. Column types can not contain ANY and INVALID types.4386 * @param column_count The number of columns.4387 * @return duckdb_data_chunk4388 */4389DUCKDB_C_API duckdb_data_chunk duckdb_create_data_chunk(duckdb_logical_type *types, idx_t column_count);4390#endif43914392#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)4393/*!4394 * Destroys the data chunk and de-allocates all memory allocated for that chunk.4395 *4396 * history:4397 * - stable: v0.3.34398 *4399 * @param chunk The data chunk to destroy.4400 * @return void4401 */4402DUCKDB_C_API void duckdb_destroy_data_chunk(duckdb_data_chunk *chunk);4403#endif44044405#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)4406/*!4407 * Resets a data chunk, clearing the validity masks and setting the cardinality of the data chunk to 0. After calling4408 * this method, you must call `duckdb_vector_get_validity` and `duckdb_vector_get_data` to obtain current data and4409 * validity pointers4410 *4411 * history:4412 * - stable: v0.3.34413 *4414 * @param chunk The data chunk to reset.4415 * @return void4416 */4417DUCKDB_C_API void duckdb_data_chunk_reset(duckdb_data_chunk chunk);4418#endif44194420#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)4421/*!4422 * Retrieves the number of columns in a data chunk.4423 *4424 * history:4425 * - stable: v0.3.34426 *4427 * @param chunk The data chunk to get the data from4428 * @return idx_t4429 */4430DUCKDB_C_API idx_t duckdb_data_chunk_get_column_count(duckdb_data_chunk chunk);4431#endif44324433#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)4434/*!4435 * Retrieves the vector at the specified column index in the data chunk.4436 *4437 * The pointer to the vector is valid for as long as the chunk is alive. It does NOT need to be destroyed.4438 *4439 * history:4440 * - stable: v0.3.34441 *4442 * @param chunk The data chunk to get the data from4443 * @param col_idx4444 * @return duckdb_vector4445 */4446DUCKDB_C_API duckdb_vector duckdb_data_chunk_get_vector(duckdb_data_chunk chunk, idx_t col_idx);4447#endif44484449#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)4450/*!4451 * Retrieves the current number of tuples in a data chunk.4452 *4453 * history:4454 * - stable: v0.3.34455 *4456 * @param chunk The data chunk to get the data from4457 * @return idx_t4458 */4459DUCKDB_C_API idx_t duckdb_data_chunk_get_size(duckdb_data_chunk chunk);4460#endif44614462#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)4463/*!4464 * Sets the current number of tuples in a data chunk.4465 *4466 * history:4467 * - stable: v0.3.34468 *4469 * @param chunk The data chunk to set the size in4470 * @param size The number of tuples in the data chunk4471 * @return void4472 */4473DUCKDB_C_API void duckdb_data_chunk_set_size(duckdb_data_chunk chunk, idx_t size);4474#endif44754476/* --- Struct definitions for data_chunk --- */44774478/* ============================================================================4479 * MODULE: database4480 * ============================================================================ */44814482/* --- Enums for database --- */44834484/* --- Struct forward declarations for database --- */44854486/* --- Types for database --- */44874488/* --- Constants for database --- */44894490/* --- Function pointer typedefs for database --- */44914492/* --- Functions for database --- */44934494#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4495/*!4496 * Creates a new database instance cache. The instance cache is necessary if a client/program (re)opens multiple4497 * databases to the same file within the same process. Must be destroyed with 'duckdb_destroy_instance_cache'.4498 *4499 * history:4500 * - unstable: v1.2.04501 * - stable: v1.5.64502 *4503 * @return duckdb_instance_cache4504 */4505DUCKDB_C_API duckdb_instance_cache duckdb_create_instance_cache(void);4506#endif45074508#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4509/*!4510 * Creates a new database instance in the instance cache, or retrieves an existing database instance. Must be closed4511 * with 'duckdb_close'.4512 *4513 * history:4514 * - unstable: v1.2.04515 * - stable: v1.5.64516 *4517 * @param instance_cache The instance cache in which to create the database, or from which to take the database.4518 * @param path Path to the database file on disk. Both `nullptr` and `:memory:` open or retrieve an in-memory database.4519 * @param out_database The resulting cached database.4520 * @param config (Optional) configuration used to create the database.4521 * @param out_error If set and the function returns `DuckDBError`, this contains the error message. Note that the error4522 * message must be freed using `duckdb_free`.4523 * @return duckdb_state4524 */4525DUCKDB_C_API duckdb_state duckdb_get_or_create_from_cache(duckdb_instance_cache instance_cache, const char *path,4526                                                          duckdb_database *out_database, duckdb_config config,4527                                                          char **out_error);4528#endif45294530#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4531/*!4532 * Destroys an existing database instance cache and de-allocates its memory.4533 *4534 * history:4535 * - unstable: v1.2.04536 * - stable: v1.5.64537 *4538 * @param instance_cache The instance cache to destroy.4539 * @return void4540 */4541DUCKDB_C_API void duckdb_destroy_instance_cache(duckdb_instance_cache *instance_cache);4542#endif45434544/*!4545 * Creates a new database or opens an existing database file stored at the given path. If no path is given a new4546 * in-memory database is created instead. The database must be closed with 'duckdb_close'.4547 *4548 * history:4549 * - stable: v0.1.04550 *4551 * @param path Path to the database file on disk. Both `nullptr` and `:memory:` open an in-memory database.4552 * @param out_database The result database object.4553 * @return duckdb_state4554 */4555DUCKDB_C_API duckdb_state duckdb_open(const char *path, duckdb_database *out_database);45564557#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 8)4558/*!4559 * Extended version of duckdb_open. Creates a new database or opens an existing database file stored at the given path.4560 * The database must be closed with 'duckdb_close'.4561 *4562 * history:4563 * - stable: v0.2.84564 *4565 * @param path Path to the database file on disk. Both `nullptr` and `:memory:` open an in-memory database.4566 * @param out_database The result database object.4567 * @param config (Optional) configuration used to start up the database.4568 * @param out_error If set and the function returns `DuckDBError`, this contains the error message. Note that the error4569 * message must be freed using `duckdb_free`.4570 * @return duckdb_state4571 */4572DUCKDB_C_API duckdb_state duckdb_open_ext(const char *path, duckdb_database *out_database, duckdb_config config,4573                                          char **out_error);4574#endif45754576/*!4577 * Closes the specified database and de-allocates all memory allocated for that database. This should be called after4578 * you are done with any database allocated through `duckdb_open` or `duckdb_open_ext`. Note that failing to call4579 * `duckdb_close` (in case of e.g. a program crash) will not cause data corruption. Still, it is recommended to always4580 * correctly close a database object after you are done with it.4581 *4582 * history:4583 * - stable: v0.1.04584 *4585 * @param database The database object to shut down.4586 * @return void4587 */4588DUCKDB_C_API void duckdb_close(duckdb_database *database);45894590#if DUCKDB_API_VERSION_AT_LEAST(0, 6, 0)4591/*!4592 * Returns the version of the linked DuckDB, with a version postfix for dev versions4593 *4594 * Usually used for developing C extensions that must return this for a compatibility check.4595 *4596 * history:4597 * - stable: v0.6.04598 *4599 * @return const char*4600 */4601DUCKDB_C_API const char *duckdb_library_version(void);4602#endif46034604#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 8)4605/*!4606 * Initializes an empty configuration object that can be used to provide start-up options for the DuckDB instance4607 * through `duckdb_open_ext`. The duckdb_config must be destroyed using 'duckdb_destroy_config'4608 *4609 * This will always succeed unless there is a malloc failure.4610 *4611 * Note that `duckdb_destroy_config` should always be called on the resulting config, even if the function returns4612 * `DuckDBError`.4613 *4614 * history:4615 * - stable: v0.2.84616 *4617 * @param out_config The result configuration object.4618 * @return duckdb_state4619 */4620DUCKDB_C_API duckdb_state duckdb_create_config(duckdb_config *out_config);4621#endif46224623#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 8)4624/*!4625 * This returns the total amount of configuration options available for usage with `duckdb_get_config_flag`.4626 *4627 * This should not be called in a loop as it internally loops over all the options.4628 *4629 * history:4630 * - stable: v0.2.84631 *4632 * @return size_t4633 */4634DUCKDB_C_API size_t duckdb_config_count(void);4635#endif46364637#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 8)4638/*!4639 * Obtains a human-readable name and description of a specific configuration option. This can be used to e.g. display4640 * configuration options. This will succeed unless `index` is out of range (i.e. `>= duckdb_config_count`).4641 *4642 * The result name or description MUST NOT be freed.4643 *4644 * history:4645 * - stable: v0.2.84646 *4647 * @param index The index of the configuration option (between 0 and `duckdb_config_count`)4648 * @param out_name A name of the configuration flag.4649 * @param out_description A description of the configuration flag.4650 * @return duckdb_state4651 */4652DUCKDB_C_API duckdb_state duckdb_get_config_flag(size_t index, const char **out_name, const char **out_description);4653#endif46544655#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 8)4656/*!4657 * Sets the specified option for the specified configuration. The configuration option is indicated by name. To obtain a4658 * list of config options, see `duckdb_get_config_flag`.4659 *4660 * In the source code, configuration options are defined in `config.cpp`.4661 *4662 * This can fail if either the name is invalid, or if the value provided for the option is invalid.4663 *4664 * history:4665 * - stable: v0.2.84666 *4667 * @param config The configuration object to set the option on.4668 * @param name The name of the configuration flag to set.4669 * @param option The value to set the configuration flag to.4670 * @return duckdb_state4671 */4672DUCKDB_C_API duckdb_state duckdb_set_config(duckdb_config config, const char *name, const char *option);4673#endif46744675#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 8)4676/*!4677 * Destroys the specified configuration object and de-allocates all memory allocated for the object.4678 *4679 * history:4680 * - stable: v0.2.84681 *4682 * @param config The configuration object to destroy.4683 * @return void4684 */4685DUCKDB_C_API void duckdb_destroy_config(duckdb_config *config);4686#endif46874688/* --- Struct definitions for database --- */46894690/* ============================================================================4691 * MODULE: expression4692 * ============================================================================ */46934694/* --- Enums for expression --- */46954696/* --- Struct forward declarations for expression --- */46974698/* --- Types for expression --- */46994700/* --- Constants for expression --- */47014702/* --- Function pointer typedefs for expression --- */47034704/* --- Functions for expression --- */47054706#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4707/*!4708 * Destroys the expression and de-allocates its memory.4709 *4710 * history:4711 * - unstable: v1.4.04712 * - stable: v1.5.64713 *4714 * @param expr A pointer to the expression.4715 * @return void4716 */4717DUCKDB_C_API void duckdb_destroy_expression(duckdb_expression *expr);4718#endif47194720#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4721/*!4722 * Returns the return type of an expression.4723 *4724 * history:4725 * - unstable: v1.4.04726 * - stable: v1.5.64727 *4728 * @param expr The expression.4729 * @return duckdb_logical_type4730 */4731DUCKDB_C_API duckdb_logical_type duckdb_expression_return_type(duckdb_expression expr);4732#endif47334734#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4735/*!4736 * Returns whether the expression is foldable into a value or not.4737 *4738 * history:4739 * - unstable: v1.4.04740 * - stable: v1.5.64741 *4742 * @param expr The expression.4743 * @return bool4744 */4745DUCKDB_C_API bool duckdb_expression_is_foldable(duckdb_expression expr);4746#endif47474748#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4749/*!4750 * Folds an expression creating a folded value.4751 *4752 * history:4753 * - unstable: v1.4.04754 * - stable: v1.5.64755 *4756 * @param context The client context.4757 * @param expr The expression. Must be foldable.4758 * @param out_value The folded value, if folding was successful. Must be destroyed with `duckdb_destroy_value`.4759 * @return duckdb_error_data4760 */4761DUCKDB_C_API duckdb_error_data duckdb_expression_fold(duckdb_client_context context, duckdb_expression expr,4762                                                      duckdb_value *out_value);4763#endif47644765/* --- Struct definitions for expression --- */47664767/* ============================================================================4768 * MODULE: file_system4769 * ============================================================================ */47704771/* --- Enums for file_system --- */47724773/* --- Struct forward declarations for file_system --- */47744775/* --- Types for file_system --- */47764777/* --- Constants for file_system --- */47784779/* --- Function pointer typedefs for file_system --- */47804781/* --- Functions for file_system --- */47824783#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4784/*!4785 * Get a file system instance associated with the given client context.4786 *4787 * history:4788 * - unstable: v1.5.04789 * - stable: v1.5.64790 *4791 * @param context The client context.4792 * @return duckdb_file_system4793 */4794DUCKDB_C_API duckdb_file_system duckdb_client_context_get_file_system(duckdb_client_context context);4795#endif47964797#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4798/*!4799 * Destroys the given file system instance.4800 *4801 * history:4802 * - unstable: v1.5.04803 * - stable: v1.5.64804 *4805 * @param file_system The file system instance to destroy.4806 * @return void4807 */4808DUCKDB_C_API void duckdb_destroy_file_system(duckdb_file_system *file_system);4809#endif48104811#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4812/*!4813 * Retrieves the last error that occurred on the given file system instance.4814 *4815 * history:4816 * - unstable: v1.5.04817 * - stable: v1.5.64818 *4819 * @param file_system The file system instance.4820 * @return duckdb_error_data4821 */4822DUCKDB_C_API duckdb_error_data duckdb_file_system_error_data(duckdb_file_system file_system);4823#endif48244825#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4826/*!4827 * Opens a file at the given path with the specified options.4828 *4829 * history:4830 * - unstable: v1.5.04831 * - stable: v1.5.64832 *4833 * @param file_system The file system instance.4834 * @param path The path to the file.4835 * @param options The file open options specifying how to open the file.4836 * @param out_file The resulting file handle instance, or `nullptr` if the open failed. Must be destroyed with4837 * `duckdb_destroy_file_handle`.4838 * @return duckdb_state4839 */4840DUCKDB_C_API duckdb_state duckdb_file_system_open(duckdb_file_system file_system, const char *path,4841                                                  duckdb_file_open_options options, duckdb_file_handle *out_file);4842#endif48434844#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4845/*!4846 * Creates a new file open options instance with blank settings.4847 *4848 * history:4849 * - unstable: v1.5.04850 * - stable: v1.5.64851 *4852 * @return duckdb_file_open_options4853 */4854DUCKDB_C_API duckdb_file_open_options duckdb_create_file_open_options(void);4855#endif48564857#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4858/*!4859 * Sets a specific flag in the file open options.4860 *4861 * history:4862 * - unstable: v1.5.04863 * - stable: v1.5.64864 *4865 * @param options The file open options instance.4866 * @param flag The flag to set (e.g., read, write).4867 * @param value If the flag is enabled or disabled.4868 * @return duckdb_state4869 */4870DUCKDB_C_API duckdb_state duckdb_file_open_options_set_flag(duckdb_file_open_options options, duckdb_file_flag flag,4871                                                            bool value);4872#endif48734874#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4875/*!4876 * Destroys the given file open options instance.4877 *4878 * history:4879 * - unstable: v1.5.04880 * - stable: v1.5.64881 *4882 * @param options The file open options instance to destroy.4883 * @return void4884 */4885DUCKDB_C_API void duckdb_destroy_file_open_options(duckdb_file_open_options *options);4886#endif48874888#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4889/*!4890 * Destroys the given file handle and deallocates all associated resources. This will also close the file if it is still4891 * open.4892 *4893 * history:4894 * - unstable: v1.5.04895 * - stable: v1.5.64896 *4897 * @param file_handle The file handle to destroy.4898 * @return void4899 */4900DUCKDB_C_API void duckdb_destroy_file_handle(duckdb_file_handle *file_handle);4901#endif49024903#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4904/*!4905 * Retrieves the last error that occurred on the given file handle.4906 *4907 * history:4908 * - unstable: v1.5.04909 * - stable: v1.5.64910 *4911 * @param file_handle The file handle.4912 * @return duckdb_error_data4913 */4914DUCKDB_C_API duckdb_error_data duckdb_file_handle_error_data(duckdb_file_handle file_handle);4915#endif49164917#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4918/*!4919 * Reads data from the file into the buffer.4920 *4921 * history:4922 * - unstable: v1.5.04923 * - stable: v1.5.64924 *4925 * @param file_handle The file handle to read from.4926 * @param buffer The buffer to read data into.4927 * @param size The number of bytes to read.4928 * @return int64_t4929 */4930DUCKDB_C_API int64_t duckdb_file_handle_read(duckdb_file_handle file_handle, void *buffer, int64_t size);4931#endif49324933#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4934/*!4935 * Writes data from the buffer to the file.4936 *4937 * history:4938 * - unstable: v1.5.04939 * - stable: v1.5.64940 *4941 * @param file_handle The file handle to write to.4942 * @param buffer The buffer containing data to write.4943 * @param size The number of bytes to write.4944 * @return int64_t4945 */4946DUCKDB_C_API int64_t duckdb_file_handle_write(duckdb_file_handle file_handle, const void *buffer, int64_t size);4947#endif49484949#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4950/*!4951 * Tells the current position in the file.4952 *4953 * history:4954 * - unstable: v1.5.04955 * - stable: v1.5.64956 *4957 * @param file_handle The file handle to tell the position of.4958 * @return int64_t4959 */4960DUCKDB_C_API int64_t duckdb_file_handle_tell(duckdb_file_handle file_handle);4961#endif49624963#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4964/*!4965 * Gets the size of the file.4966 *4967 * history:4968 * - unstable: v1.5.04969 * - stable: v1.5.64970 *4971 * @param file_handle The file handle to get the size of.4972 * @return int64_t4973 */4974DUCKDB_C_API int64_t duckdb_file_handle_size(duckdb_file_handle file_handle);4975#endif49764977#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4978/*!4979 * Seeks to a specific position in the file.4980 *4981 * history:4982 * - unstable: v1.5.04983 * - stable: v1.5.64984 *4985 * @param file_handle The file handle to seek in.4986 * @param position4987 * @return duckdb_state4988 */4989DUCKDB_C_API duckdb_state duckdb_file_handle_seek(duckdb_file_handle file_handle, int64_t position);4990#endif49914992#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)4993/*!4994 * Synchronizes the file's state with the underlying storage.4995 *4996 * history:4997 * - unstable: v1.5.04998 * - stable: v1.5.64999 *5000 * @param file_handle The file handle to synchronize.5001 * @return duckdb_state5002 */5003DUCKDB_C_API duckdb_state duckdb_file_handle_sync(duckdb_file_handle file_handle);5004#endif50055006#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)5007/*!5008 * Closes the given file handle.5009 *5010 * history:5011 * - unstable: v1.5.05012 * - stable: v1.5.65013 *5014 * @param file_handle The file handle to close.5015 * @return duckdb_state5016 */5017DUCKDB_C_API duckdb_state duckdb_file_handle_close(duckdb_file_handle file_handle);5018#endif50195020/* --- Struct definitions for file_system --- */50215022/* ============================================================================5023 * MODULE: log_storage5024 * ============================================================================ */50255026/* --- Enums for log_storage --- */50275028/* --- Struct forward declarations for log_storage --- */50295030/* --- Types for log_storage --- */50315032/* --- Constants for log_storage --- */50335034/* --- Function pointer typedefs for log_storage --- */50355036/* --- Functions for log_storage --- */50375038#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)5039/*!5040 * Creates a new log storage object.5041 *5042 * history:5043 * - unstable: v1.5.05044 * - stable: v1.5.65045 *5046 * @return duckdb_log_storage5047 */5048DUCKDB_C_API duckdb_log_storage duckdb_create_log_storage(void);5049#endif50505051#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)5052/*!5053 * Destroys a log storage object.5054 *5055 * history:5056 * - unstable: v1.5.05057 * - stable: v1.5.65058 *5059 * @param log_storage The log storage object to destroy.5060 * @return void5061 */5062DUCKDB_C_API void duckdb_destroy_log_storage(duckdb_log_storage *log_storage);5063#endif50645065#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)5066/*!5067 * Sets the callback function for writing log entries.5068 *5069 * history:5070 * - unstable: v1.5.05071 * - stable: v1.5.65072 *5073 * @param log_storage The log storage object.5074 * @param function The function to call.5075 * @return void5076 */5077DUCKDB_C_API void duckdb_log_storage_set_write_log_entry(duckdb_log_storage log_storage,5078                                                         duckdb_logger_write_log_entry_t function);5079#endif50805081#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)5082/*!5083 * Sets the extra data of the custom log storage.5084 *5085 * history:5086 * - unstable: v1.5.05087 * - stable: v1.5.65088 *5089 * @param log_storage The log storage object.5090 * @param extra_data The extra data that is passed back into the callbacks.5091 * @param delete_callback5092 * @return void5093 */5094DUCKDB_C_API void duckdb_log_storage_set_extra_data(duckdb_log_storage log_storage, void *extra_data,5095                                                    duckdb_delete_callback_t delete_callback);5096#endif50975098#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)5099/*!5100 * Sets the name of the log storage.5101 *5102 * history:5103 * - unstable: v1.5.05104 * - stable: v1.5.65105 *5106 * @param log_storage The log storage object.5107 * @param name The name of the log storage.5108 * @return void5109 */5110DUCKDB_C_API void duckdb_log_storage_set_name(duckdb_log_storage log_storage, const char *name);5111#endif51125113#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)5114/*!5115 * Registers a custom log storage for the logger.5116 *5117 * history:5118 * - unstable: v1.5.05119 * - stable: v1.5.65120 *5121 * @param database A database object.5122 * @param log_storage The log storage object.5123 * @return duckdb_state5124 */5125DUCKDB_C_API duckdb_state duckdb_register_log_storage(duckdb_database database, duckdb_log_storage log_storage);5126#endif51275128/* --- Struct definitions for log_storage --- */51295130/* ============================================================================5131 * MODULE: logical_type5132 * ============================================================================ */51335134/* --- Enums for logical_type --- */51355136/* --- Struct forward declarations for logical_type --- */51375138/* --- Types for logical_type --- */51395140/* --- Constants for logical_type --- */51415142/* --- Function pointer typedefs for logical_type --- */51435144/* --- Functions for logical_type --- */51455146#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)5147/*!5148 * Creates a `duckdb_logical_type` from a primitive type. The resulting logical type must be destroyed with5149 * `duckdb_destroy_logical_type`.5150 *5151 * Returns an invalid logical type, if type is: `DUCKDB_TYPE_INVALID`, `DUCKDB_TYPE_DECIMAL`, `DUCKDB_TYPE_ENUM`,5152 * `DUCKDB_TYPE_LIST`, `DUCKDB_TYPE_STRUCT`, `DUCKDB_TYPE_MAP`, `DUCKDB_TYPE_ARRAY`, or `DUCKDB_TYPE_UNION`.5153 *5154 * history:5155 * - stable: v0.3.35156 *5157 * @param type The primitive type to create.5158 * @return duckdb_logical_type5159 */5160DUCKDB_C_API duckdb_logical_type duckdb_create_logical_type(duckdb_type type);5161#endif51625163#if DUCKDB_API_VERSION_AT_LEAST(0, 10, 0)5164/*!5165 * Returns the alias of a duckdb_logical_type, if set, else `nullptr`. The result must be destroyed with `duckdb_free`.5166 *5167 * history:5168 * - stable: v0.10.05169 *5170 * @param type The logical type5171 * @return char*5172 */5173DUCKDB_C_API char *duckdb_logical_type_get_alias(duckdb_logical_type type);5174#endif51755176#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)5177/*!5178 * Sets the alias of a duckdb_logical_type.5179 *5180 * history:5181 * - stable: v1.1.05182 *5183 * @param type The logical type5184 * @param alias The alias to set5185 * @return void5186 */5187DUCKDB_C_API void duckdb_logical_type_set_alias(duckdb_logical_type type, const char *alias);5188#endif51895190#if DUCKDB_API_VERSION_AT_LEAST(0, 4, 0)5191/*!5192 * Creates a LIST type from its child type. The return type must be destroyed with `duckdb_destroy_logical_type`.5193 *5194 * history:5195 * - stable: v0.4.05196 *5197 * @param type The child type of the list5198 * @return duckdb_logical_type5199 */5200DUCKDB_C_API duckdb_logical_type duckdb_create_list_type(duckdb_logical_type type);5201#endif52025203#if DUCKDB_API_VERSION_AT_LEAST(0, 10, 1)5204/*!5205 * Creates an ARRAY type from its child type. The return type must be destroyed with `duckdb_destroy_logical_type`.5206 *5207 * history:5208 * - stable: v0.10.15209 *5210 * @param type The child type of the array.5211 * @param array_size The number of elements in the array.5212 * @return duckdb_logical_type5213 */5214DUCKDB_C_API duckdb_logical_type duckdb_create_array_type(duckdb_logical_type type, idx_t array_size);5215#endif52165217#if DUCKDB_API_VERSION_AT_LEAST(0, 4, 0)5218/*!5219 * Creates a MAP type from its key type and value type. The return type must be destroyed with5220 * `duckdb_destroy_logical_type`.5221 *5222 * history:5223 * - stable: v0.4.05224 *5225 * @param key_type The map's key type.5226 * @param value_type The map's value type.5227 * @return duckdb_logical_type5228 */5229DUCKDB_C_API duckdb_logical_type duckdb_create_map_type(duckdb_logical_type key_type, duckdb_logical_type value_type);5230#endif52315232#if DUCKDB_API_VERSION_AT_LEAST(0, 7, 0)5233/*!5234 * Creates a UNION type from the passed arrays. The return type must be destroyed with `duckdb_destroy_logical_type`.5235 *5236 * history:5237 * - stable: v0.7.05238 *5239 * @param member_types The array of union member types.5240 * @param member_names The union member names.5241 * @param member_count The number of union members.5242 * @return duckdb_logical_type5243 */5244DUCKDB_C_API duckdb_logical_type duckdb_create_union_type(duckdb_logical_type *member_types, const char **member_names,5245                                                          idx_t member_count);5246#endif52475248#if DUCKDB_API_VERSION_AT_LEAST(0, 9, 0)5249/*!5250 * Creates a STRUCT type based on the member types and names. The resulting type must be destroyed with5251 * `duckdb_destroy_logical_type`.5252 *5253 * history:5254 * - stable: v0.9.05255 *5256 * @param member_types The array of types of the struct members.5257 * @param member_names The array of names of the struct members.5258 * @param member_count The number of members of the struct.5259 * @return duckdb_logical_type5260 */5261DUCKDB_C_API duckdb_logical_type duckdb_create_struct_type(duckdb_logical_type *member_types, const char **member_names,5262                                                           idx_t member_count);5263#endif52645265#if DUCKDB_API_VERSION_AT_LEAST(0, 10, 0)5266/*!5267 * Creates an ENUM type from the passed member name array. The resulting type should be destroyed with5268 * `duckdb_destroy_logical_type`.5269 *5270 * history:5271 * - stable: v0.10.05272 *5273 * @param member_names The array of names that the enum should consist of.5274 * @param member_count The number of elements that were specified in the array.5275 * @return duckdb_logical_type5276 */5277DUCKDB_C_API duckdb_logical_type duckdb_create_enum_type(const char **member_names, idx_t member_count);5278#endif52795280#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)5281/*!5282 * Creates a DECIMAL type with the specified width and scale. The resulting type should be destroyed with5283 * `duckdb_destroy_logical_type`.5284 *5285 * history:5286 * - stable: v0.3.35287 *5288 * @param width The width of the decimal type5289 * @param scale The scale of the decimal type5290 * @return duckdb_logical_type5291 */5292DUCKDB_C_API duckdb_logical_type duckdb_create_decimal_type(uint8_t width, uint8_t scale);5293#endif52945295#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)5296/*!5297 * Retrieves the enum `duckdb_type` of a `duckdb_logical_type`.5298 *5299 * history:5300 * - stable: v0.3.35301 *5302 * @param type The logical type.5303 * @return duckdb_type5304 */5305DUCKDB_C_API duckdb_type duckdb_get_type_id(duckdb_logical_type type);5306#endif53075308#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)5309/*!5310 * Retrieves the width of a decimal type.5311 *5312 * history:5313 * - stable: v0.3.35314 *5315 * @param type The logical type object5316 * @return uint8_t5317 */5318DUCKDB_C_API uint8_t duckdb_decimal_width(duckdb_logical_type type);5319#endif53205321#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)5322/*!5323 * Retrieves the scale of a decimal type.5324 *5325 * history:5326 * - stable: v0.3.35327 *5328 * @param type The logical type object5329 * @return uint8_t5330 */5331DUCKDB_C_API uint8_t duckdb_decimal_scale(duckdb_logical_type type);5332#endif53335334#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)5335/*!5336 * Retrieves the internal storage type of a decimal type.5337 *5338 * history:5339 * - stable: v0.3.35340 *5341 * @param type The logical type object5342 * @return duckdb_type5343 */5344DUCKDB_C_API duckdb_type duckdb_decimal_internal_type(duckdb_logical_type type);5345#endif53465347#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)5348/*!5349 * Retrieves the internal storage type of an enum type.5350 *5351 * history:5352 * - stable: v0.3.35353 *5354 * @param type The logical type object5355 * @return duckdb_type5356 */5357DUCKDB_C_API duckdb_type duckdb_enum_internal_type(duckdb_logical_type type);5358#endif53595360#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)5361/*!5362 * Retrieves the dictionary size of the enum type.5363 *5364 * history:5365 * - stable: v0.3.35366 *5367 * @param type The logical type object5368 * @return uint32_t5369 */5370DUCKDB_C_API uint32_t duckdb_enum_dictionary_size(duckdb_logical_type type);5371#endif53725373#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)5374/*!5375 * Retrieves the dictionary value at the specified position from the enum.5376 *5377 * The result must be freed with `duckdb_free`.5378 *5379 * history:5380 * - stable: v0.3.35381 *5382 * @param type The logical type object5383 * @param index The index in the dictionary5384 * @return char*5385 */5386DUCKDB_C_API char *duckdb_enum_dictionary_value(duckdb_logical_type type, idx_t index);5387#endif53885389#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)5390/*!5391 * Retrieves the child type of the given LIST type. Also accepts MAP types. The result must be freed with5392 * `duckdb_destroy_logical_type`.5393 *5394 * history:5395 * - stable: v0.3.35396 *5397 * @param type The logical type, either LIST or MAP.5398 * @return duckdb_logical_type5399 */5400DUCKDB_C_API duckdb_logical_type duckdb_list_type_child_type(duckdb_logical_type type);5401#endif54025403#if DUCKDB_API_VERSION_AT_LEAST(0, 10, 1)5404/*!5405 * Retrieves the child type of the given ARRAY type.5406 *5407 * The result must be freed with `duckdb_destroy_logical_type`.5408 *5409 * history:5410 * - stable: v0.10.15411 *5412 * @param type The logical type. Must be ARRAY.5413 * @return duckdb_logical_type5414 */5415DUCKDB_C_API duckdb_logical_type duckdb_array_type_child_type(duckdb_logical_type type);5416#endif54175418#if DUCKDB_API_VERSION_AT_LEAST(0, 10, 1)5419/*!5420 * Retrieves the array size of the given array type.5421 *5422 * history:5423 * - stable: v0.10.15424 *5425 * @param type The logical type object5426 * @return idx_t5427 */5428DUCKDB_C_API idx_t duckdb_array_type_array_size(duckdb_logical_type type);5429#endif54305431#if DUCKDB_API_VERSION_AT_LEAST(0, 4, 0)5432/*!5433 * Retrieves the key type of the given map type.5434 *5435 * The result must be freed with `duckdb_destroy_logical_type`.5436 *5437 * history:5438 * - stable: v0.4.05439 *5440 * @param type The logical type object5441 * @return duckdb_logical_type5442 */5443DUCKDB_C_API duckdb_logical_type duckdb_map_type_key_type(duckdb_logical_type type);5444#endif54455446#if DUCKDB_API_VERSION_AT_LEAST(0, 4, 0)5447/*!5448 * Retrieves the value type of the given map type.5449 *5450 * The result must be freed with `duckdb_destroy_logical_type`.5451 *5452 * history:5453 * - stable: v0.4.05454 *5455 * @param type The logical type object5456 * @return duckdb_logical_type5457 */5458DUCKDB_C_API duckdb_logical_type duckdb_map_type_value_type(duckdb_logical_type type);5459#endif54605461#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)5462/*!5463 * Returns the number of children of a struct type.5464 *5465 * history:5466 * - stable: v0.3.35467 *5468 * @param type The logical type object5469 * @return idx_t5470 */5471DUCKDB_C_API idx_t duckdb_struct_type_child_count(duckdb_logical_type type);5472#endif54735474#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)5475/*!5476 * Retrieves the name of the struct child.5477 *5478 * The result must be freed with `duckdb_free`.5479 *5480 * history:5481 * - stable: v0.3.35482 *5483 * @param type The logical type object5484 * @param index The child index5485 * @return char*5486 */5487DUCKDB_C_API char *duckdb_struct_type_child_name(duckdb_logical_type type, idx_t index);5488#endif54895490#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)5491/*!5492 * Retrieves the child type of the given struct type at the specified index.5493 *5494 * The result must be freed with `duckdb_destroy_logical_type`.5495 *5496 * history:5497 * - stable: v0.3.35498 *5499 * @param type The logical type object5500 * @param index The child index5501 * @return duckdb_logical_type5502 */5503DUCKDB_C_API duckdb_logical_type duckdb_struct_type_child_type(duckdb_logical_type type, idx_t index);5504#endif55055506#if DUCKDB_API_VERSION_AT_LEAST(0, 7, 0)5507/*!5508 * Returns the number of members that the union type has.5509 *5510 * history:5511 * - stable: v0.7.05512 *5513 * @param type The logical type (union) object5514 * @return idx_t5515 */5516DUCKDB_C_API idx_t duckdb_union_type_member_count(duckdb_logical_type type);5517#endif55185519#if DUCKDB_API_VERSION_AT_LEAST(0, 7, 0)5520/*!5521 * Retrieves the name of the union member.5522 *5523 * The result must be freed with `duckdb_free`.5524 *5525 * history:5526 * - stable: v0.7.05527 *5528 * @param type The logical type object5529 * @param index The child index5530 * @return char*5531 */5532DUCKDB_C_API char *duckdb_union_type_member_name(duckdb_logical_type type, idx_t index);5533#endif55345535#if DUCKDB_API_VERSION_AT_LEAST(0, 7, 0)5536/*!5537 * Retrieves the child type of the given union member at the specified index.5538 *5539 * The result must be freed with `duckdb_destroy_logical_type`.5540 *5541 * history:5542 * - stable: v0.7.05543 *5544 * @param type The logical type object5545 * @param index The child index5546 * @return duckdb_logical_type5547 */5548DUCKDB_C_API duckdb_logical_type duckdb_union_type_member_type(duckdb_logical_type type, idx_t index);5549#endif55505551#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)5552/*!5553 * Destroys the logical type and de-allocates all memory allocated for that type.5554 *5555 * history:5556 * - stable: v0.3.35557 *5558 * @param type The logical type to destroy.5559 * @return void5560 */5561DUCKDB_C_API void duckdb_destroy_logical_type(duckdb_logical_type *type);5562#endif55635564#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)5565/*!5566 * Registers a custom type within the given connection. The type must have an alias5567 *5568 * history:5569 * - stable: v1.1.05570 *5571 * @param con The connection to use5572 * @param type The custom type to register5573 * @param info5574 * @return duckdb_state5575 */5576DUCKDB_C_API duckdb_state duckdb_register_logical_type(duckdb_connection con, duckdb_logical_type type,5577                                                       duckdb_create_type_info info);5578#endif55795580#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)5581/*!5582 * Gets the CRS (Coordinate Reference System) of a GEOMETRY type. Result must be freed with `duckdb_free`.5583 *5584 * history:5585 * - unstable: v1.5.25586 * - stable: v1.5.65587 *5588 * @param type The GEOMETRY type.5589 * @return char*5590 */5591DUCKDB_C_API char *duckdb_geometry_type_get_crs(duckdb_logical_type type);5592#endif55935594/* --- Struct definitions for logical_type --- */55955596/* ============================================================================5597 * MODULE: pending5598 * ============================================================================ */55995600/* --- Enums for pending --- */56015602/* --- Struct forward declarations for pending --- */56035604/* --- Types for pending --- */56055606/* --- Constants for pending --- */56075608/* --- Function pointer typedefs for pending --- */56095610/* --- Functions for pending --- */56115612#if DUCKDB_API_VERSION_AT_LEAST(0, 5, 0)5613/*!5614 * Executes the prepared statement with the given bound parameters, and returns a pending result. The pending result5615 * represents an intermediate structure for a query that is not yet fully executed. The pending result can be used to5616 * incrementally execute a query, returning control to the client between tasks.5617 *5618 * Note that after calling `duckdb_pending_prepared`, the pending result should always be destroyed using5619 * `duckdb_destroy_pending`, even if this function returns DuckDBError.5620 *5621 * history:5622 * - stable: v0.5.05623 *5624 * @param prepared_statement The prepared statement to execute.5625 * @param out_result The pending query result.5626 * @return duckdb_state5627 */5628DUCKDB_C_API duckdb_state duckdb_pending_prepared(duckdb_prepared_statement prepared_statement,5629                                                  duckdb_pending_result *out_result);5630#endif56315632#if DUCKDB_API_VERSION_AT_LEAST(0, 5, 0)5633/*!5634 * Closes the pending result and de-allocates all memory allocated for the result.5635 *5636 * Destroying a pending result whose statement has not completed aborts the statement. On autocommit, its writes are5637 * rolled back. Inside a transaction, a statement that may write invalidates the transaction, and a read-only statement5638 * just stops. Until the statement has completed, preparing or running another statement on the connection fails with5639 * `DUCKDB_ERROR_RESOURCE_IN_USE` and leaves it untouched. `duckdb_pending_execution_is_finished` reporting true does5640 * not mean that the statement completed. To make sure a statement takes effect, complete it before destroying the5641 * pending result: call `duckdb_execute_pending`, and fetch a streaming result until `duckdb_fetch_chunk` returns NULL.5642 * A NULL chunk is also returned on an error, so check `duckdb_result_error` afterwards.5643 *5644 * history:5645 * - stable: v0.5.05646 *5647 * @param pending_result The pending result to destroy.5648 * @return void5649 */5650DUCKDB_C_API void duckdb_destroy_pending(duckdb_pending_result *pending_result);5651#endif56525653#if DUCKDB_API_VERSION_AT_LEAST(0, 5, 0)5654/*!5655 * Returns the error message contained within the pending result.5656 *5657 * The result of this function must not be freed. It will be cleaned up when `duckdb_destroy_pending` is called.5658 *5659 * history:5660 * - stable: v0.5.05661 *5662 * @param pending_result The pending result to fetch the error from.5663 * @return const char*5664 */5665DUCKDB_C_API const char *duckdb_pending_error(duckdb_pending_result pending_result);5666#endif56675668#if DUCKDB_API_VERSION_AT_LEAST(0, 5, 0)5669/*!5670 * Executes a single task within the query, returning whether or not the query is ready.5671 *5672 * If this returns DUCKDB_PENDING_RESULT_READY, the duckdb_execute_pending function can be called to obtain the result.5673 * If this returns DUCKDB_PENDING_RESULT_NOT_READY, the duckdb_pending_execute_task function should be called again. If5674 * this returns DUCKDB_PENDING_ERROR, an error occurred during execution.5675 *5676 * The error message can be obtained by calling duckdb_pending_error on the pending_result.5677 *5678 * history:5679 * - stable: v0.5.05680 *5681 * @param pending_result The pending result to execute a task within.5682 * @return duckdb_pending_state5683 */5684DUCKDB_C_API duckdb_pending_state duckdb_pending_execute_task(duckdb_pending_result pending_result);5685#endif56865687#if DUCKDB_API_VERSION_AT_LEAST(0, 10, 0)5688/*!5689 * If this returns DUCKDB_PENDING_RESULT_READY, the duckdb_execute_pending function can be called to obtain the result.5690 * If this returns DUCKDB_PENDING_RESULT_NOT_READY, the duckdb_pending_execute_check_state function should be called5691 * again. If this returns DUCKDB_PENDING_ERROR, an error occurred during execution.5692 *5693 * The error message can be obtained by calling duckdb_pending_error on the pending_result.5694 *5695 * history:5696 * - stable: v0.10.05697 *5698 * @param pending_result The pending result.5699 * @return duckdb_pending_state5700 */5701DUCKDB_C_API duckdb_pending_state duckdb_pending_execute_check_state(duckdb_pending_result pending_result);5702#endif57035704#if DUCKDB_API_VERSION_AT_LEAST(0, 5, 0)5705/*!5706 * Fully execute a pending query result, returning the final query result.5707 *5708 * If duckdb_pending_execute_task has been called until DUCKDB_PENDING_RESULT_READY was returned, this will return fast.5709 * Otherwise, all remaining tasks must be executed first.5710 *5711 * Note that the result must be freed with `duckdb_destroy_result`.5712 *5713 * history:5714 * - stable: v0.5.05715 *5716 * @param pending_result The pending result to execute.5717 * @param out_result The result object.5718 * @return duckdb_state5719 */5720DUCKDB_C_API duckdb_state duckdb_execute_pending(duckdb_pending_result pending_result, duckdb_result *out_result);5721#endif57225723#if DUCKDB_API_VERSION_AT_LEAST(0, 9, 0)5724/*!5725 * Returns whether a duckdb_pending_state is finished executing. For example if `pending_state` is5726 * DUCKDB_PENDING_RESULT_READY, this function will return true.5727 *5728 * history:5729 * - stable: v0.9.05730 *5731 * @param pending_state The pending state on which to decide whether to finish execution.5732 * @return bool5733 */5734DUCKDB_C_API bool duckdb_pending_execution_is_finished(duckdb_pending_state pending_state);5735#endif57365737/* --- Struct definitions for pending --- */57385739/* ============================================================================5740 * MODULE: prepared_statement5741 * ============================================================================ */57425743/* --- Enums for prepared_statement --- */57445745/* --- Struct forward declarations for prepared_statement --- */57465747/* --- Types for prepared_statement --- */57485749/* --- Constants for prepared_statement --- */57505751/* --- Function pointer typedefs for prepared_statement --- */57525753/* --- Functions for prepared_statement --- */57545755/*!5756 * Create a prepared statement object from a query.5757 *5758 * Note that after calling `duckdb_prepare`, the prepared statement should always be destroyed using5759 * `duckdb_destroy_prepare`, even if the prepare fails.5760 *5761 * If the prepare fails, `duckdb_prepare_error` can be called to obtain the reason why the prepare failed.5762 *5763 * history:5764 * - stable: v0.1.05765 *5766 * @param connection The connection object5767 * @param query The SQL query to prepare5768 * @param out_prepared_statement The resulting prepared statement object5769 * @return duckdb_state5770 */5771DUCKDB_C_API duckdb_state duckdb_prepare(duckdb_connection connection, const char *query,5772                                         duckdb_prepared_statement *out_prepared_statement);57735774/*!5775 * Closes the prepared statement and de-allocates all memory allocated for the statement.5776 *5777 * history:5778 * - stable: v0.1.05779 *5780 * @param prepared_statement The prepared statement to destroy.5781 * @return void5782 */5783DUCKDB_C_API void duckdb_destroy_prepare(duckdb_prepared_statement *prepared_statement);57845785#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 8)5786/*!5787 * Returns the error message associated with the given prepared statement. If the prepared statement has no error5788 * message, this returns `nullptr` instead.5789 *5790 * The error message should not be freed. It will be de-allocated when `duckdb_destroy_prepare` is called.5791 *5792 * history:5793 * - stable: v0.2.85794 *5795 * @param prepared_statement The prepared statement to obtain the error from.5796 * @return const char*5797 */5798DUCKDB_C_API const char *duckdb_prepare_error(duckdb_prepared_statement prepared_statement);5799#endif58005801#if DUCKDB_API_VERSION_AT_LEAST(0, 1, 1)5802/*!5803 * Returns the number of parameters that can be provided to the given prepared statement.5804 *5805 * Returns 0 if the query was not successfully prepared.5806 *5807 * history:5808 * - stable: v0.1.15809 *5810 * @param prepared_statement The prepared statement to obtain the number of parameters for.5811 * @return idx_t5812 */5813DUCKDB_C_API idx_t duckdb_nparams(duckdb_prepared_statement prepared_statement);5814#endif58155816#if DUCKDB_API_VERSION_AT_LEAST(0, 9, 0)5817/*!5818 * Returns the name used to identify the parameter The returned string should be freed using `duckdb_free`.5819 *5820 * Returns NULL if the index is out of range for the provided prepared statement.5821 *5822 * history:5823 * - stable: v0.9.05824 *5825 * @param prepared_statement The prepared statement for which to get the parameter name from.5826 * @param index5827 * @return const char*5828 */5829DUCKDB_C_API const char *duckdb_parameter_name(duckdb_prepared_statement prepared_statement, idx_t index);5830#endif58315832#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9)5833/*!5834 * Returns the parameter type for the parameter at the given index.5835 *5836 * Returns `DUCKDB_TYPE_INVALID` if the parameter index is out of range or the statement was not successfully prepared.5837 *5838 * history:5839 * - stable: v0.2.95840 *5841 * @param prepared_statement The prepared statement.5842 * @param param_idx The parameter index.5843 * @return duckdb_type5844 */5845DUCKDB_C_API duckdb_type duckdb_param_type(duckdb_prepared_statement prepared_statement, idx_t param_idx);5846#endif58475848#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)5849/*!5850 * Returns the logical type for the parameter at the given index.5851 *5852 * Returns `nullptr` if the parameter index is out of range or the statement was not successfully prepared.5853 *5854 * The return type of this call should be destroyed with `duckdb_destroy_logical_type`.5855 *5856 * history:5857 * - stable: v1.2.05858 *5859 * @param prepared_statement The prepared statement.5860 * @param param_idx The parameter index.5861 * @return duckdb_logical_type5862 */5863DUCKDB_C_API duckdb_logical_type duckdb_param_logical_type(duckdb_prepared_statement prepared_statement,5864                                                           idx_t param_idx);5865#endif58665867#if DUCKDB_API_VERSION_AT_LEAST(0, 5, 0)5868/*!5869 * Clear the params bind to the prepared statement.5870 *5871 * history:5872 * - stable: v0.5.05873 *5874 * @param prepared_statement5875 * @return duckdb_state5876 */5877DUCKDB_C_API duckdb_state duckdb_clear_bindings(duckdb_prepared_statement prepared_statement);5878#endif58795880#if DUCKDB_API_VERSION_AT_LEAST(0, 10, 0)5881/*!5882 * Returns the statement type of the statement to be executed5883 *5884 * history:5885 * - stable: v0.10.05886 *5887 * @param statement The prepared statement.5888 * @return duckdb_statement_type5889 */5890DUCKDB_C_API duckdb_statement_type duckdb_prepared_statement_type(duckdb_prepared_statement statement);5891#endif58925893#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)5894/*!5895 * Returns the number of columns present in a the result of the prepared statement. If any of the column types are5896 * invalid, the result will be 1.5897 *5898 * history:5899 * - unstable: v1.4.05900 * - stable: v1.5.65901 *5902 * @param prepared_statement The prepared statement.5903 * @return idx_t5904 */5905DUCKDB_C_API idx_t duckdb_prepared_statement_column_count(duckdb_prepared_statement prepared_statement);5906#endif59075908#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)5909/*!5910 * Returns the name of the specified column of the result of the prepared_statement. The returned string should be freed5911 * using `duckdb_free`.5912 *5913 * Returns `nullptr` if the column is out of range.5914 *5915 * history:5916 * - unstable: v1.4.05917 * - stable: v1.5.65918 *5919 * @param prepared_statement The prepared statement.5920 * @param col_idx The column index.5921 * @return const char*5922 */5923DUCKDB_C_API const char *duckdb_prepared_statement_column_name(duckdb_prepared_statement prepared_statement,5924                                                               idx_t col_idx);5925#endif59265927#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)5928/*!5929 * Returns the column type of the specified column of the result of the prepared_statement.5930 *5931 * Returns `DUCKDB_TYPE_INVALID` if the column is out of range. The return type of this call should be destroyed with5932 * `duckdb_destroy_logical_type`.5933 *5934 * history:5935 * - unstable: v1.4.05936 * - stable: v1.5.65937 *5938 * @param prepared_statement The prepared statement to fetch the column type from.5939 * @param col_idx The column index.5940 * @return duckdb_logical_type5941 */5942DUCKDB_C_API duckdb_logical_type5943duckdb_prepared_statement_column_logical_type(duckdb_prepared_statement prepared_statement, idx_t col_idx);5944#endif59455946#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)5947/*!5948 * Returns the column type of the specified column of the result of the prepared_statement.5949 *5950 * Returns `DUCKDB_TYPE_INVALID` if the column is out of range.5951 *5952 * history:5953 * - unstable: v1.4.05954 * - stable: v1.5.65955 *5956 * @param prepared_statement The prepared statement to fetch the column type from.5957 * @param col_idx The column index.5958 * @return duckdb_type5959 */5960DUCKDB_C_API duckdb_type duckdb_prepared_statement_column_type(duckdb_prepared_statement prepared_statement,5961                                                               idx_t col_idx);5962#endif59635964#if DUCKDB_API_VERSION_AT_LEAST(0, 9, 0)5965/*!5966 * Binds a value to the prepared statement at the specified index.5967 *5968 * Supersedes all type-specific bind functions (e.g., `duckdb_bind_varchar`, `duckdb_bind_int64`, etc.).5969 *5970 * history:5971 * - stable: v0.9.05972 *5973 * @param prepared_statement5974 * @param param_idx5975 * @param val5976 * @return duckdb_state5977 */5978DUCKDB_C_API duckdb_state duckdb_bind_value(duckdb_prepared_statement prepared_statement, idx_t param_idx,5979                                            duckdb_value val);5980#endif59815982#if DUCKDB_API_VERSION_AT_LEAST(0, 9, 0)5983/*!5984 * Retrieve the index of the parameter for the prepared statement, identified by name5985 *5986 * history:5987 * - stable: v0.9.05988 *5989 * @param prepared_statement5990 * @param param_idx_out5991 * @param name5992 * @return duckdb_state5993 */5994DUCKDB_C_API duckdb_state duckdb_bind_parameter_index(duckdb_prepared_statement prepared_statement,5995                                                      idx_t *param_idx_out, const char *name);5996#endif59975998/*!5999 * Binds a bool value to the prepared statement at the specified index.6000 *6001 * history:6002 * - stable: v0.1.06003 *6004 * @param prepared_statement6005 * @param param_idx6006 * @param val6007 * @return duckdb_state6008 */6009DUCKDB_C_API duckdb_state duckdb_bind_boolean(duckdb_prepared_statement prepared_statement, idx_t param_idx, bool val);60106011/*!6012 * Binds an int8_t value to the prepared statement at the specified index.6013 *6014 * history:6015 * - stable: v0.1.06016 *6017 * @param prepared_statement6018 * @param param_idx6019 * @param val6020 * @return duckdb_state6021 */6022DUCKDB_C_API duckdb_state duckdb_bind_int8(duckdb_prepared_statement prepared_statement, idx_t param_idx, int8_t val);60236024/*!6025 * Binds an int16_t value to the prepared statement at the specified index.6026 *6027 * history:6028 * - stable: v0.1.06029 *6030 * @param prepared_statement6031 * @param param_idx6032 * @param val6033 * @return duckdb_state6034 */6035DUCKDB_C_API duckdb_state duckdb_bind_int16(duckdb_prepared_statement prepared_statement, idx_t param_idx, int16_t val);60366037/*!6038 * Binds an int32_t value to the prepared statement at the specified index.6039 *6040 * history:6041 * - stable: v0.1.06042 *6043 * @param prepared_statement6044 * @param param_idx6045 * @param val6046 * @return duckdb_state6047 */6048DUCKDB_C_API duckdb_state duckdb_bind_int32(duckdb_prepared_statement prepared_statement, idx_t param_idx, int32_t val);60496050/*!6051 * Binds an int64_t value to the prepared statement at the specified index.6052 *6053 * history:6054 * - stable: v0.1.06055 *6056 * @param prepared_statement6057 * @param param_idx6058 * @param val6059 * @return duckdb_state6060 */6061DUCKDB_C_API duckdb_state duckdb_bind_int64(duckdb_prepared_statement prepared_statement, idx_t param_idx, int64_t val);60626063#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9)6064/*!6065 * Binds a duckdb_hugeint value to the prepared statement at the specified index.6066 *6067 * history:6068 * - stable: v0.2.96069 *6070 * @param prepared_statement6071 * @param param_idx6072 * @param val6073 * @return duckdb_state6074 */6075DUCKDB_C_API duckdb_state duckdb_bind_hugeint(duckdb_prepared_statement prepared_statement, idx_t param_idx,6076                                              duckdb_hugeint val);6077#endif60786079#if DUCKDB_API_VERSION_AT_LEAST(0, 10, 0)6080/*!6081 * Binds a duckdb_uhugeint value to the prepared statement at the specified index.6082 *6083 * history:6084 * - stable: v0.10.06085 *6086 * @param prepared_statement6087 * @param param_idx6088 * @param val6089 * @return duckdb_state6090 */6091DUCKDB_C_API duckdb_state duckdb_bind_uhugeint(duckdb_prepared_statement prepared_statement, idx_t param_idx,6092                                               duckdb_uhugeint val);6093#endif60946095#if DUCKDB_API_VERSION_AT_LEAST(0, 6, 0)6096/*!6097 * Binds a duckdb_decimal value to the prepared statement at the specified index.6098 *6099 * history:6100 * - stable: v0.6.06101 *6102 * @param prepared_statement6103 * @param param_idx6104 * @param val6105 * @return duckdb_state6106 */6107DUCKDB_C_API duckdb_state duckdb_bind_decimal(duckdb_prepared_statement prepared_statement, idx_t param_idx,6108                                              duckdb_decimal val);6109#endif61106111#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5)6112/*!6113 * Binds a uint8_t value to the prepared statement at the specified index.6114 *6115 * history:6116 * - stable: v0.2.56117 *6118 * @param prepared_statement6119 * @param param_idx6120 * @param val6121 * @return duckdb_state6122 */6123DUCKDB_C_API duckdb_state duckdb_bind_uint8(duckdb_prepared_statement prepared_statement, idx_t param_idx, uint8_t val);6124#endif61256126#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5)6127/*!6128 * Binds a uint16_t value to the prepared statement at the specified index.6129 *6130 * history:6131 * - stable: v0.2.56132 *6133 * @param prepared_statement6134 * @param param_idx6135 * @param val6136 * @return duckdb_state6137 */6138DUCKDB_C_API duckdb_state duckdb_bind_uint16(duckdb_prepared_statement prepared_statement, idx_t param_idx,6139                                             uint16_t val);6140#endif61416142#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5)6143/*!6144 * Binds a uint32_t value to the prepared statement at the specified index.6145 *6146 * history:6147 * - stable: v0.2.56148 *6149 * @param prepared_statement6150 * @param param_idx6151 * @param val6152 * @return duckdb_state6153 */6154DUCKDB_C_API duckdb_state duckdb_bind_uint32(duckdb_prepared_statement prepared_statement, idx_t param_idx,6155                                             uint32_t val);6156#endif61576158#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5)6159/*!6160 * Binds a uint64_t value to the prepared statement at the specified index.6161 *6162 * history:6163 * - stable: v0.2.56164 *6165 * @param prepared_statement6166 * @param param_idx6167 * @param val6168 * @return duckdb_state6169 */6170DUCKDB_C_API duckdb_state duckdb_bind_uint64(duckdb_prepared_statement prepared_statement, idx_t param_idx,6171                                             uint64_t val);6172#endif61736174/*!6175 * Binds a float value to the prepared statement at the specified index.6176 *6177 * history:6178 * - stable: v0.1.06179 *6180 * @param prepared_statement6181 * @param param_idx6182 * @param val6183 * @return duckdb_state6184 */6185DUCKDB_C_API duckdb_state duckdb_bind_float(duckdb_prepared_statement prepared_statement, idx_t param_idx, float val);61866187/*!6188 * Binds a double value to the prepared statement at the specified index.6189 *6190 * history:6191 * - stable: v0.1.06192 *6193 * @param prepared_statement6194 * @param param_idx6195 * @param val6196 * @return duckdb_state6197 */6198DUCKDB_C_API duckdb_state duckdb_bind_double(duckdb_prepared_statement prepared_statement, idx_t param_idx, double val);61996200#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9)6201/*!6202 * Binds a duckdb_date value to the prepared statement at the specified index.6203 *6204 * history:6205 * - stable: v0.2.96206 *6207 * @param prepared_statement6208 * @param param_idx6209 * @param val6210 * @return duckdb_state6211 */6212DUCKDB_C_API duckdb_state duckdb_bind_date(duckdb_prepared_statement prepared_statement, idx_t param_idx,6213                                           duckdb_date val);6214#endif62156216#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9)6217/*!6218 * Binds a duckdb_time value to the prepared statement at the specified index.6219 *6220 * history:6221 * - stable: v0.2.96222 *6223 * @param prepared_statement6224 * @param param_idx6225 * @param val6226 * @return duckdb_state6227 */6228DUCKDB_C_API duckdb_state duckdb_bind_time(duckdb_prepared_statement prepared_statement, idx_t param_idx,6229                                           duckdb_time val);6230#endif62316232#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9)6233/*!6234 * Binds a duckdb_timestamp value to the prepared statement at the specified index.6235 *6236 * history:6237 * - stable: v0.2.96238 *6239 * @param prepared_statement6240 * @param param_idx6241 * @param val6242 * @return duckdb_state6243 */6244DUCKDB_C_API duckdb_state duckdb_bind_timestamp(duckdb_prepared_statement prepared_statement, idx_t param_idx,6245                                                duckdb_timestamp val);6246#endif62476248#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)6249/*!6250 * Binds a duckdb_timestamp value to the prepared statement at the specified index.6251 *6252 * history:6253 * - stable: v1.1.06254 *6255 * @param prepared_statement6256 * @param param_idx6257 * @param val6258 * @return duckdb_state6259 */6260DUCKDB_C_API duckdb_state duckdb_bind_timestamp_tz(duckdb_prepared_statement prepared_statement, idx_t param_idx,6261                                                   duckdb_timestamp val);6262#endif62636264#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9)6265/*!6266 * Binds a duckdb_interval value to the prepared statement at the specified index.6267 *6268 * history:6269 * - stable: v0.2.96270 *6271 * @param prepared_statement6272 * @param param_idx6273 * @param val6274 * @return duckdb_state6275 */6276DUCKDB_C_API duckdb_state duckdb_bind_interval(duckdb_prepared_statement prepared_statement, idx_t param_idx,6277                                               duckdb_interval val);6278#endif62796280/*!6281 * Binds a null-terminated varchar value to the prepared statement at the specified index.6282 *6283 * Superseded by `duckdb_bind_value`.6284 *6285 * history:6286 * - stable: v0.1.06287 *6288 * @param prepared_statement6289 * @param param_idx6290 * @param val6291 * @return duckdb_state6292 */6293DUCKDB_C_API duckdb_state duckdb_bind_varchar(duckdb_prepared_statement prepared_statement, idx_t param_idx,6294                                              const char *val);62956296#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5)6297/*!6298 * Binds a varchar value to the prepared statement at the specified index.6299 *6300 * Superseded by `duckdb_bind_value`.6301 *6302 * history:6303 * - stable: v0.2.56304 *6305 * @param prepared_statement6306 * @param param_idx6307 * @param val6308 * @param length6309 * @return duckdb_state6310 */6311DUCKDB_C_API duckdb_state duckdb_bind_varchar_length(duckdb_prepared_statement prepared_statement, idx_t param_idx,6312                                                     const char *val, idx_t length);6313#endif63146315#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5)6316/*!6317 * Binds a blob value to the prepared statement at the specified index.6318 *6319 * history:6320 * - stable: v0.2.56321 *6322 * @param prepared_statement6323 * @param param_idx6324 * @param data6325 * @param length6326 * @return duckdb_state6327 */6328DUCKDB_C_API duckdb_state duckdb_bind_blob(duckdb_prepared_statement prepared_statement, idx_t param_idx,6329                                           const void *data, idx_t length);6330#endif63316332#if DUCKDB_API_VERSION_AT_LEAST(0, 1, 2)6333/*!6334 * Binds a NULL value to the prepared statement at the specified index.6335 *6336 * history:6337 * - stable: v0.1.26338 *6339 * @param prepared_statement6340 * @param param_idx6341 * @return duckdb_state6342 */6343DUCKDB_C_API duckdb_state duckdb_bind_null(duckdb_prepared_statement prepared_statement, idx_t param_idx);6344#endif63456346/*!6347 * Executes the prepared statement with the given bound parameters, and returns a materialized query result.6348 *6349 * This method can be called multiple times for each prepared statement, and the parameters can be modified between6350 * calls to this function.6351 *6352 * Note that the result must be freed with `duckdb_destroy_result`.6353 *6354 * history:6355 * - stable: v0.1.06356 *6357 * @param prepared_statement The prepared statement to execute.6358 * @param out_result The query result.6359 * @return duckdb_state6360 */6361DUCKDB_C_API duckdb_state duckdb_execute_prepared(duckdb_prepared_statement prepared_statement,6362                                                  duckdb_result *out_result);63636364#if DUCKDB_API_VERSION_AT_LEAST(0, 7, 0)6365/*!6366 * Extract all statements from a query. Note that after calling `duckdb_extract_statements`, the extracted statements6367 * should always be destroyed using `duckdb_destroy_extracted`, even if no statements were extracted.6368 *6369 * If the extract fails, `duckdb_extract_statements_error` can be called to obtain the reason why the extract failed.6370 *6371 * history:6372 * - stable: v0.7.06373 *6374 * @param connection The connection object6375 * @param query The SQL query to extract6376 * @param out_extracted_statements The resulting extracted statements object6377 * @return idx_t6378 */6379DUCKDB_C_API idx_t duckdb_extract_statements(duckdb_connection connection, const char *query,6380                                             duckdb_extracted_statements *out_extracted_statements);6381#endif63826383#if DUCKDB_API_VERSION_AT_LEAST(0, 7, 0)6384/*!6385 * Prepare an extracted statement. Note that after calling `duckdb_prepare_extracted_statement`, the prepared statement6386 * should always be destroyed using `duckdb_destroy_prepare`, even if the prepare fails.6387 *6388 * If the prepare fails, `duckdb_prepare_error` can be called to obtain the reason why the prepare failed.6389 *6390 * history:6391 * - stable: v0.7.06392 *6393 * @param connection The connection object6394 * @param extracted_statements The extracted statements object6395 * @param index The index of the extracted statement to prepare6396 * @param out_prepared_statement The resulting prepared statement object6397 * @return duckdb_state6398 */6399DUCKDB_C_API duckdb_state duckdb_prepare_extracted_statement(duckdb_connection connection,6400                                                             duckdb_extracted_statements extracted_statements,6401                                                             idx_t index,6402                                                             duckdb_prepared_statement *out_prepared_statement);6403#endif64046405#if DUCKDB_API_VERSION_AT_LEAST(0, 7, 0)6406/*!6407 * Returns the error message contained within the extracted statements. The result of this function must not be freed.6408 * It will be cleaned up when `duckdb_destroy_extracted` is called.6409 *6410 * history:6411 * - stable: v0.7.06412 *6413 * @param extracted_statements The extracted statements to fetch the error from.6414 * @return const char*6415 */6416DUCKDB_C_API const char *duckdb_extract_statements_error(duckdb_extracted_statements extracted_statements);6417#endif64186419#if DUCKDB_API_VERSION_AT_LEAST(0, 7, 0)6420/*!6421 * De-allocates all memory allocated for the extracted statements.6422 *6423 * history:6424 * - stable: v0.7.06425 *6426 * @param extracted_statements The extracted statements to destroy.6427 * @return void6428 */6429DUCKDB_C_API void duckdb_destroy_extracted(duckdb_extracted_statements *extracted_statements);6430#endif64316432#if DUCKDB_API_VERSION_AT_LEAST(0, 10, 0) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)6433/*!6434 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.6435 *6436 * Executes the prepared statement with the given bound parameters, and returns an optionally-streaming query result. To6437 * determine if the resulting query was in fact streamed, use `duckdb_result_is_streaming`6438 *6439 * This method can be called multiple times for each prepared statement, and the parameters can be modified between6440 * calls to this function.6441 *6442 * Note that the result must be freed with `duckdb_destroy_result`.6443 *6444 * history:6445 * - stable: v0.10.06446 * - deprecated: v1.0.06447 *6448 * @param prepared_statement The prepared statement to execute.6449 * @param out_result The query result.6450 * @return duckdb_state6451 */6452DUCKDB_C_API duckdb_state duckdb_execute_prepared_streaming(duckdb_prepared_statement prepared_statement,6453                                                            duckdb_result *out_result);6454#endif64556456#if DUCKDB_API_VERSION_AT_LEAST(0, 8, 0) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)6457/*!6458 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.6459 *6460 * Executes the prepared statement with the given bound parameters, and returns a pending result. This pending result6461 * will create a streaming duckdb_result when executed. The pending result represents an intermediate structure for a6462 * query that is not yet fully executed.6463 *6464 * Note that after calling `duckdb_pending_prepared_streaming`, the pending result should always be destroyed using6465 * `duckdb_destroy_pending`, even if this function returns DuckDBError.6466 *6467 * history:6468 * - stable: v0.8.06469 * - deprecated: v1.0.06470 *6471 * @param prepared_statement The prepared statement to execute.6472 * @param out_result The pending query result.6473 * @return duckdb_state6474 */6475DUCKDB_C_API duckdb_state duckdb_pending_prepared_streaming(duckdb_prepared_statement prepared_statement,6476                                                            duckdb_pending_result *out_result);6477#endif64786479/* --- Struct definitions for prepared_statement --- */64806481/* ============================================================================6482 * MODULE: query6483 * ============================================================================ */64846485/* --- Enums for query --- */64866487/* --- Struct forward declarations for query --- */64886489/* --- Types for query --- */64906491/* --- Constants for query --- */64926493/* --- Function pointer typedefs for query --- */64946495/* --- Functions for query --- */64966497/*!6498 * Executes a SQL query within a connection and stores the full (materialized) result in the out_result pointer. If the6499 * query fails to execute, DuckDBError is returned and the error message can be retrieved by calling6500 * `duckdb_result_error`.6501 *6502 * Note that after running `duckdb_query`, `duckdb_destroy_result` must be called on the result object even if the query6503 * fails, otherwise the error stored within the result will not be freed correctly.6504 *6505 * history:6506 * - stable: v0.1.06507 *6508 * @param connection The connection to perform the query in.6509 * @param query The SQL query to run.6510 * @param out_result The query result.6511 * @return duckdb_state6512 */6513DUCKDB_C_API duckdb_state duckdb_query(duckdb_connection connection, const char *query, duckdb_result *out_result);65146515/*!6516 * Closes the result and de-allocates all memory allocated for that result.6517 *6518 * Destroying a streaming result whose statement has not completed aborts the statement. On autocommit, its writes are6519 * rolled back. Inside a transaction, a statement that may write invalidates the transaction, and a read-only statement6520 * just stops. Until the statement has completed, preparing or running another statement on the connection fails with6521 * `DUCKDB_ERROR_RESOURCE_IN_USE` and leaves it untouched. To make sure the statement takes effect, complete it by6522 * fetching until `duckdb_fetch_chunk` returns NULL before destroying the result. A NULL chunk is also returned on an6523 * error, so check `duckdb_result_error` afterwards.6524 *6525 * history:6526 * - stable: v0.1.06527 *6528 * @param result The result to destroy.6529 * @return void6530 */6531DUCKDB_C_API void duckdb_destroy_result(duckdb_result *result);65326533#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 1)6534/*!6535 * Returns the column name of the specified column. The result should not need to be freed; the column names will6536 * automatically be destroyed when the result is destroyed.6537 *6538 * Returns `NULL` if the column is out of range.6539 *6540 * history:6541 * - stable: v0.2.16542 *6543 * @param result The result object to fetch the column name from.6544 * @param col The column index.6545 * @return const char*6546 */6547DUCKDB_C_API const char *duckdb_column_name(duckdb_result *result, idx_t col);6548#endif65496550#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9)6551/*!6552 * Returns the column type of the specified column.6553 *6554 * Returns `DUCKDB_TYPE_INVALID` if the column is out of range.6555 *6556 * history:6557 * - stable: v0.2.96558 *6559 * @param result The result object to fetch the column type from.6560 * @param col The column index.6561 * @return duckdb_type6562 */6563DUCKDB_C_API duckdb_type duckdb_column_type(duckdb_result *result, idx_t col);6564#endif65656566#if DUCKDB_API_VERSION_AT_LEAST(0, 10, 0)6567/*!6568 * Returns the statement type of the statement that was executed6569 *6570 * history:6571 * - stable: v0.10.06572 *6573 * @param result The result object to fetch the statement type from.6574 * @return duckdb_statement_type6575 */6576DUCKDB_C_API duckdb_statement_type duckdb_result_statement_type(duckdb_result result);6577#endif65786579#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)6580/*!6581 * Returns the logical column type of the specified column.6582 *6583 * The return type of this call should be destroyed with `duckdb_destroy_logical_type`.6584 *6585 * Returns `NULL` if the column is out of range.6586 *6587 * history:6588 * - stable: v0.3.36589 *6590 * @param result The result object to fetch the column type from.6591 * @param col The column index.6592 * @return duckdb_logical_type6593 */6594DUCKDB_C_API duckdb_logical_type duckdb_column_logical_type(duckdb_result *result, idx_t col);6595#endif65966597#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)6598/*!6599 * Returns the arrow options associated with the given result. These options are definitions of how the arrow6600 * arrays/schema should be produced.6601 *6602 * history:6603 * - unstable: v1.4.06604 * - stable: v1.5.66605 *6606 * @param result The result object to fetch arrow options from.6607 * @return duckdb_arrow_options6608 */6609DUCKDB_C_API duckdb_arrow_options duckdb_result_get_arrow_options(duckdb_result *result);6610#endif66116612#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9)6613/*!6614 * Returns the number of columns present in a the result object.6615 *6616 * history:6617 * - stable: v0.2.96618 *6619 * @param result The result object.6620 * @return idx_t6621 */6622DUCKDB_C_API idx_t duckdb_column_count(duckdb_result *result);6623#endif66246625#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9)6626/*!6627 * Returns the number of rows changed by the query stored in the result. This is relevant only for INSERT/UPDATE/DELETE6628 * queries. For other queries the rows_changed will be 0.6629 *6630 * history:6631 * - stable: v0.2.96632 *6633 * @param result The result object.6634 * @return idx_t6635 */6636DUCKDB_C_API idx_t duckdb_rows_changed(duckdb_result *result);6637#endif66386639#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9)6640/*!6641 * Returns the error message contained within the result. The error is only set if `duckdb_query` returns `DuckDBError`.6642 *6643 * The result of this function must not be freed. It will be cleaned up when `duckdb_destroy_result` is called.6644 *6645 * history:6646 * - stable: v0.2.96647 *6648 * @param result The result object to fetch the error from.6649 * @return const char*6650 */6651DUCKDB_C_API const char *duckdb_result_error(duckdb_result *result);6652#endif66536654#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)6655/*!6656 * Returns the result error type contained within the result. The error is only set if `duckdb_query` returns6657 * `DuckDBError`.6658 *6659 * history:6660 * - stable: v1.1.06661 *6662 * @param result The result object to fetch the error from.6663 * @return duckdb_error_type6664 */6665DUCKDB_C_API duckdb_error_type duckdb_result_error_type(duckdb_result *result);6666#endif66676668#if DUCKDB_API_VERSION_AT_LEAST(0, 10, 0)6669/*!6670 * Returns the return_type of the given result, or DUCKDB_RETURN_TYPE_INVALID on error6671 *6672 * history:6673 * - stable: v0.10.06674 *6675 * @param result The result object6676 * @return duckdb_result_type6677 */6678DUCKDB_C_API duckdb_result_type duckdb_result_return_type(duckdb_result result);6679#endif66806681#if DUCKDB_API_VERSION_AT_LEAST(1, 0, 0)6682/*!6683 * Fetches a data chunk from a duckdb_result. This function should be called repeatedly until the result is exhausted.6684 *6685 * The result must be destroyed with `duckdb_destroy_data_chunk`.6686 *6687 * It is not known beforehand how many chunks will be returned by this result.6688 *6689 * history:6690 * - stable: v1.0.06691 *6692 * @param result The result object to fetch the data chunk from.6693 * @return duckdb_data_chunk6694 */6695DUCKDB_C_API duckdb_data_chunk duckdb_fetch_chunk(duckdb_result result);6696#endif66976698#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)6699/*!6700 * Creates duckdb_error_data. Must be destroyed with `duckdb_destroy_error_data`.6701 *6702 * history:6703 * - unstable: v1.4.06704 * - stable: v1.5.66705 *6706 * @param type The error type.6707 * @param message The error message.6708 * @return duckdb_error_data6709 */6710DUCKDB_C_API duckdb_error_data duckdb_create_error_data(duckdb_error_type type, const char *message);6711#endif67126713#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)6714/*!6715 * Destroys the error data and deallocates its memory.6716 *6717 * history:6718 * - unstable: v1.4.06719 * - stable: v1.5.66720 *6721 * @param error_data The error data to destroy.6722 * @return void6723 */6724DUCKDB_C_API void duckdb_destroy_error_data(duckdb_error_data *error_data);6725#endif67266727#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)6728/*!6729 * Returns the duckdb_error_type of the error data.6730 *6731 * history:6732 * - unstable: v1.4.06733 * - stable: v1.5.66734 *6735 * @param error_data The error data.6736 * @return duckdb_error_type6737 */6738DUCKDB_C_API duckdb_error_type duckdb_error_data_error_type(duckdb_error_data error_data);6739#endif67406741#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)6742/*!6743 * Returns the error message of the error data. Must not be freed.6744 *6745 * history:6746 * - unstable: v1.4.06747 * - stable: v1.5.66748 *6749 * @param error_data The error data.6750 * @return const char*6751 */6752DUCKDB_C_API const char *duckdb_error_data_message(duckdb_error_data error_data);6753#endif67546755#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)6756/*!6757 * Returns whether the error data contains an error or not.6758 *6759 * history:6760 * - unstable: v1.4.06761 * - stable: v1.5.66762 *6763 * @param error_data The error data.6764 * @return bool6765 */6766DUCKDB_C_API bool duckdb_error_data_has_error(duckdb_error_data error_data);6767#endif67686769#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 7)6770/*!6771 * Allocate `size` bytes of memory using the duckdb internal malloc function. Any memory allocated in this manner should6772 * be freed using `duckdb_free`.6773 *6774 * history:6775 * - stable: v0.2.76776 *6777 * @param size The number of bytes to allocate.6778 * @return void*6779 */6780DUCKDB_C_API void *duckdb_malloc(size_t size);6781#endif67826783#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 7)6784/*!6785 * Free a value returned from `duckdb_malloc`, `duckdb_value_varchar`, `duckdb_value_blob`, or `duckdb_value_string`.6786 *6787 * history:6788 * - stable: v0.2.76789 *6790 * @param ptr The memory region to de-allocate.6791 * @return void6792 */6793DUCKDB_C_API void duckdb_free(void *ptr);6794#endif67956796#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)6797/*!6798 * The internal vector size used by DuckDB. This is the amount of tuples that will fit into a data chunk created by6799 * `duckdb_create_data_chunk`.6800 *6801 * history:6802 * - stable: v0.3.36803 *6804 * @return idx_t6805 */6806DUCKDB_C_API idx_t duckdb_vector_size(void);6807#endif68086809#if DUCKDB_API_VERSION_AT_LEAST(0, 8, 0)6810/*!6811 * Whether or not the duckdb_string_t value is inlined. This means that the data of the string does not have a separate6812 * allocation.6813 *6814 * history:6815 * - stable: v0.8.06816 *6817 * @param string6818 * @return bool6819 */6820DUCKDB_C_API bool duckdb_string_is_inlined(duckdb_string_t string);6821#endif68226823#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)6824/*!6825 * Get the length of a string6826 *6827 * history:6828 * - stable: v1.1.06829 *6830 * @param string The string to get the length of.6831 * @return uint32_t6832 */6833DUCKDB_C_API uint32_t duckdb_string_t_length(duckdb_string_t string);6834#endif68356836#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)6837/*!6838 * Get a pointer to the string data of a string6839 *6840 * history:6841 * - stable: v1.1.06842 *6843 * @param string The string to get the pointer to.6844 * @return const char*6845 */6846DUCKDB_C_API const char *duckdb_string_t_data(duckdb_string_t *string);6847#endif68486849#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)6850/*!6851 * Checks if a string is valid UTF-8.6852 *6853 * history:6854 * - unstable: v1.5.06855 * - stable: v1.5.66856 *6857 * @param str The string to check6858 * @param len The length of the string (in bytes)6859 * @return duckdb_error_data6860 */6861DUCKDB_C_API duckdb_error_data duckdb_valid_utf8_check(const char *str, idx_t len);6862#endif68636864#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)6865/*!6866 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.6867 *6868 * Returns the number of rows present in the result object.6869 *6870 * history:6871 * - stable: v0.2.96872 * - deprecated: v1.0.06873 *6874 * @param result The result object.6875 * @return idx_t6876 */6877DUCKDB_C_API idx_t duckdb_row_count(duckdb_result *result);6878#endif68796880#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)6881/*!6882 * **DEPRECATED**: Prefer using `duckdb_result_get_chunk` instead.6883 *6884 * Returns the data of a specific column of a result in columnar format.6885 *6886 * The function returns a dense array which contains the result data. The exact type stored in the array depends on the6887 * corresponding duckdb_type (as provided by `duckdb_column_type`). For the exact type by which the data should be6888 * accessed, see the comments in [the types section](types) or the `DUCKDB_TYPE` enum.6889 *6890 * For example, for a column of type `DUCKDB_TYPE_INTEGER`, rows can be accessed in the following manner: ```c int32_t6891 * *data = (int32_t *) duckdb_column_data(&result, 0); printf("Data for row %d: %d\n", row, data[row]); ```6892 *6893 * history:6894 * - stable: v0.2.96895 * - deprecated: v1.0.06896 *6897 * @param result The result object to fetch the column data from.6898 * @param col The column index.6899 * @return void*6900 */6901DUCKDB_C_API void *duckdb_column_data(duckdb_result *result, idx_t col);6902#endif69036904#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)6905/*!6906 * **DEPRECATED**: Prefer using `duckdb_result_get_chunk` instead.6907 *6908 * Returns the nullmask of a specific column of a result in columnar format. The nullmask indicates for every row6909 * whether or not the corresponding row is `NULL`. If a row is `NULL`, the values present in the array provided by6910 * `duckdb_column_data` are undefined.6911 *6912 * ```c int32_t *data = (int32_t *) duckdb_column_data(&result, 0); bool *nullmask = duckdb_nullmask_data(&result, 0);6913 * if (nullmask[row]) { printf("Data for row %d: NULL\n", row); } else { printf("Data for row %d: %d\n", row,6914 * data[row]); } ```6915 *6916 * history:6917 * - stable: v0.2.96918 * - deprecated: v1.0.06919 *6920 * @param result The result object to fetch the nullmask from.6921 * @param col The column index.6922 * @return bool*6923 */6924DUCKDB_C_API bool *duckdb_nullmask_data(duckdb_result *result, idx_t col);6925#endif69266927#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)6928/*!6929 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.6930 *6931 * Fetches a data chunk from the duckdb_result. This function should be called repeatedly until the result is exhausted.6932 *6933 * The result must be destroyed with `duckdb_destroy_data_chunk`.6934 *6935 * This function supersedes all `duckdb_value` functions, as well as the `duckdb_column_data` and `duckdb_nullmask_data`6936 * functions. It results in significantly better performance, and should be preferred in newer code-bases.6937 *6938 * If this function is used, none of the other result functions can be used and vice versa (i.e. this function cannot be6939 * mixed with the legacy result functions).6940 *6941 * Use `duckdb_result_chunk_count` to figure out how many chunks there are in the result.6942 *6943 * history:6944 * - stable: v0.3.36945 * - deprecated: v1.0.06946 *6947 * @param result The result object to fetch the data chunk from.6948 * @param chunk_index The chunk index to fetch from.6949 * @return duckdb_data_chunk6950 */6951DUCKDB_C_API duckdb_data_chunk duckdb_result_get_chunk(duckdb_result result, idx_t chunk_index);6952#endif69536954#if DUCKDB_API_VERSION_AT_LEAST(0, 8, 0) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)6955/*!6956 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.6957 *6958 * Checks if the type of the internal result is StreamQueryResult.6959 *6960 * history:6961 * - stable: v0.8.06962 * - deprecated: v1.0.06963 *6964 * @param result The result object to check.6965 * @return bool6966 */6967DUCKDB_C_API bool duckdb_result_is_streaming(duckdb_result result);6968#endif69696970#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)6971/*!6972 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.6973 *6974 * Returns the number of data chunks present in the result.6975 *6976 * history:6977 * - stable: v0.3.36978 * - deprecated: v1.0.06979 *6980 * @param result The result object6981 * @return idx_t6982 */6983DUCKDB_C_API idx_t duckdb_result_chunk_count(duckdb_result result);6984#endif69856986#if DUCKDB_API_VERSION_AT_LEAST(0, 8, 0) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)6987/*!6988 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.6989 *6990 * Fetches a data chunk from the (streaming) duckdb_result. This function should be called repeatedly until the result6991 * is exhausted.6992 *6993 * The result must be destroyed with `duckdb_destroy_data_chunk`.6994 *6995 * This function can only be used on duckdb_results created with 'duckdb_pending_prepared_streaming'6996 *6997 * If this function is used, none of the other result functions can be used and vice versa (i.e. this function cannot be6998 * mixed with the legacy result functions or the materialized result functions).6999 *7000 * It is not known beforehand how many chunks will be returned by this result.7001 *7002 * history:7003 * - stable: v0.8.07004 * - deprecated: v1.0.07005 *7006 * @param result The result object to fetch the data chunk from.7007 * @return duckdb_data_chunk7008 */7009DUCKDB_C_API duckdb_data_chunk duckdb_stream_fetch_chunk(duckdb_result result);7010#endif70117012/* --- Struct definitions for query --- */70137014/* ============================================================================7015 * MODULE: replacement_scan7016 * ============================================================================ */70177018/* --- Enums for replacement_scan --- */70197020/* --- Struct forward declarations for replacement_scan --- */70217022/* --- Types for replacement_scan --- */70237024/* --- Constants for replacement_scan --- */70257026/* --- Function pointer typedefs for replacement_scan --- */70277028/* --- Functions for replacement_scan --- */70297030#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)7031/*!7032 * Add a replacement scan definition to the specified database.7033 *7034 * history:7035 * - stable: v0.3.37036 *7037 * @param db The database object to add the replacement scan to7038 * @param replacement The replacement scan callback7039 * @param extra_data Extra data that is passed back into the specified callback7040 * @param delete_callback The delete callback to call on the extra data, if any7041 * @return void7042 */7043DUCKDB_C_API void duckdb_add_replacement_scan(duckdb_database db, duckdb_replacement_callback_t replacement,7044                                              void *extra_data, duckdb_delete_callback_t delete_callback);7045#endif70467047#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)7048/*!7049 * Sets the replacement function name. If this function is called in the replacement callback, the replacement scan is7050 * performed. If it is not called, the replacement callback is not performed.7051 *7052 * history:7053 * - stable: v0.3.37054 *7055 * @param info The info object7056 * @param function_name The function name to substitute.7057 * @return void7058 */7059DUCKDB_C_API void duckdb_replacement_scan_set_function_name(duckdb_replacement_scan_info info,7060                                                            const char *function_name);7061#endif70627063#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)7064/*!7065 * Adds a parameter to the replacement scan function.7066 *7067 * history:7068 * - stable: v0.3.37069 *7070 * @param info The info object7071 * @param parameter The parameter to add.7072 * @return void7073 */7074DUCKDB_C_API void duckdb_replacement_scan_add_parameter(duckdb_replacement_scan_info info, duckdb_value parameter);7075#endif70767077#if DUCKDB_API_VERSION_AT_LEAST(0, 6, 0)7078/*!7079 * Report that an error has occurred while executing the replacement scan.7080 *7081 * history:7082 * - stable: v0.6.07083 *7084 * @param info The info object7085 * @param error The error message7086 * @return void7087 */7088DUCKDB_C_API void duckdb_replacement_scan_set_error(duckdb_replacement_scan_info info, const char *error);7089#endif70907091/* --- Struct definitions for replacement_scan --- */70927093/* ============================================================================7094 * MODULE: scalar_function7095 * ============================================================================ */70967097/* --- Enums for scalar_function --- */70987099/* --- Struct forward declarations for scalar_function --- */71007101/* --- Types for scalar_function --- */71027103/* --- Constants for scalar_function --- */71047105/* --- Function pointer typedefs for scalar_function --- */71067107/* --- Functions for scalar_function --- */71087109#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)7110/*!7111 * Creates a new empty scalar function.7112 *7113 * The return value must be destroyed with `duckdb_destroy_scalar_function`.7114 *7115 * history:7116 * - stable: v1.1.07117 *7118 * @return duckdb_scalar_function7119 */7120DUCKDB_C_API duckdb_scalar_function duckdb_create_scalar_function(void);7121#endif71227123#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)7124/*!7125 * Destroys the given scalar function object.7126 *7127 * history:7128 * - stable: v1.1.07129 *7130 * @param scalar_function The scalar function to destroy7131 * @return void7132 */7133DUCKDB_C_API void duckdb_destroy_scalar_function(duckdb_scalar_function *scalar_function);7134#endif71357136#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)7137/*!7138 * Sets the name of the given scalar function.7139 *7140 * history:7141 * - stable: v1.1.07142 *7143 * @param scalar_function The scalar function7144 * @param name The name of the scalar function7145 * @return void7146 */7147DUCKDB_C_API void duckdb_scalar_function_set_name(duckdb_scalar_function scalar_function, const char *name);7148#endif71497150#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)7151/*!7152 * Sets the parameters of the given scalar function to varargs. Does not require adding parameters with7153 * duckdb_scalar_function_add_parameter.7154 *7155 * history:7156 * - stable: v1.1.07157 *7158 * @param scalar_function The scalar function.7159 * @param type The type of the arguments.7160 * @return void7161 */7162DUCKDB_C_API void duckdb_scalar_function_set_varargs(duckdb_scalar_function scalar_function, duckdb_logical_type type);7163#endif71647165#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)7166/*!7167 * Sets the scalar function's null-handling behavior to special.7168 *7169 * history:7170 * - stable: v1.1.07171 *7172 * @param scalar_function The scalar function.7173 * @return void7174 */7175DUCKDB_C_API void duckdb_scalar_function_set_special_handling(duckdb_scalar_function scalar_function);7176#endif71777178#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)7179/*!7180 * Sets the Function Stability of the scalar function to VOLATILE, indicating the function should be re-run for every7181 * row. This limits optimization that can be performed for the function.7182 *7183 * history:7184 * - stable: v1.1.07185 *7186 * @param scalar_function The scalar function.7187 * @return void7188 */7189DUCKDB_C_API void duckdb_scalar_function_set_volatile(duckdb_scalar_function scalar_function);7190#endif71917192#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)7193/*!7194 * Adds a parameter to the scalar function.7195 *7196 * history:7197 * - stable: v1.1.07198 *7199 * @param scalar_function The scalar function.7200 * @param type The parameter type. Cannot contain INVALID.7201 * @return void7202 */7203DUCKDB_C_API void duckdb_scalar_function_add_parameter(duckdb_scalar_function scalar_function,7204                                                       duckdb_logical_type type);7205#endif72067207#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)7208/*!7209 * Sets the return type of the scalar function.7210 *7211 * history:7212 * - stable: v1.1.07213 *7214 * @param scalar_function The scalar function7215 * @param type Cannot contain INVALID or ANY.7216 * @return void7217 */7218DUCKDB_C_API void duckdb_scalar_function_set_return_type(duckdb_scalar_function scalar_function,7219                                                         duckdb_logical_type type);7220#endif72217222#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)7223/*!7224 * Assigns extra information to the scalar function that can be fetched during binding, etc.7225 *7226 * history:7227 * - stable: v1.1.07228 *7229 * @param scalar_function The scalar function7230 * @param extra_info The extra information7231 * @param destroy The callback that will be called to destroy the extra information (if any)7232 * @return void7233 */7234DUCKDB_C_API void duckdb_scalar_function_set_extra_info(duckdb_scalar_function scalar_function, void *extra_info,7235                                                        duckdb_delete_callback_t destroy);7236#endif72377238#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)7239/*!7240 * Sets the (optional) bind function of the scalar function.7241 *7242 * history:7243 * - unstable: v1.3.07244 * - stable: v1.5.67245 *7246 * @param scalar_function The scalar function.7247 * @param bind The bind function.7248 * @return void7249 */7250DUCKDB_C_API void duckdb_scalar_function_set_bind(duckdb_scalar_function scalar_function,7251                                                  duckdb_scalar_function_bind_t bind);7252#endif72537254#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)7255/*!7256 * Sets the user-provided bind data in the bind object of the scalar function. The bind data object can be retrieved7257 * again during execution. In most case, you also need to set the copy-callback of your bind data via7258 * duckdb_scalar_function_set_bind_data_copy.7259 *7260 * history:7261 * - unstable: v1.3.07262 * - stable: v1.5.67263 *7264 * @param info The bind info of the scalar function.7265 * @param bind_data The bind data object.7266 * @param destroy The callback to destroy the bind data (if any).7267 * @return void7268 */7269DUCKDB_C_API void duckdb_scalar_function_set_bind_data(duckdb_bind_info info, void *bind_data,7270                                                       duckdb_delete_callback_t destroy);7271#endif72727273#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)7274/*!7275 * Sets the copy-callback for the user-provided bind data in the bind object of the scalar function.7276 *7277 * history:7278 * - unstable: v1.4.07279 * - stable: v1.5.67280 *7281 * @param info The bind info of the scalar function.7282 * @param copy The callback to copy the bind data (if any).7283 * @return void7284 */7285DUCKDB_C_API void duckdb_scalar_function_set_bind_data_copy(duckdb_bind_info info, duckdb_copy_callback_t copy);7286#endif72877288#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)7289/*!7290 * Report that an error has occurred while calling bind on a scalar function.7291 *7292 * history:7293 * - unstable: v1.3.07294 * - stable: v1.5.67295 *7296 * @param info The bind info object.7297 * @param error The error message.7298 * @return void7299 */7300DUCKDB_C_API void duckdb_scalar_function_bind_set_error(duckdb_bind_info info, const char *error);7301#endif73027303#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)7304/*!7305 * Sets the main function of the scalar function.7306 *7307 * history:7308 * - stable: v1.1.07309 *7310 * @param scalar_function The scalar function7311 * @param function The function7312 * @return void7313 */7314DUCKDB_C_API void duckdb_scalar_function_set_function(duckdb_scalar_function scalar_function,7315                                                      duckdb_scalar_function_t function);7316#endif73177318#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)7319/*!7320 * Register the scalar function object within the given connection.7321 *7322 * The function requires at least a name, a function and a return type.7323 *7324 * If the function is incomplete or a function with this name already exists DuckDBError is returned.7325 *7326 * history:7327 * - stable: v1.1.07328 *7329 * @param con The connection to register it in.7330 * @param scalar_function The function pointer7331 * @return duckdb_state7332 */7333DUCKDB_C_API duckdb_state duckdb_register_scalar_function(duckdb_connection con,7334                                                          duckdb_scalar_function scalar_function);7335#endif73367337#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)7338/*!7339 * Retrieves the extra info of the function as set in `duckdb_scalar_function_set_extra_info`.7340 *7341 * history:7342 * - stable: v1.1.07343 *7344 * @param info The info object.7345 * @return void*7346 */7347DUCKDB_C_API void *duckdb_scalar_function_get_extra_info(duckdb_function_info info);7348#endif73497350#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)7351/*!7352 * Retrieves the extra info of the function as set in the bind info.7353 *7354 * history:7355 * - unstable: v1.4.07356 * - stable: v1.5.67357 *7358 * @param info The info object.7359 * @return void*7360 */7361DUCKDB_C_API void *duckdb_scalar_function_bind_get_extra_info(duckdb_bind_info info);7362#endif73637364#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)7365/*!7366 * Gets the scalar function's bind data set by `duckdb_scalar_function_set_bind_data`. Note that the bind data is7367 * read-only.7368 *7369 * history:7370 * - unstable: v1.3.07371 * - stable: v1.5.67372 *7373 * @param info The function info.7374 * @return void*7375 */7376DUCKDB_C_API void *duckdb_scalar_function_get_bind_data(duckdb_function_info info);7377#endif73787379#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)7380/*!7381 * Retrieves the client context of the bind info of a scalar function.7382 *7383 * history:7384 * - unstable: v1.3.07385 * - stable: v1.5.67386 *7387 * @param info The bind info object of the scalar function.7388 * @param out_context The client context of the bind info. Must be destroyed with `duckdb_destroy_client_context`.7389 * @return void7390 */7391DUCKDB_C_API void duckdb_scalar_function_get_client_context(duckdb_bind_info info, duckdb_client_context *out_context);7392#endif73937394#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)7395/*!7396 * Report that an error has occurred while executing the scalar function.7397 *7398 * history:7399 * - stable: v1.1.07400 *7401 * @param info The info object.7402 * @param error The error message7403 * @return void7404 */7405DUCKDB_C_API void duckdb_scalar_function_set_error(duckdb_function_info info, const char *error);7406#endif74077408#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)7409/*!7410 * Creates a new empty scalar function set.7411 *7412 * The return value must be destroyed with `duckdb_destroy_scalar_function_set`.7413 *7414 * history:7415 * - stable: v1.1.07416 *7417 * @param name7418 * @return duckdb_scalar_function_set7419 */7420DUCKDB_C_API duckdb_scalar_function_set duckdb_create_scalar_function_set(const char *name);7421#endif74227423#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)7424/*!7425 * Destroys the given scalar function set object.7426 *7427 * history:7428 * - stable: v1.1.07429 *7430 * @param scalar_function_set7431 * @return void7432 */7433DUCKDB_C_API void duckdb_destroy_scalar_function_set(duckdb_scalar_function_set *scalar_function_set);7434#endif74357436#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)7437/*!7438 * Adds the scalar function as a new overload to the scalar function set.7439 *7440 * Returns DuckDBError if the function could not be added, for example if the overload already exists.7441 *7442 * history:7443 * - stable: v1.1.07444 *7445 * @param set The scalar function set7446 * @param function The function to add7447 * @return duckdb_state7448 */7449DUCKDB_C_API duckdb_state duckdb_add_scalar_function_to_set(duckdb_scalar_function_set set,7450                                                            duckdb_scalar_function function);7451#endif74527453#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)7454/*!7455 * Register the scalar function set within the given connection.7456 *7457 * The set requires at least a single valid overload.7458 *7459 * If the set is incomplete or a function with this name already exists DuckDBError is returned.7460 *7461 * history:7462 * - stable: v1.1.07463 *7464 * @param con The connection to register it in.7465 * @param set The function set to register7466 * @return duckdb_state7467 */7468DUCKDB_C_API duckdb_state duckdb_register_scalar_function_set(duckdb_connection con, duckdb_scalar_function_set set);7469#endif74707471#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)7472/*!7473 * Returns the number of input arguments of the scalar function.7474 *7475 * history:7476 * - unstable: v1.4.07477 * - stable: v1.5.67478 *7479 * @param info The bind info.7480 * @return idx_t7481 */7482DUCKDB_C_API idx_t duckdb_scalar_function_bind_get_argument_count(duckdb_bind_info info);7483#endif74847485#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)7486/*!7487 * Returns the input argument at index of the scalar function.7488 *7489 * history:7490 * - unstable: v1.4.07491 * - stable: v1.5.67492 *7493 * @param info The bind info.7494 * @param index The argument index.7495 * @return duckdb_expression7496 */7497DUCKDB_C_API duckdb_expression duckdb_scalar_function_bind_get_argument(duckdb_bind_info info, idx_t index);7498#endif74997500#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)7501/*!7502 * Retrieves the state pointer of the function info.7503 *7504 * history:7505 * - unstable: v1.5.07506 * - stable: v1.5.67507 *7508 * @param info The function info object.7509 * @return void*7510 */7511DUCKDB_C_API void *duckdb_scalar_function_get_state(duckdb_function_info info);7512#endif75137514#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)7515/*!7516 * Sets the (optional) state init function of the scalar function. This is called once for each worker thread that7517 * begins executing the function7518 *7519 * history:7520 * - unstable: v1.5.07521 * - stable: v1.5.67522 *7523 * @param scalar_function The scalar function.7524 * @param init The init function.7525 * @return void7526 */7527DUCKDB_C_API void duckdb_scalar_function_set_init(duckdb_scalar_function scalar_function,7528                                                  duckdb_scalar_function_init_t init);7529#endif75307531#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)7532/*!7533 * Report that an error has occurred while calling init on a scalar function.7534 *7535 * history:7536 * - unstable: v1.5.07537 * - stable: v1.5.67538 *7539 * @param info The init info object.7540 * @param error The error message.7541 * @return void7542 */7543DUCKDB_C_API void duckdb_scalar_function_init_set_error(duckdb_init_info info, const char *error);7544#endif75457546#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)7547/*!7548 * Sets the state pointer in the init info of the scalar function.7549 *7550 * history:7551 * - unstable: v1.5.07552 * - stable: v1.5.67553 *7554 * @param info The init info object.7555 * @param state The state pointer.7556 * @param destroy The callback to destroy the state (if any).7557 * @return void7558 */7559DUCKDB_C_API void duckdb_scalar_function_init_set_state(duckdb_init_info info, void *state,7560                                                        duckdb_delete_callback_t destroy);7561#endif75627563#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)7564/*!7565 * Retrieves the client context of the init info of a scalar function.7566 *7567 * history:7568 * - unstable: v1.5.07569 * - stable: v1.5.67570 *7571 * @param info The init info object of the scalar function.7572 * @param out_context The client context of the init info. Must be destroyed with `duckdb_destroy_client_context`.7573 * @return void7574 */7575DUCKDB_C_API void duckdb_scalar_function_init_get_client_context(duckdb_init_info info,7576                                                                 duckdb_client_context *out_context);7577#endif75787579#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)7580/*!7581 * Gets the scalar function's bind data set by `duckdb_scalar_function_set_bind_data`. Note that the bind data is7582 * read-only.7583 *7584 * history:7585 * - unstable: v1.5.07586 * - stable: v1.5.67587 *7588 * @param info The init info object.7589 * @return void*7590 */7591DUCKDB_C_API void *duckdb_scalar_function_init_get_bind_data(duckdb_init_info info);7592#endif75937594#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)7595/*!7596 * Retrieves the extra info of the function as set in the init info.7597 *7598 * history:7599 * - unstable: v1.5.07600 * - stable: v1.5.67601 *7602 * @param info The init info object.7603 * @return void*7604 */7605DUCKDB_C_API void *duckdb_scalar_function_init_get_extra_info(duckdb_init_info info);7606#endif76077608/* --- Struct definitions for scalar_function --- */76097610/* ============================================================================7611 * MODULE: table_description7612 * ============================================================================ */76137614/* --- Enums for table_description --- */76157616/* --- Struct forward declarations for table_description --- */76177618/* --- Types for table_description --- */76197620/* --- Constants for table_description --- */76217622/* --- Function pointer typedefs for table_description --- */76237624/* --- Functions for table_description --- */76257626#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)7627/*!7628 * Creates a table description object. Note that `duckdb_table_description_destroy` should always be called on the7629 * resulting table_description, even if the function returns `DuckDBError`.7630 *7631 * history:7632 * - stable: v1.1.07633 *7634 * @param connection The connection context.7635 * @param schema The schema of the table, or `nullptr` for the default schema.7636 * @param table The table name.7637 * @param out The resulting table description object.7638 * @return duckdb_state7639 */7640DUCKDB_C_API duckdb_state duckdb_table_description_create(duckdb_connection connection, const char *schema,7641                                                          const char *table, duckdb_table_description *out);7642#endif76437644#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)7645/*!7646 * Creates a table description object. Note that `duckdb_table_description_destroy` must be called on the resulting7647 * table_description, even if the function returns `DuckDBError`.7648 *7649 * history:7650 * - stable: v1.2.07651 *7652 * @param connection The connection context.7653 * @param catalog The catalog (database) name of the table, or `nullptr` for the default catalog.7654 * @param schema The schema of the table, or `nullptr` for the default schema.7655 * @param table The table name.7656 * @param out The resulting table description object.7657 * @return duckdb_state7658 */7659DUCKDB_C_API duckdb_state duckdb_table_description_create_ext(duckdb_connection connection, const char *catalog,7660                                                              const char *schema, const char *table,7661                                                              duckdb_table_description *out);7662#endif76637664#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)7665/*!7666 * Destroy the TableDescription object.7667 *7668 * history:7669 * - stable: v1.1.07670 *7671 * @param table_description The table_description to destroy.7672 * @return void7673 */7674DUCKDB_C_API void duckdb_table_description_destroy(duckdb_table_description *table_description);7675#endif76767677#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)7678/*!7679 * Returns the error message associated with the given table_description. If the table_description has no error message,7680 * this returns `nullptr` instead. The error message should not be freed. It will be de-allocated when7681 * `duckdb_table_description_destroy` is called.7682 *7683 * history:7684 * - stable: v1.1.07685 *7686 * @param table_description The table_description to get the error from.7687 * @return const char*7688 */7689DUCKDB_C_API const char *duckdb_table_description_error(duckdb_table_description table_description);7690#endif76917692#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)7693/*!7694 * Check if the column at 'index' index of the table has a DEFAULT expression.7695 *7696 * history:7697 * - stable: v1.1.07698 *7699 * @param table_description The table_description to query.7700 * @param index The index of the column to query.7701 * @param out The out-parameter used to store the result.7702 * @return duckdb_state7703 */7704DUCKDB_C_API duckdb_state duckdb_column_has_default(duckdb_table_description table_description, idx_t index, bool *out);7705#endif77067707#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)7708/*!7709 * Return the number of columns of the described table.7710 *7711 * history:7712 * - unstable: v1.5.07713 * - stable: v1.5.67714 *7715 * @param table_description The table_description to query.7716 * @return idx_t7717 */7718DUCKDB_C_API idx_t duckdb_table_description_get_column_count(duckdb_table_description table_description);7719#endif77207721#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)7722/*!7723 * Obtain the column name at 'index'. The out result must be destroyed with `duckdb_free`.7724 *7725 * history:7726 * - stable: v1.2.07727 *7728 * @param table_description The table_description to query.7729 * @param index The index of the column to query.7730 * @return char*7731 */7732DUCKDB_C_API char *duckdb_table_description_get_column_name(duckdb_table_description table_description, idx_t index);7733#endif77347735#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)7736/*!7737 * Obtain the column type at 'index'. The return value must be destroyed with `duckdb_destroy_logical_type`.7738 *7739 * history:7740 * - unstable: v1.5.07741 * - stable: v1.5.67742 *7743 * @param table_description The table_description to query.7744 * @param index The index of the column to query.7745 * @return duckdb_logical_type7746 */7747DUCKDB_C_API duckdb_logical_type duckdb_table_description_get_column_type(duckdb_table_description table_description,7748                                                                          idx_t index);7749#endif77507751/* --- Struct definitions for table_description --- */77527753/* ============================================================================7754 * MODULE: table_function7755 * ============================================================================ */77567757/* --- Enums for table_function --- */77587759/* --- Struct forward declarations for table_function --- */77607761/* --- Types for table_function --- */77627763/* --- Constants for table_function --- */77647765/* --- Function pointer typedefs for table_function --- */77667767/* --- Functions for table_function --- */77687769#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)7770/*!7771 * Creates a new empty table function.7772 *7773 * The return value should be destroyed with `duckdb_destroy_table_function`.7774 *7775 * history:7776 * - stable: v0.3.37777 *7778 * @return duckdb_table_function7779 */7780DUCKDB_C_API duckdb_table_function duckdb_create_table_function(void);7781#endif77827783#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)7784/*!7785 * Destroys the given table function object.7786 *7787 * history:7788 * - stable: v0.3.37789 *7790 * @param table_function The table function to destroy7791 * @return void7792 */7793DUCKDB_C_API void duckdb_destroy_table_function(duckdb_table_function *table_function);7794#endif77957796#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)7797/*!7798 * Sets the name of the given table function.7799 *7800 * history:7801 * - stable: v0.3.37802 *7803 * @param table_function The table function7804 * @param name The name of the table function7805 * @return void7806 */7807DUCKDB_C_API void duckdb_table_function_set_name(duckdb_table_function table_function, const char *name);7808#endif78097810#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)7811/*!7812 * Adds a parameter to the table function.7813 *7814 * history:7815 * - stable: v0.3.37816 *7817 * @param table_function The table function.7818 * @param type The parameter type. Cannot contain INVALID.7819 * @return void7820 */7821DUCKDB_C_API void duckdb_table_function_add_parameter(duckdb_table_function table_function, duckdb_logical_type type);7822#endif78237824#if DUCKDB_API_VERSION_AT_LEAST(0, 8, 0)7825/*!7826 * Adds a named parameter to the table function.7827 *7828 * history:7829 * - stable: v0.8.07830 *7831 * @param table_function The table function.7832 * @param name The parameter name.7833 * @param type The parameter type. Cannot contain INVALID.7834 * @return void7835 */7836DUCKDB_C_API void duckdb_table_function_add_named_parameter(duckdb_table_function table_function, const char *name,7837                                                            duckdb_logical_type type);7838#endif78397840#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)7841/*!7842 * Assigns extra information to the table function that can be fetched during binding, etc.7843 *7844 * history:7845 * - stable: v0.3.37846 *7847 * @param table_function The table function7848 * @param extra_info The extra information7849 * @param destroy The callback that will be called to destroy the extra information (if any)7850 * @return void7851 */7852DUCKDB_C_API void duckdb_table_function_set_extra_info(duckdb_table_function table_function, void *extra_info,7853                                                       duckdb_delete_callback_t destroy);7854#endif78557856#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)7857/*!7858 * Sets the bind function of the table function.7859 *7860 * history:7861 * - stable: v0.3.37862 *7863 * @param table_function The table function7864 * @param bind The bind function7865 * @return void7866 */7867DUCKDB_C_API void duckdb_table_function_set_bind(duckdb_table_function table_function,7868                                                 duckdb_table_function_bind_t bind);7869#endif78707871#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)7872/*!7873 * Sets the init function of the table function.7874 *7875 * history:7876 * - stable: v0.3.37877 *7878 * @param table_function The table function7879 * @param init The init function7880 * @return void7881 */7882DUCKDB_C_API void duckdb_table_function_set_init(duckdb_table_function table_function,7883                                                 duckdb_table_function_init_t init);7884#endif78857886#if DUCKDB_API_VERSION_AT_LEAST(0, 4, 0)7887/*!7888 * Sets the thread-local init function of the table function.7889 *7890 * history:7891 * - stable: v0.4.07892 *7893 * @param table_function The table function7894 * @param init The init function7895 * @return void7896 */7897DUCKDB_C_API void duckdb_table_function_set_local_init(duckdb_table_function table_function,7898                                                       duckdb_table_function_init_t init);7899#endif79007901#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)7902/*!7903 * Sets the main function of the table function.7904 *7905 * history:7906 * - stable: v0.3.37907 *7908 * @param table_function The table function7909 * @param function The function7910 * @return void7911 */7912DUCKDB_C_API void duckdb_table_function_set_function(duckdb_table_function table_function,7913                                                     duckdb_table_function_t function);7914#endif79157916#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)7917/*!7918 * Sets whether or not the given table function supports projection pushdown.7919 *7920 * If this is set to true, the system will provide a list of all required columns in the `init` stage through the7921 * `duckdb_init_get_column_count` and `duckdb_init_get_column_index` functions. If this is set to false (the default),7922 * the system will expect all columns to be projected.7923 *7924 * history:7925 * - stable: v0.3.37926 *7927 * @param table_function The table function7928 * @param pushdown True if the table function supports projection pushdown, false otherwise.7929 * @return void7930 */7931DUCKDB_C_API void duckdb_table_function_supports_projection_pushdown(duckdb_table_function table_function,7932                                                                     bool pushdown);7933#endif79347935#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)7936/*!7937 * Register the table function object within the given connection.7938 *7939 * The function requires at least a name, a bind function, an init function and a main function.7940 *7941 * If the function is incomplete or a function with this name already exists DuckDBError is returned.7942 *7943 * history:7944 * - stable: v0.3.37945 *7946 * @param con The connection to register it in.7947 * @param function The function pointer7948 * @return duckdb_state7949 */7950DUCKDB_C_API duckdb_state duckdb_register_table_function(duckdb_connection con, duckdb_table_function function);7951#endif79527953#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)7954/*!7955 * Retrieves the extra info of the function as set in `duckdb_table_function_set_extra_info`.7956 *7957 * history:7958 * - stable: v0.3.37959 *7960 * @param info The info object7961 * @return void*7962 */7963DUCKDB_C_API void *duckdb_bind_get_extra_info(duckdb_bind_info info);7964#endif79657966#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)7967/*!7968 * Retrieves the client context of the bind info of a table function.7969 *7970 * history:7971 * - unstable: v1.4.07972 * - stable: v1.5.67973 *7974 * @param info The bind info object of the table function.7975 * @param out_context The client context of the bind info. Must be destroyed with `duckdb_destroy_client_context`.7976 * @return void7977 */7978DUCKDB_C_API void duckdb_table_function_get_client_context(duckdb_bind_info info, duckdb_client_context *out_context);7979#endif79807981#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)7982/*!7983 * Adds a result column to the output of the table function.7984 *7985 * history:7986 * - stable: v0.3.37987 *7988 * @param info The table function's bind info.7989 * @param name The column name.7990 * @param type The logical column type.7991 * @return void7992 */7993DUCKDB_C_API void duckdb_bind_add_result_column(duckdb_bind_info info, const char *name, duckdb_logical_type type);7994#endif79957996#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)7997/*!7998 * Retrieves the number of regular (non-named) parameters to the function.7999 *8000 * history:8001 * - stable: v0.3.38002 *8003 * @param info The info object8004 * @return idx_t8005 */8006DUCKDB_C_API idx_t duckdb_bind_get_parameter_count(duckdb_bind_info info);8007#endif80088009#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)8010/*!8011 * Retrieves the parameter at the given index.8012 *8013 * The result must be destroyed with `duckdb_destroy_value`.8014 *8015 * history:8016 * - stable: v0.3.38017 *8018 * @param info The info object8019 * @param index The index of the parameter to get8020 * @return duckdb_value8021 */8022DUCKDB_C_API duckdb_value duckdb_bind_get_parameter(duckdb_bind_info info, idx_t index);8023#endif80248025#if DUCKDB_API_VERSION_AT_LEAST(0, 8, 0)8026/*!8027 * Retrieves a named parameter with the given name.8028 *8029 * The result must be destroyed with `duckdb_destroy_value`.8030 *8031 * history:8032 * - stable: v0.8.08033 *8034 * @param info The info object8035 * @param name The name of the parameter8036 * @return duckdb_value8037 */8038DUCKDB_C_API duckdb_value duckdb_bind_get_named_parameter(duckdb_bind_info info, const char *name);8039#endif80408041#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)8042/*!8043 * Sets the user-provided bind data in the bind object of the table function. This object can be retrieved again during8044 * execution.8045 *8046 * history:8047 * - stable: v0.3.38048 *8049 * @param info The bind info of the table function.8050 * @param bind_data The bind data object.8051 * @param destroy The callback to destroy the bind data (if any).8052 * @return void8053 */8054DUCKDB_C_API void duckdb_bind_set_bind_data(duckdb_bind_info info, void *bind_data, duckdb_delete_callback_t destroy);8055#endif80568057#if DUCKDB_API_VERSION_AT_LEAST(0, 5, 0)8058/*!8059 * Sets the cardinality estimate for the table function, used for optimization.8060 *8061 * history:8062 * - stable: v0.5.08063 *8064 * @param info The bind data object.8065 * @param cardinality8066 * @param is_exact Whether or not the cardinality estimate is exact, or an approximation8067 * @return void8068 */8069DUCKDB_C_API void duckdb_bind_set_cardinality(duckdb_bind_info info, idx_t cardinality, bool is_exact);8070#endif80718072#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)8073/*!8074 * Report that an error has occurred while calling bind on a table function.8075 *8076 * history:8077 * - stable: v0.3.38078 *8079 * @param info The info object8080 * @param error The error message8081 * @return void8082 */8083DUCKDB_C_API void duckdb_bind_set_error(duckdb_bind_info info, const char *error);8084#endif80858086#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)8087/*!8088 * Retrieves the extra info of the function as set in `duckdb_table_function_set_extra_info`.8089 *8090 * history:8091 * - stable: v0.3.38092 *8093 * @param info The info object8094 * @return void*8095 */8096DUCKDB_C_API void *duckdb_init_get_extra_info(duckdb_init_info info);8097#endif80988099#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)8100/*!8101 * Gets the bind data set by `duckdb_bind_set_bind_data` during the bind.8102 *8103 * Note that the bind data should be considered as read-only. For tracking state, use the init data instead.8104 *8105 * history:8106 * - stable: v0.3.38107 *8108 * @param info The info object8109 * @return void*8110 */8111DUCKDB_C_API void *duckdb_init_get_bind_data(duckdb_init_info info);8112#endif81138114#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)8115/*!8116 * Sets the user-provided init data in the init object. This object can be retrieved again during execution.8117 *8118 * history:8119 * - stable: v0.3.38120 *8121 * @param info The info object8122 * @param init_data The init data object.8123 * @param destroy The callback that will be called to destroy the init data (if any)8124 * @return void8125 */8126DUCKDB_C_API void duckdb_init_set_init_data(duckdb_init_info info, void *init_data, duckdb_delete_callback_t destroy);8127#endif81288129#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)8130/*!8131 * Returns the number of projected columns.8132 *8133 * This function must be used if projection pushdown is enabled to figure out which columns to emit.8134 *8135 * history:8136 * - stable: v0.3.38137 *8138 * @param info The info object8139 * @return idx_t8140 */8141DUCKDB_C_API idx_t duckdb_init_get_column_count(duckdb_init_info info);8142#endif81438144#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)8145/*!8146 * Returns the column index of the projected column at the specified position.8147 *8148 * This function must be used if projection pushdown is enabled to figure out which columns to emit.8149 *8150 * history:8151 * - stable: v0.3.38152 *8153 * @param info The info object8154 * @param column_index The index at which to get the projected column index, from 0..duckdb_init_get_column_count(info)8155 * @return idx_t8156 */8157DUCKDB_C_API idx_t duckdb_init_get_column_index(duckdb_init_info info, idx_t column_index);8158#endif81598160#if DUCKDB_API_VERSION_AT_LEAST(0, 4, 0)8161/*!8162 * Sets how many threads can process this table function in parallel (default: 1)8163 *8164 * history:8165 * - stable: v0.4.08166 *8167 * @param info The info object8168 * @param max_threads The maximum amount of threads that can process this table function8169 * @return void8170 */8171DUCKDB_C_API void duckdb_init_set_max_threads(duckdb_init_info info, idx_t max_threads);8172#endif81738174#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)8175/*!8176 * Report that an error has occurred while calling init.8177 *8178 * history:8179 * - stable: v0.3.38180 *8181 * @param info The info object8182 * @param error The error message8183 * @return void8184 */8185DUCKDB_C_API void duckdb_init_set_error(duckdb_init_info info, const char *error);8186#endif81878188#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)8189/*!8190 * Retrieves the extra info of the function as set in `duckdb_table_function_set_extra_info`.8191 *8192 * history:8193 * - stable: v0.3.38194 *8195 * @param info The info object8196 * @return void*8197 */8198DUCKDB_C_API void *duckdb_function_get_extra_info(duckdb_function_info info);8199#endif82008201#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)8202/*!8203 * Gets the table function's bind data set by `duckdb_bind_set_bind_data`.8204 *8205 * Note that the bind data is read-only. For tracking state, use the init data instead.8206 *8207 * history:8208 * - stable: v0.3.38209 *8210 * @param info The function info object.8211 * @return void*8212 */8213DUCKDB_C_API void *duckdb_function_get_bind_data(duckdb_function_info info);8214#endif82158216#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)8217/*!8218 * Gets the init data set by `duckdb_init_set_init_data` during the init.8219 *8220 * history:8221 * - stable: v0.3.38222 *8223 * @param info The info object8224 * @return void*8225 */8226DUCKDB_C_API void *duckdb_function_get_init_data(duckdb_function_info info);8227#endif82288229#if DUCKDB_API_VERSION_AT_LEAST(0, 4, 0)8230/*!8231 * Gets the thread-local init data set by `duckdb_init_set_init_data` during the local_init.8232 *8233 * history:8234 * - stable: v0.4.08235 *8236 * @param info The info object8237 * @return void*8238 */8239DUCKDB_C_API void *duckdb_function_get_local_init_data(duckdb_function_info info);8240#endif82418242#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)8243/*!8244 * Report that an error has occurred while executing the function.8245 *8246 * history:8247 * - stable: v0.3.38248 *8249 * @param info The info object8250 * @param error The error message8251 * @return void8252 */8253DUCKDB_C_API void duckdb_function_set_error(duckdb_function_info info, const char *error);8254#endif82558256#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)8257/*!8258 * Retrieves the number of result columns of a table function.8259 *8260 * If the table function is used in a `COPY ... FROM` statement, this can be used to retrieve the number of columns in8261 * the target table at the start of the bind callback.8262 *8263 * history:8264 * - unstable: v1.5.08265 * - stable: v1.5.68266 *8267 * @param info The bind info provided to the bind function8268 * @return idx_t8269 */8270DUCKDB_C_API idx_t duckdb_table_function_bind_get_result_column_count(duckdb_bind_info info);8271#endif82728273#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)8274/*!8275 * Retrieves the name of a result column of a table function.8276 *8277 * If the table function is used in a `COPY ... FROM` statement, this can be used to retrieve the names of the columns8278 * in the target table at the start of the bind callback.8279 *8280 * The result is valid for the duration of the bind callback or until the next call to `duckdb_bind_add_result_column`,8281 * so it must not be destroyed.8282 *8283 * history:8284 * - unstable: v1.5.08285 * - stable: v1.5.68286 *8287 * @param info The bind info provided to the bind function8288 * @param col_idx The index of the result column to retrieve the name for8289 * @return const char*8290 */8291DUCKDB_C_API const char *duckdb_table_function_bind_get_result_column_name(duckdb_bind_info info, idx_t col_idx);8292#endif82938294#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)8295/*!8296 * Retrieves the type of a result column of a table function.8297 *8298 * If the table function is used in a `COPY ... FROM` statement, this can be used to retrieve the types of the columns8299 * in the target table at the start of the bind callback.8300 *8301 * The result must be destroyed with `duckdb_destroy_logical_type`.8302 *8303 * history:8304 * - unstable: v1.5.08305 * - stable: v1.5.68306 *8307 * @param info The bind info provided to the bind function8308 * @param col_idx The index of the result column to retrieve the type for8309 * @return duckdb_logical_type8310 */8311DUCKDB_C_API duckdb_logical_type duckdb_table_function_bind_get_result_column_type(duckdb_bind_info info,8312                                                                                   idx_t col_idx);8313#endif83148315/* --- Struct definitions for table_function --- */83168317/* ============================================================================8318 * MODULE: threading8319 * ============================================================================ */83208321/* --- Enums for threading --- */83228323/* --- Struct forward declarations for threading --- */83248325/* --- Types for threading --- */83268327/* --- Constants for threading --- */83288329/* --- Function pointer typedefs for threading --- */83308331/* --- Functions for threading --- */83328333#if DUCKDB_API_VERSION_AT_LEAST(0, 4, 0)8334/*!8335 * Execute DuckDB tasks on this thread.8336 *8337 * Will return after `max_tasks` have been executed, or if there are no more tasks present.8338 *8339 * history:8340 * - stable: v0.4.08341 *8342 * @param database The database object to execute tasks for8343 * @param max_tasks The maximum amount of tasks to execute8344 * @return void8345 */8346DUCKDB_C_API void duckdb_execute_tasks(duckdb_database database, idx_t max_tasks);8347#endif83488349#if DUCKDB_API_VERSION_AT_LEAST(0, 5, 0)8350/*!8351 * Creates a task state that can be used with duckdb_execute_tasks_state to execute tasks until8352 * `duckdb_finish_execution` is called on the state.8353 *8354 * `duckdb_destroy_state` must be called on the result.8355 *8356 * history:8357 * - stable: v0.5.08358 *8359 * @param database The database object to create the task state for8360 * @return duckdb_task_state8361 */8362DUCKDB_C_API duckdb_task_state duckdb_create_task_state(duckdb_database database);8363#endif83648365#if DUCKDB_API_VERSION_AT_LEAST(0, 5, 0)8366/*!8367 * Execute DuckDB tasks on this thread.8368 *8369 * The thread will keep on executing tasks forever, until duckdb_finish_execution is called on the state. Multiple8370 * threads can share the same duckdb_task_state.8371 *8372 * history:8373 * - stable: v0.5.08374 *8375 * @param state The task state of the executor8376 * @return void8377 */8378DUCKDB_C_API void duckdb_execute_tasks_state(duckdb_task_state state);8379#endif83808381#if DUCKDB_API_VERSION_AT_LEAST(0, 5, 0)8382/*!8383 * Execute DuckDB tasks on this thread.8384 *8385 * The thread will keep on executing tasks until either duckdb_finish_execution is called on the state, max_tasks tasks8386 * have been executed or there are no more tasks to be executed.8387 *8388 * Multiple threads can share the same duckdb_task_state.8389 *8390 * history:8391 * - stable: v0.5.08392 *8393 * @param state The task state of the executor8394 * @param max_tasks The maximum amount of tasks to execute8395 * @return idx_t8396 */8397DUCKDB_C_API idx_t duckdb_execute_n_tasks_state(duckdb_task_state state, idx_t max_tasks);8398#endif83998400#if DUCKDB_API_VERSION_AT_LEAST(0, 5, 0)8401/*!8402 * Finish execution on a specific task.8403 *8404 * history:8405 * - stable: v0.5.08406 *8407 * @param state The task state to finish execution8408 * @return void8409 */8410DUCKDB_C_API void duckdb_finish_execution(duckdb_task_state state);8411#endif84128413#if DUCKDB_API_VERSION_AT_LEAST(0, 5, 0)8414/*!8415 * Check if the provided duckdb_task_state has finished execution8416 *8417 * history:8418 * - stable: v0.5.08419 *8420 * @param state The task state to inspect8421 * @return bool8422 */8423DUCKDB_C_API bool duckdb_task_state_is_finished(duckdb_task_state state);8424#endif84258426#if DUCKDB_API_VERSION_AT_LEAST(0, 5, 0)8427/*!8428 * Destroys the task state returned from duckdb_create_task_state.8429 *8430 * Note that this should not be called while there is an active duckdb_execute_tasks_state running on the task state.8431 *8432 * history:8433 * - stable: v0.5.08434 *8435 * @param state The task state to clean up8436 * @return void8437 */8438DUCKDB_C_API void duckdb_destroy_task_state(duckdb_task_state state);8439#endif84408441#if DUCKDB_API_VERSION_AT_LEAST(0, 7, 0)8442/*!8443 * Returns true if the execution of the current query is finished.8444 *8445 * history:8446 * - stable: v0.7.08447 *8448 * @param con The connection on which to check8449 * @return bool8450 */8451DUCKDB_C_API bool duckdb_execution_is_finished(duckdb_connection con);8452#endif84538454/* --- Struct definitions for threading --- */84558456/* ============================================================================8457 * MODULE: value8458 * ============================================================================ */84598460/* --- Enums for value --- */84618462/* --- Struct forward declarations for value --- */84638464/* --- Types for value --- */84658466/* --- Constants for value --- */84678468/* --- Function pointer typedefs for value --- */84698470/* --- Functions for value --- */84718472#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)8473/*!8474 * Destroys the value and de-allocates all memory allocated for that type.8475 *8476 * history:8477 * - stable: v0.3.38478 *8479 * @param value The value to destroy.8480 * @return void8481 */8482DUCKDB_C_API void duckdb_destroy_value(duckdb_value *value);8483#endif84848485#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)8486/*!8487 * Creates a value from a null-terminated string. Returns nullptr if the string is not valid UTF-8 or other invalid8488 * input.8489 *8490 * Superseded by `duckdb_create_varchar_length`.8491 *8492 * history:8493 * - stable: v0.3.38494 *8495 * @param text The null-terminated string8496 * @return duckdb_value8497 */8498DUCKDB_C_API duckdb_value duckdb_create_varchar(const char *text);8499#endif85008501#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)8502/*!8503 * Creates a value from a string. Returns nullptr if the string is not valid UTF-8 or other invalid input.8504 *8505 * history:8506 * - stable: v0.3.38507 *8508 * @param text The text8509 * @param length The length of the text8510 * @return duckdb_value8511 */8512DUCKDB_C_API duckdb_value duckdb_create_varchar_length(const char *text, idx_t length);8513#endif85148515#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)8516/*!8517 * Creates a value from a boolean8518 *8519 * history:8520 * - stable: v1.1.08521 *8522 * @param input The boolean value8523 * @return duckdb_value8524 */8525DUCKDB_C_API duckdb_value duckdb_create_bool(bool input);8526#endif85278528#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)8529/*!8530 * Creates a value from an int8_t (a tinyint)8531 *8532 * history:8533 * - stable: v1.1.08534 *8535 * @param input The tinyint value8536 * @return duckdb_value8537 */8538DUCKDB_C_API duckdb_value duckdb_create_int8(int8_t input);8539#endif85408541#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)8542/*!8543 * Creates a value from a uint8_t (a utinyint)8544 *8545 * history:8546 * - stable: v1.1.08547 *8548 * @param input The utinyint value8549 * @return duckdb_value8550 */8551DUCKDB_C_API duckdb_value duckdb_create_uint8(uint8_t input);8552#endif85538554#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)8555/*!8556 * Creates a value from an int16_t (a smallint)8557 *8558 * history:8559 * - stable: v1.1.08560 *8561 * @param input The smallint value8562 * @return duckdb_value8563 */8564DUCKDB_C_API duckdb_value duckdb_create_int16(int16_t input);8565#endif85668567#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)8568/*!8569 * Creates a value from a uint16_t (a usmallint)8570 *8571 * history:8572 * - stable: v1.1.08573 *8574 * @param input The usmallint value8575 * @return duckdb_value8576 */8577DUCKDB_C_API duckdb_value duckdb_create_uint16(uint16_t input);8578#endif85798580#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)8581/*!8582 * Creates a value from an int32_t (an integer)8583 *8584 * history:8585 * - stable: v1.1.08586 *8587 * @param input The integer value8588 * @return duckdb_value8589 */8590DUCKDB_C_API duckdb_value duckdb_create_int32(int32_t input);8591#endif85928593#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)8594/*!8595 * Creates a value from a uint32_t (a uinteger)8596 *8597 * history:8598 * - stable: v1.1.08599 *8600 * @param input The uinteger value8601 * @return duckdb_value8602 */8603DUCKDB_C_API duckdb_value duckdb_create_uint32(uint32_t input);8604#endif86058606#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)8607/*!8608 * Creates a value from a uint64_t (a ubigint)8609 *8610 * history:8611 * - stable: v1.1.08612 *8613 * @param input The ubigint value8614 * @return duckdb_value8615 */8616DUCKDB_C_API duckdb_value duckdb_create_uint64(uint64_t input);8617#endif86188619#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)8620/*!8621 * Creates a value from an int648622 *8623 * history:8624 * - stable: v0.3.38625 *8626 * @param val8627 * @return duckdb_value8628 */8629DUCKDB_C_API duckdb_value duckdb_create_int64(int64_t val);8630#endif86318632#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)8633/*!8634 * Creates a value from a hugeint8635 *8636 * history:8637 * - stable: v1.1.08638 *8639 * @param input The hugeint value8640 * @return duckdb_value8641 */8642DUCKDB_C_API duckdb_value duckdb_create_hugeint(duckdb_hugeint input);8643#endif86448645#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)8646/*!8647 * Creates a value from a uhugeint8648 *8649 * history:8650 * - stable: v1.1.08651 *8652 * @param input The uhugeint value8653 * @return duckdb_value8654 */8655DUCKDB_C_API duckdb_value duckdb_create_uhugeint(duckdb_uhugeint input);8656#endif86578658#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)8659/*!8660 * Creates a BIGNUM value from a duckdb_bignum8661 *8662 * history:8663 * - stable: v1.2.08664 *8665 * @param input The duckdb_bignum value8666 * @return duckdb_value8667 */8668DUCKDB_C_API duckdb_value duckdb_create_bignum(duckdb_bignum input);8669#endif86708671#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)8672/*!8673 * Creates a DECIMAL value from a duckdb_decimal8674 *8675 * history:8676 * - stable: v1.2.08677 *8678 * @param input The duckdb_decimal value8679 * @return duckdb_value8680 */8681DUCKDB_C_API duckdb_value duckdb_create_decimal(duckdb_decimal input);8682#endif86838684#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)8685/*!8686 * Creates a value from a float8687 *8688 * history:8689 * - stable: v1.1.08690 *8691 * @param input The float value8692 * @return duckdb_value8693 */8694DUCKDB_C_API duckdb_value duckdb_create_float(float input);8695#endif86968697#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)8698/*!8699 * Creates a value from a double8700 *8701 * history:8702 * - stable: v1.1.08703 *8704 * @param input The double value8705 * @return duckdb_value8706 */8707DUCKDB_C_API duckdb_value duckdb_create_double(double input);8708#endif87098710#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)8711/*!8712 * Creates a value from a date8713 *8714 * history:8715 * - stable: v1.1.08716 *8717 * @param input The date value8718 * @return duckdb_value8719 */8720DUCKDB_C_API duckdb_value duckdb_create_date(duckdb_date input);8721#endif87228723#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)8724/*!8725 * Creates a value from a time8726 *8727 * history:8728 * - stable: v1.1.08729 *8730 * @param input The time value8731 * @return duckdb_value8732 */8733DUCKDB_C_API duckdb_value duckdb_create_time(duckdb_time input);8734#endif87358736#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)8737/*!8738 * Creates a value from a time_ns8739 *8740 * history:8741 * - unstable: v1.4.08742 * - stable: v1.5.68743 *8744 * @param input The time value8745 * @return duckdb_value8746 */8747DUCKDB_C_API duckdb_value duckdb_create_time_ns(duckdb_time_ns input);8748#endif87498750#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)8751/*!8752 * Creates a value from a time_tz. Not to be confused with `duckdb_create_time_tz`, which creates a duckdb_time_tz_t.8753 *8754 * history:8755 * - stable: v1.1.08756 *8757 * @param value The time_tz value8758 * @return duckdb_value8759 */8760DUCKDB_C_API duckdb_value duckdb_create_time_tz_value(duckdb_time_tz value);8761#endif87628763#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)8764/*!8765 * Creates a TIMESTAMP value from a duckdb_timestamp8766 *8767 * history:8768 * - stable: v1.1.08769 *8770 * @param input The duckdb_timestamp value8771 * @return duckdb_value8772 */8773DUCKDB_C_API duckdb_value duckdb_create_timestamp(duckdb_timestamp input);8774#endif87758776#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)8777/*!8778 * Creates a TIMESTAMP_TZ value from a duckdb_timestamp8779 *8780 * history:8781 * - stable: v1.2.08782 *8783 * @param input The duckdb_timestamp value8784 * @return duckdb_value8785 */8786DUCKDB_C_API duckdb_value duckdb_create_timestamp_tz(duckdb_timestamp input);8787#endif87888789#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)8790/*!8791 * Creates a TIMESTAMP_TZ_NS value from a duckdb_timestamp_ns8792 *8793 * history:8794 * - unstable: v1.5.48795 * - stable: v1.5.68796 *8797 * @param input The duckdb_timestamp_ns value8798 * @return duckdb_value8799 */8800DUCKDB_C_API duckdb_value duckdb_create_timestamp_tz_ns(duckdb_timestamp_ns input);8801#endif88028803#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)8804/*!8805 * Creates a TIMESTAMP_S value from a duckdb_timestamp_s8806 *8807 * history:8808 * - stable: v1.2.08809 *8810 * @param input The duckdb_timestamp_s value8811 * @return duckdb_value8812 */8813DUCKDB_C_API duckdb_value duckdb_create_timestamp_s(duckdb_timestamp_s input);8814#endif88158816#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)8817/*!8818 * Creates a TIMESTAMP_MS value from a duckdb_timestamp_ms8819 *8820 * history:8821 * - stable: v1.2.08822 *8823 * @param input The duckdb_timestamp_ms value8824 * @return duckdb_value8825 */8826DUCKDB_C_API duckdb_value duckdb_create_timestamp_ms(duckdb_timestamp_ms input);8827#endif88288829#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)8830/*!8831 * Creates a TIMESTAMP_NS value from a duckdb_timestamp_ns8832 *8833 * history:8834 * - stable: v1.2.08835 *8836 * @param input The duckdb_timestamp_ns value8837 * @return duckdb_value8838 */8839DUCKDB_C_API duckdb_value duckdb_create_timestamp_ns(duckdb_timestamp_ns input);8840#endif88418842#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)8843/*!8844 * Creates a value from an interval8845 *8846 * history:8847 * - stable: v1.1.08848 *8849 * @param input The interval value8850 * @return duckdb_value8851 */8852DUCKDB_C_API duckdb_value duckdb_create_interval(duckdb_interval input);8853#endif88548855#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)8856/*!8857 * Creates a value from a blob8858 *8859 * history:8860 * - stable: v1.1.08861 *8862 * @param data The blob data8863 * @param length The length of the blob data8864 * @return duckdb_value8865 */8866DUCKDB_C_API duckdb_value duckdb_create_blob(const uint8_t *data, idx_t length);8867#endif88688869#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)8870/*!8871 * Creates a BIT value from a duckdb_bit8872 *8873 * history:8874 * - stable: v1.2.08875 *8876 * @param input The duckdb_bit value8877 * @return duckdb_value8878 */8879DUCKDB_C_API duckdb_value duckdb_create_bit(duckdb_bit input);8880#endif88818882#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)8883/*!8884 * Creates a UUID value from a uhugeint8885 *8886 * history:8887 * - stable: v1.2.08888 *8889 * @param input The duckdb_uhugeint containing the UUID8890 * @return duckdb_value8891 */8892DUCKDB_C_API duckdb_value duckdb_create_uuid(duckdb_uhugeint input);8893#endif88948895#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)8896/*!8897 * Returns the boolean value of the given value.8898 *8899 * history:8900 * - stable: v1.1.08901 *8902 * @param val A duckdb_value containing a boolean8903 * @return bool8904 */8905DUCKDB_C_API bool duckdb_get_bool(duckdb_value val);8906#endif89078908#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)8909/*!8910 * Returns the int8_t value of the given value.8911 *8912 * history:8913 * - stable: v1.1.08914 *8915 * @param val A duckdb_value containing a tinyint8916 * @return int8_t8917 */8918DUCKDB_C_API int8_t duckdb_get_int8(duckdb_value val);8919#endif89208921#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)8922/*!8923 * Returns the uint8_t value of the given value.8924 *8925 * history:8926 * - stable: v1.1.08927 *8928 * @param val A duckdb_value containing a utinyint8929 * @return uint8_t8930 */8931DUCKDB_C_API uint8_t duckdb_get_uint8(duckdb_value val);8932#endif89338934#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)8935/*!8936 * Returns the int16_t value of the given value.8937 *8938 * history:8939 * - stable: v1.1.08940 *8941 * @param val A duckdb_value containing a smallint8942 * @return int16_t8943 */8944DUCKDB_C_API int16_t duckdb_get_int16(duckdb_value val);8945#endif89468947#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)8948/*!8949 * Returns the uint16_t value of the given value.8950 *8951 * history:8952 * - stable: v1.1.08953 *8954 * @param val A duckdb_value containing a usmallint8955 * @return uint16_t8956 */8957DUCKDB_C_API uint16_t duckdb_get_uint16(duckdb_value val);8958#endif89598960#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)8961/*!8962 * Returns the int32_t value of the given value.8963 *8964 * history:8965 * - stable: v1.1.08966 *8967 * @param val A duckdb_value containing an integer8968 * @return int32_t8969 */8970DUCKDB_C_API int32_t duckdb_get_int32(duckdb_value val);8971#endif89728973#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)8974/*!8975 * Returns the uint32_t value of the given value.8976 *8977 * history:8978 * - stable: v1.1.08979 *8980 * @param val A duckdb_value containing a uinteger8981 * @return uint32_t8982 */8983DUCKDB_C_API uint32_t duckdb_get_uint32(duckdb_value val);8984#endif89858986#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)8987/*!8988 * Returns the int64_t value of the given value.8989 *8990 * history:8991 * - stable: v0.3.38992 *8993 * @param val A duckdb_value containing a bigint8994 * @return int64_t8995 */8996DUCKDB_C_API int64_t duckdb_get_int64(duckdb_value val);8997#endif89988999#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)9000/*!9001 * Returns the uint64_t value of the given value.9002 *9003 * history:9004 * - stable: v1.1.09005 *9006 * @param val A duckdb_value containing a ubigint9007 * @return uint64_t9008 */9009DUCKDB_C_API uint64_t duckdb_get_uint64(duckdb_value val);9010#endif90119012#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)9013/*!9014 * Returns the hugeint value of the given value.9015 *9016 * history:9017 * - stable: v1.1.09018 *9019 * @param val A duckdb_value containing a hugeint9020 * @return duckdb_hugeint9021 */9022DUCKDB_C_API duckdb_hugeint duckdb_get_hugeint(duckdb_value val);9023#endif90249025#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)9026/*!9027 * Returns the uhugeint value of the given value.9028 *9029 * history:9030 * - stable: v1.1.09031 *9032 * @param val A duckdb_value containing a uhugeint9033 * @return duckdb_uhugeint9034 */9035DUCKDB_C_API duckdb_uhugeint duckdb_get_uhugeint(duckdb_value val);9036#endif90379038#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)9039/*!9040 * Returns the duckdb_bignum value of the given value. The `data` field must be destroyed with `duckdb_free`.9041 *9042 * history:9043 * - stable: v1.2.09044 *9045 * @param val A duckdb_value containing a BIGNUM9046 * @return duckdb_bignum9047 */9048DUCKDB_C_API duckdb_bignum duckdb_get_bignum(duckdb_value val);9049#endif90509051#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)9052/*!9053 * Returns the duckdb_decimal value of the given value.9054 *9055 * history:9056 * - stable: v1.2.09057 *9058 * @param val A duckdb_value containing a DECIMAL9059 * @return duckdb_decimal9060 */9061DUCKDB_C_API duckdb_decimal duckdb_get_decimal(duckdb_value val);9062#endif90639064#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)9065/*!9066 * Returns the float value of the given value.9067 *9068 * history:9069 * - stable: v1.1.09070 *9071 * @param val A duckdb_value containing a float9072 * @return float9073 */9074DUCKDB_C_API float duckdb_get_float(duckdb_value val);9075#endif90769077#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)9078/*!9079 * Returns the double value of the given value.9080 *9081 * history:9082 * - stable: v1.1.09083 *9084 * @param val A duckdb_value containing a double9085 * @return double9086 */9087DUCKDB_C_API double duckdb_get_double(duckdb_value val);9088#endif90899090#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)9091/*!9092 * Returns the date value of the given value.9093 *9094 * history:9095 * - stable: v1.1.09096 *9097 * @param val A duckdb_value containing a date9098 * @return duckdb_date9099 */9100DUCKDB_C_API duckdb_date duckdb_get_date(duckdb_value val);9101#endif91029103#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)9104/*!9105 * Returns the time value of the given value.9106 *9107 * history:9108 * - stable: v1.1.09109 *9110 * @param val A duckdb_value containing a time9111 * @return duckdb_time9112 */9113DUCKDB_C_API duckdb_time duckdb_get_time(duckdb_value val);9114#endif91159116#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)9117/*!9118 * Returns the time_ns value of the given value.9119 *9120 * history:9121 * - unstable: v1.4.09122 * - stable: v1.5.69123 *9124 * @param val A duckdb_value containing a time_ns9125 * @return duckdb_time_ns9126 */9127DUCKDB_C_API duckdb_time_ns duckdb_get_time_ns(duckdb_value val);9128#endif91299130#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)9131/*!9132 * Returns the time_tz value of the given value.9133 *9134 * history:9135 * - stable: v1.1.09136 *9137 * @param val A duckdb_value containing a time_tz9138 * @return duckdb_time_tz9139 */9140DUCKDB_C_API duckdb_time_tz duckdb_get_time_tz(duckdb_value val);9141#endif91429143#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)9144/*!9145 * Returns the TIMESTAMP value of the given value.9146 *9147 * history:9148 * - stable: v1.1.09149 *9150 * @param val A duckdb_value containing a TIMESTAMP9151 * @return duckdb_timestamp9152 */9153DUCKDB_C_API duckdb_timestamp duckdb_get_timestamp(duckdb_value val);9154#endif91559156#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)9157/*!9158 * Returns the TIMESTAMP_TZ value of the given value.9159 *9160 * history:9161 * - stable: v1.2.09162 *9163 * @param val A duckdb_value containing a TIMESTAMP_TZ9164 * @return duckdb_timestamp9165 */9166DUCKDB_C_API duckdb_timestamp duckdb_get_timestamp_tz(duckdb_value val);9167#endif91689169#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)9170/*!9171 * Returns the TIMESTAMP_TZ_NS value of the given value.9172 *9173 * history:9174 * - unstable: v1.5.49175 * - stable: v1.5.69176 *9177 * @param val A duckdb_value containing a TIMESTAMP_TZ_NS9178 * @return duckdb_timestamp_ns9179 */9180DUCKDB_C_API duckdb_timestamp_ns duckdb_get_timestamp_tz_ns(duckdb_value val);9181#endif91829183#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)9184/*!9185 * Returns the duckdb_timestamp_s value of the given value.9186 *9187 * history:9188 * - stable: v1.2.09189 *9190 * @param val A duckdb_value containing a TIMESTAMP_S9191 * @return duckdb_timestamp_s9192 */9193DUCKDB_C_API duckdb_timestamp_s duckdb_get_timestamp_s(duckdb_value val);9194#endif91959196#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)9197/*!9198 * Returns the duckdb_timestamp_ms value of the given value.9199 *9200 * history:9201 * - stable: v1.2.09202 *9203 * @param val A duckdb_value containing a TIMESTAMP_MS9204 * @return duckdb_timestamp_ms9205 */9206DUCKDB_C_API duckdb_timestamp_ms duckdb_get_timestamp_ms(duckdb_value val);9207#endif92089209#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)9210/*!9211 * Returns the duckdb_timestamp_ns value of the given value.9212 *9213 * history:9214 * - stable: v1.2.09215 *9216 * @param val A duckdb_value containing a TIMESTAMP_NS9217 * @return duckdb_timestamp_ns9218 */9219DUCKDB_C_API duckdb_timestamp_ns duckdb_get_timestamp_ns(duckdb_value val);9220#endif92219222#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)9223/*!9224 * Returns the interval value of the given value.9225 *9226 * history:9227 * - stable: v1.1.09228 *9229 * @param val A duckdb_value containing a interval9230 * @return duckdb_interval9231 */9232DUCKDB_C_API duckdb_interval duckdb_get_interval(duckdb_value val);9233#endif92349235#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)9236/*!9237 * Returns the type of the given value. The type is valid as long as the value is not destroyed. The type itself must9238 * not be destroyed.9239 *9240 * history:9241 * - stable: v1.1.09242 *9243 * @param val A duckdb_value9244 * @return duckdb_logical_type9245 */9246DUCKDB_C_API duckdb_logical_type duckdb_get_value_type(duckdb_value val);9247#endif92489249#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)9250/*!9251 * Returns the blob value of the given value.9252 *9253 * history:9254 * - stable: v1.1.09255 *9256 * @param val A duckdb_value containing a blob9257 * @return duckdb_blob9258 */9259DUCKDB_C_API duckdb_blob duckdb_get_blob(duckdb_value val);9260#endif92619262#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)9263/*!9264 * Returns the duckdb_bit value of the given value. The `data` field must be destroyed with `duckdb_free`.9265 *9266 * history:9267 * - stable: v1.2.09268 *9269 * @param val A duckdb_value containing a BIT9270 * @return duckdb_bit9271 */9272DUCKDB_C_API duckdb_bit duckdb_get_bit(duckdb_value val);9273#endif92749275#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)9276/*!9277 * Returns a duckdb_uhugeint representing the UUID value of the given value.9278 *9279 * history:9280 * - stable: v1.2.09281 *9282 * @param val A duckdb_value containing a UUID9283 * @return duckdb_uhugeint9284 */9285DUCKDB_C_API duckdb_uhugeint duckdb_get_uuid(duckdb_value val);9286#endif92879288#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)9289/*!9290 * Obtains a string representation of the given value. The result must be destroyed with `duckdb_free`.9291 *9292 * history:9293 * - stable: v0.3.39294 *9295 * @param value The value9296 * @return char*9297 */9298DUCKDB_C_API char *duckdb_get_varchar(duckdb_value value);9299#endif93009301#if DUCKDB_API_VERSION_AT_LEAST(0, 10, 0)9302/*!9303 * Creates a struct value from a type and an array of values. Must be destroyed with `duckdb_destroy_value`.9304 *9305 * history:9306 * - stable: v0.10.09307 *9308 * @param type The type of the struct9309 * @param values The values for the struct fields9310 * @return duckdb_value9311 */9312DUCKDB_C_API duckdb_value duckdb_create_struct_value(duckdb_logical_type type, duckdb_value *values);9313#endif93149315#if DUCKDB_API_VERSION_AT_LEAST(0, 10, 0)9316/*!9317 * Creates a list value from a child (element) type and an array of values of length `value_count`. Must be destroyed9318 * with `duckdb_destroy_value`.9319 *9320 * history:9321 * - stable: v0.10.09322 *9323 * @param type The type of the list9324 * @param values The values for the list9325 * @param value_count The number of values in the list9326 * @return duckdb_value9327 */9328DUCKDB_C_API duckdb_value duckdb_create_list_value(duckdb_logical_type type, duckdb_value *values, idx_t value_count);9329#endif93309331#if DUCKDB_API_VERSION_AT_LEAST(0, 10, 1)9332/*!9333 * Creates an array value from a child (element) type and an array of values of length `value_count`. Must be destroyed9334 * with `duckdb_destroy_value`.9335 *9336 * history:9337 * - stable: v0.10.19338 *9339 * @param type The type of the array9340 * @param values The values for the array9341 * @param value_count The number of values in the array9342 * @return duckdb_value9343 */9344DUCKDB_C_API duckdb_value duckdb_create_array_value(duckdb_logical_type type, duckdb_value *values, idx_t value_count);9345#endif93469347#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)9348/*!9349 * Creates a map value from a map type and two arrays, one for the keys and one for the values, each of length9350 * `entry_count`. Must be destroyed with `duckdb_destroy_value`.9351 *9352 * history:9353 * - unstable: v1.3.09354 * - stable: v1.5.69355 *9356 * @param map_type The map type9357 * @param keys The keys of the map9358 * @param values The values of the map9359 * @param entry_count The number of entries (key-value pairs) in the map9360 * @return duckdb_value9361 */9362DUCKDB_C_API duckdb_value duckdb_create_map_value(duckdb_logical_type map_type, duckdb_value *keys,9363                                                  duckdb_value *values, idx_t entry_count);9364#endif93659366#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)9367/*!9368 * Creates a union value from a union type, a tag index, and a value. Must be destroyed with `duckdb_destroy_value`.9369 *9370 * history:9371 * - unstable: v1.3.09372 * - stable: v1.5.69373 *9374 * @param union_type The union type9375 * @param tag_index The index of the tag of the union9376 * @param value The value of the union for that tag9377 * @return duckdb_value9378 */9379DUCKDB_C_API duckdb_value duckdb_create_union_value(duckdb_logical_type union_type, idx_t tag_index,9380                                                    duckdb_value value);9381#endif93829383#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)9384/*!9385 * Returns the number of elements in a MAP value.9386 *9387 * history:9388 * - stable: v1.1.09389 *9390 * @param value The MAP value.9391 * @return idx_t9392 */9393DUCKDB_C_API idx_t duckdb_get_map_size(duckdb_value value);9394#endif93959396#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)9397/*!9398 * Returns the MAP key at index as a duckdb_value.9399 *9400 * history:9401 * - stable: v1.1.09402 *9403 * @param value The MAP value.9404 * @param index The index of the key.9405 * @return duckdb_value9406 */9407DUCKDB_C_API duckdb_value duckdb_get_map_key(duckdb_value value, idx_t index);9408#endif94099410#if DUCKDB_API_VERSION_AT_LEAST(1, 1, 0)9411/*!9412 * Returns the MAP value at index as a duckdb_value.9413 *9414 * history:9415 * - stable: v1.1.09416 *9417 * @param value The MAP value.9418 * @param index The index of the value.9419 * @return duckdb_value9420 */9421DUCKDB_C_API duckdb_value duckdb_get_map_value(duckdb_value value, idx_t index);9422#endif94239424#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)9425/*!9426 * Returns whether the value's type is SQLNULL or not.9427 *9428 * history:9429 * - stable: v1.2.09430 *9431 * @param value The value to check.9432 * @return bool9433 */9434DUCKDB_C_API bool duckdb_is_null_value(duckdb_value value);9435#endif94369437#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)9438/*!9439 * Creates a value of type SQLNULL.9440 *9441 * history:9442 * - stable: v1.2.09443 *9444 * @return duckdb_value9445 */9446DUCKDB_C_API duckdb_value duckdb_create_null_value(void);9447#endif94489449#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)9450/*!9451 * Returns the number of elements in a LIST value.9452 *9453 * history:9454 * - stable: v1.2.09455 *9456 * @param value The LIST value.9457 * @return idx_t9458 */9459DUCKDB_C_API idx_t duckdb_get_list_size(duckdb_value value);9460#endif94619462#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)9463/*!9464 * Returns the LIST child at index as a duckdb_value.9465 *9466 * history:9467 * - stable: v1.2.09468 *9469 * @param value The LIST value.9470 * @param index The index of the child.9471 * @return duckdb_value9472 */9473DUCKDB_C_API duckdb_value duckdb_get_list_child(duckdb_value value, idx_t index);9474#endif94759476#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)9477/*!9478 * Creates an enum value from a type and a value. Must be destroyed with `duckdb_destroy_value`.9479 *9480 * history:9481 * - stable: v1.2.09482 *9483 * @param type The type of the enum9484 * @param value The value for the enum9485 * @return duckdb_value9486 */9487DUCKDB_C_API duckdb_value duckdb_create_enum_value(duckdb_logical_type type, uint64_t value);9488#endif94899490#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)9491/*!9492 * Returns the enum value of the given value.9493 *9494 * history:9495 * - stable: v1.2.09496 *9497 * @param value A duckdb_value containing an enum9498 * @return uint64_t9499 */9500DUCKDB_C_API uint64_t duckdb_get_enum_value(duckdb_value value);9501#endif95029503#if DUCKDB_API_VERSION_AT_LEAST(1, 2, 0)9504/*!9505 * Returns the STRUCT child at index as a duckdb_value.9506 *9507 * history:9508 * - stable: v1.2.09509 *9510 * @param value The STRUCT value.9511 * @param index The index of the child.9512 * @return duckdb_value9513 */9514DUCKDB_C_API duckdb_value duckdb_get_struct_child(duckdb_value value, idx_t index);9515#endif95169517#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)9518/*!9519 * Returns the SQL string representation of the given value.9520 *9521 * history:9522 * - unstable: v1.3.09523 * - stable: v1.5.69524 *9525 * @param value A duckdb_value.9526 * @return char*9527 */9528DUCKDB_C_API char *duckdb_value_to_string(duckdb_value value);9529#endif95309531#if (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)9532/*!9533 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.9534 *9535 * history:9536 * - stable: v0.1.09537 * - deprecated: v1.0.09538 *9539 * @param result9540 * @param col9541 * @param row9542 * @return bool9543 */9544DUCKDB_C_API bool duckdb_value_boolean(duckdb_result *result, idx_t col, idx_t row);9545#endif95469547#if (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)9548/*!9549 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.9550 *9551 * history:9552 * - stable: v0.1.09553 * - deprecated: v1.0.09554 *9555 * @param result9556 * @param col9557 * @param row9558 * @return int8_t9559 */9560DUCKDB_C_API int8_t duckdb_value_int8(duckdb_result *result, idx_t col, idx_t row);9561#endif95629563#if (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)9564/*!9565 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.9566 *9567 * history:9568 * - stable: v0.1.09569 * - deprecated: v1.0.09570 *9571 * @param result9572 * @param col9573 * @param row9574 * @return int16_t9575 */9576DUCKDB_C_API int16_t duckdb_value_int16(duckdb_result *result, idx_t col, idx_t row);9577#endif95789579#if (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)9580/*!9581 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.9582 *9583 * history:9584 * - stable: v0.1.09585 * - deprecated: v1.0.09586 *9587 * @param result9588 * @param col9589 * @param row9590 * @return int32_t9591 */9592DUCKDB_C_API int32_t duckdb_value_int32(duckdb_result *result, idx_t col, idx_t row);9593#endif95949595#if (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)9596/*!9597 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.9598 *9599 * history:9600 * - stable: v0.1.09601 * - deprecated: v1.0.09602 *9603 * @param result9604 * @param col9605 * @param row9606 * @return int64_t9607 */9608DUCKDB_C_API int64_t duckdb_value_int64(duckdb_result *result, idx_t col, idx_t row);9609#endif96109611#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)9612/*!9613 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.9614 *9615 * history:9616 * - stable: v0.2.99617 * - deprecated: v1.0.09618 *9619 * @param result9620 * @param col9621 * @param row9622 * @return duckdb_hugeint9623 */9624DUCKDB_C_API duckdb_hugeint duckdb_value_hugeint(duckdb_result *result, idx_t col, idx_t row);9625#endif96269627#if DUCKDB_API_VERSION_AT_LEAST(0, 10, 0) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)9628/*!9629 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.9630 *9631 * history:9632 * - stable: v0.10.09633 * - deprecated: v1.0.09634 *9635 * @param result9636 * @param col9637 * @param row9638 * @return duckdb_uhugeint9639 */9640DUCKDB_C_API duckdb_uhugeint duckdb_value_uhugeint(duckdb_result *result, idx_t col, idx_t row);9641#endif96429643#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)9644/*!9645 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.9646 *9647 * history:9648 * - stable: v0.3.39649 * - deprecated: v1.0.09650 *9651 * @param result9652 * @param col9653 * @param row9654 * @return duckdb_decimal9655 */9656DUCKDB_C_API duckdb_decimal duckdb_value_decimal(duckdb_result *result, idx_t col, idx_t row);9657#endif96589659#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)9660/*!9661 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.9662 *9663 * history:9664 * - stable: v0.2.59665 * - deprecated: v1.0.09666 *9667 * @param result9668 * @param col9669 * @param row9670 * @return uint8_t9671 */9672DUCKDB_C_API uint8_t duckdb_value_uint8(duckdb_result *result, idx_t col, idx_t row);9673#endif96749675#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)9676/*!9677 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.9678 *9679 * history:9680 * - stable: v0.2.59681 * - deprecated: v1.0.09682 *9683 * @param result9684 * @param col9685 * @param row9686 * @return uint16_t9687 */9688DUCKDB_C_API uint16_t duckdb_value_uint16(duckdb_result *result, idx_t col, idx_t row);9689#endif96909691#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)9692/*!9693 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.9694 *9695 * history:9696 * - stable: v0.2.59697 * - deprecated: v1.0.09698 *9699 * @param result9700 * @param col9701 * @param row9702 * @return uint32_t9703 */9704DUCKDB_C_API uint32_t duckdb_value_uint32(duckdb_result *result, idx_t col, idx_t row);9705#endif97069707#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)9708/*!9709 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.9710 *9711 * history:9712 * - stable: v0.2.59713 * - deprecated: v1.0.09714 *9715 * @param result9716 * @param col9717 * @param row9718 * @return uint64_t9719 */9720DUCKDB_C_API uint64_t duckdb_value_uint64(duckdb_result *result, idx_t col, idx_t row);9721#endif97229723#if (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)9724/*!9725 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.9726 *9727 * history:9728 * - stable: v0.1.09729 * - deprecated: v1.0.09730 *9731 * @param result9732 * @param col9733 * @param row9734 * @return float9735 */9736DUCKDB_C_API float duckdb_value_float(duckdb_result *result, idx_t col, idx_t row);9737#endif97389739#if (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)9740/*!9741 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.9742 *9743 * history:9744 * - stable: v0.1.09745 * - deprecated: v1.0.09746 *9747 * @param result9748 * @param col9749 * @param row9750 * @return double9751 */9752DUCKDB_C_API double duckdb_value_double(duckdb_result *result, idx_t col, idx_t row);9753#endif97549755#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)9756/*!9757 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.9758 *9759 * history:9760 * - stable: v0.2.99761 * - deprecated: v1.0.09762 *9763 * @param result9764 * @param col9765 * @param row9766 * @return duckdb_date9767 */9768DUCKDB_C_API duckdb_date duckdb_value_date(duckdb_result *result, idx_t col, idx_t row);9769#endif97709771#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)9772/*!9773 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.9774 *9775 * history:9776 * - stable: v0.2.99777 * - deprecated: v1.0.09778 *9779 * @param result9780 * @param col9781 * @param row9782 * @return duckdb_time9783 */9784DUCKDB_C_API duckdb_time duckdb_value_time(duckdb_result *result, idx_t col, idx_t row);9785#endif97869787#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)9788/*!9789 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.9790 *9791 * history:9792 * - stable: v0.2.99793 * - deprecated: v1.0.09794 *9795 * @param result9796 * @param col9797 * @param row9798 * @return duckdb_timestamp9799 */9800DUCKDB_C_API duckdb_timestamp duckdb_value_timestamp(duckdb_result *result, idx_t col, idx_t row);9801#endif98029803#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)9804/*!9805 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.9806 *9807 * history:9808 * - stable: v0.2.99809 * - deprecated: v1.0.09810 *9811 * @param result9812 * @param col9813 * @param row9814 * @return duckdb_interval9815 */9816DUCKDB_C_API duckdb_interval duckdb_value_interval(duckdb_result *result, idx_t col, idx_t row);9817#endif98189819#if (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)9820/*!9821 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.9822 *9823 * history:9824 * - stable: v0.1.09825 * - deprecated: v1.0.09826 *9827 * @param result9828 * @param col9829 * @param row9830 * @return char*9831 */9832DUCKDB_C_API char *duckdb_value_varchar(duckdb_result *result, idx_t col, idx_t row);9833#endif98349835#if DUCKDB_API_VERSION_AT_LEAST(0, 6, 0) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)9836/*!9837 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.9838 *9839 * history:9840 * - stable: v0.6.09841 * - deprecated: v1.0.09842 *9843 * @param result9844 * @param col9845 * @param row9846 * @return duckdb_string9847 */9848DUCKDB_C_API duckdb_string duckdb_value_string(duckdb_result *result, idx_t col, idx_t row);9849#endif98509851#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)9852/*!9853 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.9854 *9855 * history:9856 * - stable: v0.2.99857 * - deprecated: v1.0.09858 *9859 * @param result9860 * @param col9861 * @param row9862 * @return char*9863 */9864DUCKDB_C_API char *duckdb_value_varchar_internal(duckdb_result *result, idx_t col, idx_t row);9865#endif98669867#if DUCKDB_API_VERSION_AT_LEAST(0, 6, 0) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)9868/*!9869 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.9870 *9871 * history:9872 * - stable: v0.6.09873 * - deprecated: v1.0.09874 *9875 * @param result9876 * @param col9877 * @param row9878 * @return duckdb_string9879 */9880DUCKDB_C_API duckdb_string duckdb_value_string_internal(duckdb_result *result, idx_t col, idx_t row);9881#endif98829883#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 5) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)9884/*!9885 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.9886 *9887 * history:9888 * - stable: v0.2.59889 * - deprecated: v1.0.09890 *9891 * @param result9892 * @param col9893 * @param row9894 * @return duckdb_blob9895 */9896DUCKDB_C_API duckdb_blob duckdb_value_blob(duckdb_result *result, idx_t col, idx_t row);9897#endif98989899#if DUCKDB_API_VERSION_AT_LEAST(0, 2, 9) && (DUCKDB_API_VERSION_BELOW(1, 0, 0) || DUCKDB_API_ALLOW_DEPRECATED)9900/*!9901 * **DEPRECATION NOTICE**: This method is scheduled for removal in a future release.9902 *9903 * history:9904 * - stable: v0.2.99905 * - deprecated: v1.0.09906 *9907 * @param result9908 * @param col9909 * @param row9910 * @return bool9911 */9912DUCKDB_C_API bool duckdb_value_is_null(duckdb_result *result, idx_t col, idx_t row);9913#endif99149915/* --- Struct definitions for value --- */99169917/* ============================================================================9918 * MODULE: vector9919 * ============================================================================ */99209921/* --- Enums for vector --- */99229923/* --- Struct forward declarations for vector --- */99249925/* --- Types for vector --- */99269927/* --- Constants for vector --- */99289929/* --- Function pointer typedefs for vector --- */99309931/* --- Functions for vector --- */99329933#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)9934/*!9935 * Creates a flat vector. Must be destroyed with `duckdb_destroy_vector`.9936 *9937 * history:9938 * - unstable: v1.3.09939 * - stable: v1.5.69940 *9941 * @param type The logical type of the vector.9942 * @param capacity The capacity of the vector.9943 * @return duckdb_vector9944 */9945DUCKDB_C_API duckdb_vector duckdb_create_vector(duckdb_logical_type type, idx_t capacity);9946#endif99479948#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)9949/*!9950 * Destroys the vector and de-allocates its memory.9951 *9952 * history:9953 * - unstable: v1.3.09954 * - stable: v1.5.69955 *9956 * @param vector A pointer to the vector.9957 * @return void9958 */9959DUCKDB_C_API void duckdb_destroy_vector(duckdb_vector *vector);9960#endif99619962#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)9963/*!9964 * Retrieves the column type of the specified vector.9965 *9966 * The result must be destroyed with `duckdb_destroy_logical_type`.9967 *9968 * history:9969 * - stable: v0.3.39970 *9971 * @param vector The vector get the data from9972 * @return duckdb_logical_type9973 */9974DUCKDB_C_API duckdb_logical_type duckdb_vector_get_column_type(duckdb_vector vector);9975#endif99769977#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)9978/*!9979 * Retrieves the data pointer of the vector.9980 *9981 * The data pointer can be used to read or write values from the vector. How to read or write values depends on the type9982 * of the vector.9983 *9984 * history:9985 * - stable: v0.3.39986 *9987 * @param vector The vector to get the data from9988 * @return void*9989 */9990DUCKDB_C_API void *duckdb_vector_get_data(duckdb_vector vector);9991#endif99929993#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)9994/*!9995 * Retrieves the validity mask pointer of the specified vector.9996 *9997 * If all values are valid, this function MIGHT return NULL!9998 *9999 * The validity mask is a bitset that signifies null-ness within the data chunk. It is a series of uint64_t values,10000 * where each uint64_t value contains validity for 64 tuples. The bit is set to 1 if the value is valid (i.e. not NULL)10001 * or 0 if the value is invalid (i.e. NULL).10002 *10003 * Validity of a specific value can be obtained like this:10004 *10005 * idx_t entry_idx = row_idx / 64; idx_t idx_in_entry = row_idx % 64; bool is_valid = validity_mask[entry_idx] & (1 <<10006 * idx_in_entry);10007 *10008 * Alternatively, the (slower) duckdb_validity_row_is_valid function can be used.10009 *10010 * history:10011 * - stable: v0.3.310012 *10013 * @param vector The vector to get the data from10014 * @return uint64_t*10015 */10016DUCKDB_C_API uint64_t *duckdb_vector_get_validity(duckdb_vector vector);10017#endif1001810019#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)10020/*!10021 * Ensures the validity mask is writable by allocating it.10022 *10023 * After this function is called, `duckdb_vector_get_validity` will ALWAYS return non-NULL. This allows NULL values to10024 * be written to the vector, regardless of whether a validity mask was present before.10025 *10026 * history:10027 * - stable: v0.3.310028 *10029 * @param vector The vector to alter10030 * @return void10031 */10032DUCKDB_C_API void duckdb_vector_ensure_validity_writable(duckdb_vector vector);10033#endif1003410035#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)10036/*!10037 * Assigns a string element in the vector at the specified location. For VARCHAR vectors, the input is validated as10038 * UTF-8; if invalid, a NULL value is assigned at that index.10039 *10040 * Superseded by `duckdb_unsafe_vector_assign_string_element_len`, optionally combined with `duckdb_valid_utf8_check`.10041 *10042 * history:10043 * - stable: v0.3.310044 *10045 * @param vector The vector to alter10046 * @param index The row position in the vector to assign the string to10047 * @param str The null-terminated string10048 * @return void10049 */10050DUCKDB_C_API void duckdb_vector_assign_string_element(duckdb_vector vector, idx_t index, const char *str);10051#endif1005210053#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)10054/*!10055 * Assigns a string element in the vector at the specified location. For VARCHAR vectors, the input is validated as10056 * UTF-8; if invalid, a NULL value is assigned at that index. For BLOB vectors, no validation is performed.10057 *10058 * Superseded by `duckdb_unsafe_vector_assign_string_element_len`, optionally combined with `duckdb_valid_utf8_check`.10059 *10060 * history:10061 * - stable: v0.3.310062 *10063 * @param vector The vector to alter10064 * @param index The row position in the vector to assign the string to10065 * @param str The string10066 * @param str_len The length of the string (in bytes)10067 * @return void10068 */10069DUCKDB_C_API void duckdb_vector_assign_string_element_len(duckdb_vector vector, idx_t index, const char *str,10070                                                          idx_t str_len);10071#endif1007210073#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)10074/*!10075 * Assigns a string element in the vector at the specified location without UTF-8 validation. The caller is responsible10076 * for ensuring the input is valid UTF-8. Use `duckdb_valid_utf8_check` to validate strings before calling this function10077 * if needed. If the input is known to be valid UTF-8, this function can be called directly for better performance,10078 * avoiding the overhead of redundant validation.10079 *10080 * history:10081 * - unstable: v1.5.010082 * - stable: v1.5.610083 *10084 * @param vector The vector to alter10085 * @param index The row position in the vector to assign the string to10086 * @param str The string10087 * @param str_len The length of the string (in bytes)10088 * @return void10089 */10090DUCKDB_C_API void duckdb_unsafe_vector_assign_string_element_len(duckdb_vector vector, idx_t index, const char *str,10091                                                                 idx_t str_len);10092#endif1009310094#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)10095/*!10096 * Retrieves the child vector of a list vector.10097 *10098 * The resulting vector is valid as long as the parent vector is valid.10099 *10100 * history:10101 * - stable: v0.3.310102 *10103 * @param vector The vector10104 * @return duckdb_vector10105 */10106DUCKDB_C_API duckdb_vector duckdb_list_vector_get_child(duckdb_vector vector);10107#endif1010810109#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)10110/*!10111 * Returns the size of the child vector of the list.10112 *10113 * history:10114 * - stable: v0.3.310115 *10116 * @param vector The vector10117 * @return idx_t10118 */10119DUCKDB_C_API idx_t duckdb_list_vector_get_size(duckdb_vector vector);10120#endif1012110122#if DUCKDB_API_VERSION_AT_LEAST(0, 7, 0)10123/*!10124 * Sets the size of the underlying child-vector of a list vector. Note that this does NOT reserve the memory in the10125 * child buffer, and that it is possible to set a size exceeding the capacity. To set the capacity, use10126 * `duckdb_list_vector_reserve`.10127 *10128 * history:10129 * - stable: v0.7.010130 *10131 * @param vector The list vector.10132 * @param size The size of the child list.10133 * @return duckdb_state10134 */10135DUCKDB_C_API duckdb_state duckdb_list_vector_set_size(duckdb_vector vector, idx_t size);10136#endif1013710138#if DUCKDB_API_VERSION_AT_LEAST(0, 7, 0)10139/*!10140 * Sets the capacity of the underlying child-vector of a list vector. We increment to the next power of two, based on10141 * the required capacity. Thus, the capacity might not match the size of the list (capacity >= size), which is set via10142 * `duckdb_list_vector_set_size`.10143 *10144 * history:10145 * - stable: v0.7.010146 *10147 * @param vector The list vector.10148 * @param required_capacity The child buffer capacity to reserve.10149 * @return duckdb_state10150 */10151DUCKDB_C_API duckdb_state duckdb_list_vector_reserve(duckdb_vector vector, idx_t required_capacity);10152#endif1015310154#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)10155/*!10156 * Retrieves the child vector of a struct vector. The resulting vector is valid as long as the parent vector is valid.10157 *10158 * history:10159 * - stable: v0.3.310160 *10161 * @param vector The vector10162 * @param index The child index10163 * @return duckdb_vector10164 */10165DUCKDB_C_API duckdb_vector duckdb_struct_vector_get_child(duckdb_vector vector, idx_t index);10166#endif1016710168#if DUCKDB_API_VERSION_AT_LEAST(0, 10, 1)10169/*!10170 * Retrieves the child vector of an array vector. The resulting vector is valid as long as the parent vector is valid.10171 * The resulting vector has the size of the parent vector multiplied by the array size.10172 *10173 * history:10174 * - stable: v0.10.110175 *10176 * @param vector The vector10177 * @return duckdb_vector10178 */10179DUCKDB_C_API duckdb_vector duckdb_array_vector_get_child(duckdb_vector vector);10180#endif1018110182#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)10183/*!10184 * Slice a vector with a selection vector. The length of the selection vector must be less than or equal to the length10185 * of the vector. Turns the vector into a dictionary vector.10186 *10187 * history:10188 * - unstable: v1.3.010189 * - stable: v1.5.610190 *10191 * @param vector The vector to slice.10192 * @param sel The selection vector.10193 * @param len The length of the selection vector.10194 * @return void10195 */10196DUCKDB_C_API void duckdb_slice_vector(duckdb_vector vector, duckdb_selection_vector sel, idx_t len);10197#endif1019810199#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)10200/*!10201 * Copy the src vector to the dst with a selection vector that identifies which indices to copy.10202 *10203 * history:10204 * - unstable: v1.4.010205 * - stable: v1.5.610206 *10207 * @param src The vector to copy from.10208 * @param dst The vector to copy to.10209 * @param sel The selection vector. The length of the selection vector should not be more than the length of the src10210 * vector10211 * @param src_count The number of entries from selection vector to copy. Think of this as the effective length of the10212 * selection vector starting from index 010213 * @param src_offset The offset in the selection vector to copy from (important: actual number of items copied =10214 * src_count - src_offset).10215 * @param dst_offset The offset in the dst vector to start copying to.10216 * @return void10217 */10218DUCKDB_C_API void duckdb_vector_copy_sel(duckdb_vector src, duckdb_vector dst, duckdb_selection_vector sel,10219                                         idx_t src_count, idx_t src_offset, idx_t dst_offset);10220#endif1022110222#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)10223/*!10224 * Copies the value from `value` to `vector`.10225 *10226 * history:10227 * - unstable: v1.3.010228 * - stable: v1.5.610229 *10230 * @param vector The receiving vector.10231 * @param value The value to copy into the vector.10232 * @return void10233 */10234DUCKDB_C_API void duckdb_vector_reference_value(duckdb_vector vector, duckdb_value value);10235#endif1023610237#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)10238/*!10239 * Changes `to_vector` to reference `from_vector. After, the vectors share ownership of the data.10240 *10241 * history:10242 * - unstable: v1.3.010243 * - stable: v1.5.610244 *10245 * @param to_vector The receiving vector.10246 * @param from_vector The vector to reference.10247 * @return void10248 */10249DUCKDB_C_API void duckdb_vector_reference_vector(duckdb_vector to_vector, duckdb_vector from_vector);10250#endif1025110252#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)10253/*!10254 * Returns whether or not a row is valid (i.e. not NULL) in the given validity mask.10255 *10256 * history:10257 * - stable: v0.3.310258 *10259 * @param validity The validity mask, as obtained through `duckdb_vector_get_validity`10260 * @param row The row index10261 * @return bool10262 */10263DUCKDB_C_API bool duckdb_validity_row_is_valid(uint64_t *validity, idx_t row);10264#endif1026510266#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)10267/*!10268 * In a validity mask, sets a specific row to either valid or invalid.10269 *10270 * Note that `duckdb_vector_ensure_validity_writable` should be called before calling `duckdb_vector_get_validity`, to10271 * ensure that there is a validity mask to write to.10272 *10273 * history:10274 * - stable: v0.3.310275 *10276 * @param validity The validity mask, as obtained through `duckdb_vector_get_validity`.10277 * @param row The row index10278 * @param valid Whether or not to set the row to valid, or invalid10279 * @return void10280 */10281DUCKDB_C_API void duckdb_validity_set_row_validity(uint64_t *validity, idx_t row, bool valid);10282#endif1028310284#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)10285/*!10286 * In a validity mask, sets a specific row to invalid.10287 *10288 * Equivalent to `duckdb_validity_set_row_validity` with valid set to false.10289 *10290 * history:10291 * - stable: v0.3.310292 *10293 * @param validity The validity mask10294 * @param row The row index10295 * @return void10296 */10297DUCKDB_C_API void duckdb_validity_set_row_invalid(uint64_t *validity, idx_t row);10298#endif1029910300#if DUCKDB_API_VERSION_AT_LEAST(0, 3, 3)10301/*!10302 * In a validity mask, sets a specific row to valid.10303 *10304 * Equivalent to `duckdb_validity_set_row_validity` with valid set to true.10305 *10306 * history:10307 * - stable: v0.3.310308 *10309 * @param validity The validity mask10310 * @param row The row index10311 * @return void10312 */10313DUCKDB_C_API void duckdb_validity_set_row_valid(uint64_t *validity, idx_t row);10314#endif1031510316#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)10317/*!10318 * Creates a new selection vector of size `size`. Must be destroyed with `duckdb_destroy_selection_vector`.10319 *10320 * history:10321 * - unstable: v1.3.010322 * - stable: v1.5.610323 *10324 * @param size The size of the selection vector.10325 * @return duckdb_selection_vector10326 */10327DUCKDB_C_API duckdb_selection_vector duckdb_create_selection_vector(idx_t size);10328#endif1032910330#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)10331/*!10332 * Destroys the selection vector and de-allocates its memory.10333 *10334 * history:10335 * - unstable: v1.3.010336 * - stable: v1.5.610337 *10338 * @param sel The selection vector.10339 * @return void10340 */10341DUCKDB_C_API void duckdb_destroy_selection_vector(duckdb_selection_vector sel);10342#endif1034310344#if DUCKDB_API_VERSION_AT_LEAST(1, 5, 6)10345/*!10346 * Access the data pointer of a selection vector.10347 *10348 * history:10349 * - unstable: v1.3.010350 * - stable: v1.5.610351 *10352 * @param sel The selection vector.10353 * @return sel_t*10354 */10355DUCKDB_C_API sel_t *duckdb_selection_vector_get_data_ptr(duckdb_selection_vector sel);10356#endif1035710358/* --- Struct definitions for vector --- */1035910360//===--------------------------------------------------------------------===//10361// Renamed constructs10362//===--------------------------------------------------------------------===//10363//! Former spellings, available only while targeting a version that still had10364//! them. Each names the same construct, so an alias costs nothing at runtime.10365#if DUCKDB_API_VERSION_BELOW(1, 4, 0)10366//! Renamed to duckdb_bignum in v1.4.0.10367typedef duckdb_bignum duckdb_varint;10368#endif10369#if DUCKDB_API_VERSION_BELOW(1, 4, 0)10370//! Renamed to duckdb_get_bignum in v1.4.0.10371#define duckdb_get_varint duckdb_get_bignum10372#endif10373#if DUCKDB_API_VERSION_BELOW(1, 4, 0)10374//! Renamed to duckdb_create_bignum in v1.4.0.10375#define duckdb_create_varint duckdb_create_bignum10376#endif1037710378//===--------------------------------------------------------------------===//10379// DuckDB extension access10380//===--------------------------------------------------------------------===//1038110382//! Passed to C API extension as a parameter to the entrypoint.10383struct duckdb_extension_access {10384	//! Indicate that an error has occurred.10385	void (*set_error)(duckdb_extension_info info, const char *error);10386	//! Fetch the database on which to register the extension.10387	duckdb_database *(*get_database)(duckdb_extension_info info);10388	//! Fetch the API struct pointer.10389	const void *(*get_api)(duckdb_extension_info info, const char *version);10390};1039110392#ifdef __cplusplus10393}10394#endif10395
Files main
Menu

Theme