--- layout: docu title: Complete API --- This page contains the reference for DuckDB's C API. > The reference contains several deprecation notices. These concern methods whose long-term availability is not guaranteed as they may be removed in the future. That said, DuckDB's developers plan to carry out deprecations slowly as several of the deprecated methods do not yet have a fully functional alternative. Therefore, they will not removed before the alternative is available, and even then, there will be a grace period of a few minor versions before removing them. The reason that the methods are already deprecated in v1.0 is to denote that they are not part of the v1.0 stable API, which contains methods that are available long-term. ## API Reference Overview ### Open Connect
duckdb_instance_cache duckdb_create_instance_cache();
duckdb_state duckdb_get_or_create_from_cache(duckdb_instance_cache instance_cache, const char *path, duckdb_database *out_database, duckdb_config config, char **out_error);
void duckdb_destroy_instance_cache(duckdb_instance_cache *instance_cache);
duckdb_state duckdb_open(const char *path, duckdb_database *out_database);
duckdb_state duckdb_open_ext(const char *path, duckdb_database *out_database, duckdb_config config, char **out_error);
void duckdb_close(duckdb_database *database);
duckdb_state duckdb_connect(duckdb_database database, duckdb_connection *out_connection);
void duckdb_interrupt(duckdb_connection connection);
duckdb_query_progress_type duckdb_query_progress(duckdb_connection connection);
void duckdb_disconnect(duckdb_connection *connection);
void duckdb_connection_get_client_context(duckdb_connection connection, duckdb_client_context *out_context);
idx_t duckdb_client_context_get_connection_id(duckdb_client_context context);
void duckdb_destroy_client_context(duckdb_client_context *context);
const char *duckdb_library_version();
duckdb_value duckdb_get_table_names(duckdb_connection connection, const char *query, bool qualified);
### Configuration
duckdb_state duckdb_create_config(duckdb_config *out_config);
size_t duckdb_config_count();
duckdb_state duckdb_get_config_flag(size_t index, const char **out_name, const char **out_description);
duckdb_state duckdb_set_config(duckdb_config config, const char *name, const char *option);
void duckdb_destroy_config(duckdb_config *config);
### Query Execution
duckdb_state duckdb_query(duckdb_connection connection, const char *query, duckdb_result *out_result);
void duckdb_destroy_result(duckdb_result *result);
const char *duckdb_column_name(duckdb_result *result, idx_t col);
duckdb_type duckdb_column_type(duckdb_result *result, idx_t col);
duckdb_statement_type duckdb_result_statement_type(duckdb_result result);
duckdb_logical_type duckdb_column_logical_type(duckdb_result *result, idx_t col);
idx_t duckdb_column_count(duckdb_result *result);
idx_t duckdb_row_count(duckdb_result *result);
idx_t duckdb_rows_changed(duckdb_result *result);
void *duckdb_column_data(duckdb_result *result, idx_t col);
bool *duckdb_nullmask_data(duckdb_result *result, idx_t col);
const char *duckdb_result_error(duckdb_result *result);
duckdb_error_type duckdb_result_error_type(duckdb_result *result);
### Result Functions
duckdb_data_chunk duckdb_result_get_chunk(duckdb_result result, idx_t chunk_index);
bool duckdb_result_is_streaming(duckdb_result result);
idx_t duckdb_result_chunk_count(duckdb_result result);
duckdb_result_type duckdb_result_return_type(duckdb_result result);
### Safe Fetch Functions
bool duckdb_value_boolean(duckdb_result *result, idx_t col, idx_t row);
int8_t duckdb_value_int8(duckdb_result *result, idx_t col, idx_t row);
int16_t duckdb_value_int16(duckdb_result *result, idx_t col, idx_t row);
int32_t duckdb_value_int32(duckdb_result *result, idx_t col, idx_t row);
int64_t duckdb_value_int64(duckdb_result *result, idx_t col, idx_t row);
duckdb_hugeint duckdb_value_hugeint(duckdb_result *result, idx_t col, idx_t row);
duckdb_uhugeint duckdb_value_uhugeint(duckdb_result *result, idx_t col, idx_t row);
duckdb_decimal duckdb_value_decimal(duckdb_result *result, idx_t col, idx_t row);
uint8_t duckdb_value_uint8(duckdb_result *result, idx_t col, idx_t row);
uint16_t duckdb_value_uint16(duckdb_result *result, idx_t col, idx_t row);
uint32_t duckdb_value_uint32(duckdb_result *result, idx_t col, idx_t row);
uint64_t duckdb_value_uint64(duckdb_result *result, idx_t col, idx_t row);
float duckdb_value_float(duckdb_result *result, idx_t col, idx_t row);
double duckdb_value_double(duckdb_result *result, idx_t col, idx_t row);
duckdb_date duckdb_value_date(duckdb_result *result, idx_t col, idx_t row);
duckdb_time duckdb_value_time(duckdb_result *result, idx_t col, idx_t row);
duckdb_timestamp duckdb_value_timestamp(duckdb_result *result, idx_t col, idx_t row);
duckdb_interval duckdb_value_interval(duckdb_result *result, idx_t col, idx_t row);
char *duckdb_value_varchar(duckdb_result *result, idx_t col, idx_t row);
duckdb_string duckdb_value_string(duckdb_result *result, idx_t col, idx_t row);
char *duckdb_value_varchar_internal(duckdb_result *result, idx_t col, idx_t row);
duckdb_string duckdb_value_string_internal(duckdb_result *result, idx_t col, idx_t row);
duckdb_blob duckdb_value_blob(duckdb_result *result, idx_t col, idx_t row);
bool duckdb_value_is_null(duckdb_result *result, idx_t col, idx_t row);
### Helpers
void *duckdb_malloc(size_t size);
void duckdb_free(void *ptr);
idx_t duckdb_vector_size();
bool duckdb_string_is_inlined(duckdb_string_t string);
uint32_t duckdb_string_t_length(duckdb_string_t string);
const char *duckdb_string_t_data(duckdb_string_t *string);
### Date Time Timestamp Helpers
duckdb_date_struct duckdb_from_date(duckdb_date date);
duckdb_date duckdb_to_date(duckdb_date_struct date);
bool duckdb_is_finite_date(duckdb_date date);
duckdb_time_struct duckdb_from_time(duckdb_time time);
duckdb_time_tz duckdb_create_time_tz(int64_t micros, int32_t offset);
duckdb_time_tz_struct duckdb_from_time_tz(duckdb_time_tz micros);
duckdb_time duckdb_to_time(duckdb_time_struct time);
duckdb_timestamp_struct duckdb_from_timestamp(duckdb_timestamp ts);
duckdb_timestamp duckdb_to_timestamp(duckdb_timestamp_struct ts);
bool duckdb_is_finite_timestamp(duckdb_timestamp ts);
bool duckdb_is_finite_timestamp_s(duckdb_timestamp_s ts);
bool duckdb_is_finite_timestamp_ms(duckdb_timestamp_ms ts);
bool duckdb_is_finite_timestamp_ns(duckdb_timestamp_ns ts);
### Hugeint Helpers
double duckdb_hugeint_to_double(duckdb_hugeint val);
duckdb_hugeint duckdb_double_to_hugeint(double val);
### Unsigned Hugeint Helpers
double duckdb_uhugeint_to_double(duckdb_uhugeint val);
duckdb_uhugeint duckdb_double_to_uhugeint(double val);
### Decimal Helpers
duckdb_decimal duckdb_double_to_decimal(double val, uint8_t width, uint8_t scale);
double duckdb_decimal_to_double(duckdb_decimal val);
### Prepared Statements
duckdb_state duckdb_prepare(duckdb_connection connection, const char *query, duckdb_prepared_statement *out_prepared_statement);
void duckdb_destroy_prepare(duckdb_prepared_statement *prepared_statement);
const char *duckdb_prepare_error(duckdb_prepared_statement prepared_statement);
idx_t duckdb_nparams(duckdb_prepared_statement prepared_statement);
const char *duckdb_parameter_name(duckdb_prepared_statement prepared_statement, idx_t index);
duckdb_type duckdb_param_type(duckdb_prepared_statement prepared_statement, idx_t param_idx);
duckdb_logical_type duckdb_param_logical_type(duckdb_prepared_statement prepared_statement, idx_t param_idx);
duckdb_state duckdb_clear_bindings(duckdb_prepared_statement prepared_statement);
duckdb_statement_type duckdb_prepared_statement_type(duckdb_prepared_statement statement);
### Bind Values to Prepared Statements
duckdb_state duckdb_bind_value(duckdb_prepared_statement prepared_statement, idx_t param_idx, duckdb_value val);
duckdb_state duckdb_bind_parameter_index(duckdb_prepared_statement prepared_statement, idx_t *param_idx_out, const char *name);
duckdb_state duckdb_bind_boolean(duckdb_prepared_statement prepared_statement, idx_t param_idx, bool val);
duckdb_state duckdb_bind_int8(duckdb_prepared_statement prepared_statement, idx_t param_idx, int8_t val);
duckdb_state duckdb_bind_int16(duckdb_prepared_statement prepared_statement, idx_t param_idx, int16_t val);
duckdb_state duckdb_bind_int32(duckdb_prepared_statement prepared_statement, idx_t param_idx, int32_t val);
duckdb_state duckdb_bind_int64(duckdb_prepared_statement prepared_statement, idx_t param_idx, int64_t val);
duckdb_state duckdb_bind_hugeint(duckdb_prepared_statement prepared_statement, idx_t param_idx, duckdb_hugeint val);
duckdb_state duckdb_bind_uhugeint(duckdb_prepared_statement prepared_statement, idx_t param_idx, duckdb_uhugeint val);
duckdb_state duckdb_bind_decimal(duckdb_prepared_statement prepared_statement, idx_t param_idx, duckdb_decimal val);
duckdb_state duckdb_bind_uint8(duckdb_prepared_statement prepared_statement, idx_t param_idx, uint8_t val);
duckdb_state duckdb_bind_uint16(duckdb_prepared_statement prepared_statement, idx_t param_idx, uint16_t val);
duckdb_state duckdb_bind_uint32(duckdb_prepared_statement prepared_statement, idx_t param_idx, uint32_t val);
duckdb_state duckdb_bind_uint64(duckdb_prepared_statement prepared_statement, idx_t param_idx, uint64_t val);
duckdb_state duckdb_bind_float(duckdb_prepared_statement prepared_statement, idx_t param_idx, float val);
duckdb_state duckdb_bind_double(duckdb_prepared_statement prepared_statement, idx_t param_idx, double val);
duckdb_state duckdb_bind_date(duckdb_prepared_statement prepared_statement, idx_t param_idx, duckdb_date val);
duckdb_state duckdb_bind_time(duckdb_prepared_statement prepared_statement, idx_t param_idx, duckdb_time val);
duckdb_state duckdb_bind_timestamp(duckdb_prepared_statement prepared_statement, idx_t param_idx, duckdb_timestamp val);
duckdb_state duckdb_bind_timestamp_tz(duckdb_prepared_statement prepared_statement, idx_t param_idx, duckdb_timestamp val);
duckdb_state duckdb_bind_interval(duckdb_prepared_statement prepared_statement, idx_t param_idx, duckdb_interval val);
duckdb_state duckdb_bind_varchar(duckdb_prepared_statement prepared_statement, idx_t param_idx, const char *val);
duckdb_state duckdb_bind_varchar_length(duckdb_prepared_statement prepared_statement, idx_t param_idx, const char *val, idx_t length);
duckdb_state duckdb_bind_blob(duckdb_prepared_statement prepared_statement, idx_t param_idx, const void *data, idx_t length);
duckdb_state duckdb_bind_null(duckdb_prepared_statement prepared_statement, idx_t param_idx);
### Execute Prepared Statements
duckdb_state duckdb_execute_prepared(duckdb_prepared_statement prepared_statement, duckdb_result *out_result);
duckdb_state duckdb_execute_prepared_streaming(duckdb_prepared_statement prepared_statement, duckdb_result *out_result);
### Extract Statements
idx_t duckdb_extract_statements(duckdb_connection connection, const char *query, duckdb_extracted_statements *out_extracted_statements);
duckdb_state duckdb_prepare_extracted_statement(duckdb_connection connection, duckdb_extracted_statements extracted_statements, idx_t index, duckdb_prepared_statement *out_prepared_statement);
const char *duckdb_extract_statements_error(duckdb_extracted_statements extracted_statements);
void duckdb_destroy_extracted(duckdb_extracted_statements *extracted_statements);
### Pending Result Interface
duckdb_state duckdb_pending_prepared(duckdb_prepared_statement prepared_statement, duckdb_pending_result *out_result);
duckdb_state duckdb_pending_prepared_streaming(duckdb_prepared_statement prepared_statement, duckdb_pending_result *out_result);
void duckdb_destroy_pending(duckdb_pending_result *pending_result);
const char *duckdb_pending_error(duckdb_pending_result pending_result);
duckdb_pending_state duckdb_pending_execute_task(duckdb_pending_result pending_result);
duckdb_pending_state duckdb_pending_execute_check_state(duckdb_pending_result pending_result);
duckdb_state duckdb_execute_pending(duckdb_pending_result pending_result, duckdb_result *out_result);
bool duckdb_pending_execution_is_finished(duckdb_pending_state pending_state);
### Value Interface
void duckdb_destroy_value(duckdb_value *value);
duckdb_value duckdb_create_varchar(const char *text);
duckdb_value duckdb_create_varchar_length(const char *text, idx_t length);
duckdb_value duckdb_create_bool(bool input);
duckdb_value duckdb_create_int8(int8_t input);
duckdb_value duckdb_create_uint8(uint8_t input);
duckdb_value duckdb_create_int16(int16_t input);
duckdb_value duckdb_create_uint16(uint16_t input);
duckdb_value duckdb_create_int32(int32_t input);
duckdb_value duckdb_create_uint32(uint32_t input);
duckdb_value duckdb_create_uint64(uint64_t input);
duckdb_value duckdb_create_int64(int64_t val);
duckdb_value duckdb_create_hugeint(duckdb_hugeint input);
duckdb_value duckdb_create_uhugeint(duckdb_uhugeint input);
duckdb_value duckdb_create_varint(duckdb_varint input);
duckdb_value duckdb_create_decimal(duckdb_decimal input);
duckdb_value duckdb_create_float(float input);
duckdb_value duckdb_create_double(double input);
duckdb_value duckdb_create_date(duckdb_date input);
duckdb_value duckdb_create_time(duckdb_time input);
duckdb_value duckdb_create_time_tz_value(duckdb_time_tz value);
duckdb_value duckdb_create_timestamp(duckdb_timestamp input);
duckdb_value duckdb_create_timestamp_tz(duckdb_timestamp input);
duckdb_value duckdb_create_timestamp_s(duckdb_timestamp_s input);
duckdb_value duckdb_create_timestamp_ms(duckdb_timestamp_ms input);
duckdb_value duckdb_create_timestamp_ns(duckdb_timestamp_ns input);
duckdb_value duckdb_create_interval(duckdb_interval input);
duckdb_value duckdb_create_blob(const uint8_t *data, idx_t length);
duckdb_value duckdb_create_bit(duckdb_bit input);
duckdb_value duckdb_create_uuid(duckdb_uhugeint input);
bool duckdb_get_bool(duckdb_value val);
int8_t duckdb_get_int8(duckdb_value val);
uint8_t duckdb_get_uint8(duckdb_value val);
int16_t duckdb_get_int16(duckdb_value val);
uint16_t duckdb_get_uint16(duckdb_value val);
int32_t duckdb_get_int32(duckdb_value val);
uint32_t duckdb_get_uint32(duckdb_value val);
int64_t duckdb_get_int64(duckdb_value val);
uint64_t duckdb_get_uint64(duckdb_value val);
duckdb_hugeint duckdb_get_hugeint(duckdb_value val);
duckdb_uhugeint duckdb_get_uhugeint(duckdb_value val);
duckdb_varint duckdb_get_varint(duckdb_value val);
duckdb_decimal duckdb_get_decimal(duckdb_value val);
float duckdb_get_float(duckdb_value val);
double duckdb_get_double(duckdb_value val);
duckdb_date duckdb_get_date(duckdb_value val);
duckdb_time duckdb_get_time(duckdb_value val);
duckdb_time_tz duckdb_get_time_tz(duckdb_value val);
duckdb_timestamp duckdb_get_timestamp(duckdb_value val);
duckdb_timestamp duckdb_get_timestamp_tz(duckdb_value val);
duckdb_timestamp_s duckdb_get_timestamp_s(duckdb_value val);
duckdb_timestamp_ms duckdb_get_timestamp_ms(duckdb_value val);
duckdb_timestamp_ns duckdb_get_timestamp_ns(duckdb_value val);
duckdb_interval duckdb_get_interval(duckdb_value val);
duckdb_logical_type duckdb_get_value_type(duckdb_value val);
duckdb_blob duckdb_get_blob(duckdb_value val);
duckdb_bit duckdb_get_bit(duckdb_value val);
duckdb_uhugeint duckdb_get_uuid(duckdb_value val);
char *duckdb_get_varchar(duckdb_value value);
duckdb_value duckdb_create_struct_value(duckdb_logical_type type, duckdb_value *values);
duckdb_value duckdb_create_list_value(duckdb_logical_type type, duckdb_value *values, idx_t value_count);
duckdb_value duckdb_create_array_value(duckdb_logical_type type, duckdb_value *values, idx_t value_count);
duckdb_value duckdb_create_map_value(duckdb_logical_type map_type, duckdb_value *keys, duckdb_value *values, idx_t entry_count);
duckdb_value duckdb_create_union_value(duckdb_logical_type union_type, idx_t tag_index, duckdb_value value);
idx_t duckdb_get_map_size(duckdb_value value);
duckdb_value duckdb_get_map_key(duckdb_value value, idx_t index);
duckdb_value duckdb_get_map_value(duckdb_value value, idx_t index);
bool duckdb_is_null_value(duckdb_value value);
duckdb_value duckdb_create_null_value();
idx_t duckdb_get_list_size(duckdb_value value);
duckdb_value duckdb_get_list_child(duckdb_value value, idx_t index);
duckdb_value duckdb_create_enum_value(duckdb_logical_type type, uint64_t value);
uint64_t duckdb_get_enum_value(duckdb_value value);
duckdb_value duckdb_get_struct_child(duckdb_value value, idx_t index);
char *duckdb_value_to_string(duckdb_value value);
### Logical Type Interface
duckdb_logical_type duckdb_create_logical_type(duckdb_type type);
char *duckdb_logical_type_get_alias(duckdb_logical_type type);
void duckdb_logical_type_set_alias(duckdb_logical_type type, const char *alias);
duckdb_logical_type duckdb_create_list_type(duckdb_logical_type type);
duckdb_logical_type duckdb_create_array_type(duckdb_logical_type type, idx_t array_size);
duckdb_logical_type duckdb_create_map_type(duckdb_logical_type key_type, duckdb_logical_type value_type);
duckdb_logical_type duckdb_create_union_type(duckdb_logical_type *member_types, const char **member_names, idx_t member_count);
duckdb_logical_type duckdb_create_struct_type(duckdb_logical_type *member_types, const char **member_names, idx_t member_count);
duckdb_logical_type duckdb_create_enum_type(const char **member_names, idx_t member_count);
duckdb_logical_type duckdb_create_decimal_type(uint8_t width, uint8_t scale);
duckdb_type duckdb_get_type_id(duckdb_logical_type type);
uint8_t duckdb_decimal_width(duckdb_logical_type type);
uint8_t duckdb_decimal_scale(duckdb_logical_type type);
duckdb_type duckdb_decimal_internal_type(duckdb_logical_type type);
duckdb_type duckdb_enum_internal_type(duckdb_logical_type type);
uint32_t duckdb_enum_dictionary_size(duckdb_logical_type type);
char *duckdb_enum_dictionary_value(duckdb_logical_type type, idx_t index);
duckdb_logical_type duckdb_list_type_child_type(duckdb_logical_type type);
duckdb_logical_type duckdb_array_type_child_type(duckdb_logical_type type);
idx_t duckdb_array_type_array_size(duckdb_logical_type type);
duckdb_logical_type duckdb_map_type_key_type(duckdb_logical_type type);
duckdb_logical_type duckdb_map_type_value_type(duckdb_logical_type type);
idx_t duckdb_struct_type_child_count(duckdb_logical_type type);
char *duckdb_struct_type_child_name(duckdb_logical_type type, idx_t index);
duckdb_logical_type duckdb_struct_type_child_type(duckdb_logical_type type, idx_t index);
idx_t duckdb_union_type_member_count(duckdb_logical_type type);
char *duckdb_union_type_member_name(duckdb_logical_type type, idx_t index);
duckdb_logical_type duckdb_union_type_member_type(duckdb_logical_type type, idx_t index);
void duckdb_destroy_logical_type(duckdb_logical_type *type);
duckdb_state duckdb_register_logical_type(duckdb_connection con, duckdb_logical_type type, duckdb_create_type_info info);
### Data Chunk Interface
duckdb_data_chunk duckdb_create_data_chunk(duckdb_logical_type *types, idx_t column_count);
void duckdb_destroy_data_chunk(duckdb_data_chunk *chunk);
void duckdb_data_chunk_reset(duckdb_data_chunk chunk);
idx_t duckdb_data_chunk_get_column_count(duckdb_data_chunk chunk);
duckdb_vector duckdb_data_chunk_get_vector(duckdb_data_chunk chunk, idx_t col_idx);
idx_t duckdb_data_chunk_get_size(duckdb_data_chunk chunk);
void duckdb_data_chunk_set_size(duckdb_data_chunk chunk, idx_t size);
### Vector Interface
duckdb_vector duckdb_create_vector(duckdb_logical_type type, idx_t capacity);
void duckdb_destroy_vector(duckdb_vector *vector);
duckdb_logical_type duckdb_vector_get_column_type(duckdb_vector vector);
void *duckdb_vector_get_data(duckdb_vector vector);
uint64_t *duckdb_vector_get_validity(duckdb_vector vector);
void duckdb_vector_ensure_validity_writable(duckdb_vector vector);
void duckdb_vector_assign_string_element(duckdb_vector vector, idx_t index, const char *str);
void duckdb_vector_assign_string_element_len(duckdb_vector vector, idx_t index, const char *str, idx_t str_len);
duckdb_vector duckdb_list_vector_get_child(duckdb_vector vector);
idx_t duckdb_list_vector_get_size(duckdb_vector vector);
duckdb_state duckdb_list_vector_set_size(duckdb_vector vector, idx_t size);
duckdb_state duckdb_list_vector_reserve(duckdb_vector vector, idx_t required_capacity);
duckdb_vector duckdb_struct_vector_get_child(duckdb_vector vector, idx_t index);
duckdb_vector duckdb_array_vector_get_child(duckdb_vector vector);
void duckdb_slice_vector(duckdb_vector vector, duckdb_selection_vector selection, idx_t len);
void duckdb_vector_reference_value(duckdb_vector vector, duckdb_value value);
void duckdb_vector_reference_vector(duckdb_vector to_vector, duckdb_vector from_vector);
### Validity Mask Functions
bool duckdb_validity_row_is_valid(uint64_t *validity, idx_t row);
void duckdb_validity_set_row_validity(uint64_t *validity, idx_t row, bool valid);
void duckdb_validity_set_row_invalid(uint64_t *validity, idx_t row);
void duckdb_validity_set_row_valid(uint64_t *validity, idx_t row);
### Scalar Functions
duckdb_scalar_function duckdb_create_scalar_function();
void duckdb_destroy_scalar_function(duckdb_scalar_function *scalar_function);
void duckdb_scalar_function_set_name(duckdb_scalar_function scalar_function, const char *name);
void duckdb_scalar_function_set_varargs(duckdb_scalar_function scalar_function, duckdb_logical_type type);
void duckdb_scalar_function_set_special_handling(duckdb_scalar_function scalar_function);
void duckdb_scalar_function_set_volatile(duckdb_scalar_function scalar_function);
void duckdb_scalar_function_add_parameter(duckdb_scalar_function scalar_function, duckdb_logical_type type);
void duckdb_scalar_function_set_return_type(duckdb_scalar_function scalar_function, duckdb_logical_type type);
void duckdb_scalar_function_set_extra_info(duckdb_scalar_function scalar_function, void *extra_info, duckdb_delete_callback_t destroy);
void duckdb_scalar_function_set_bind(duckdb_scalar_function scalar_function, duckdb_scalar_function_bind_t bind);
void duckdb_scalar_function_set_bind_data(duckdb_bind_info info, void *bind_data, duckdb_delete_callback_t destroy);
void duckdb_scalar_function_bind_set_error(duckdb_bind_info info, const char *error);
void duckdb_scalar_function_set_function(duckdb_scalar_function scalar_function, duckdb_scalar_function_t function);
duckdb_state duckdb_register_scalar_function(duckdb_connection con, duckdb_scalar_function scalar_function);
void *duckdb_scalar_function_get_extra_info(duckdb_function_info info);
void *duckdb_scalar_function_get_bind_data(duckdb_function_info info);
void duckdb_scalar_function_get_client_context(duckdb_bind_info info, duckdb_client_context *out_context);
void duckdb_scalar_function_set_error(duckdb_function_info info, const char *error);
duckdb_scalar_function_set duckdb_create_scalar_function_set(const char *name);
void duckdb_destroy_scalar_function_set(duckdb_scalar_function_set *scalar_function_set);
duckdb_state duckdb_add_scalar_function_to_set(duckdb_scalar_function_set set, duckdb_scalar_function function);
duckdb_state duckdb_register_scalar_function_set(duckdb_connection con, duckdb_scalar_function_set set);
### Selection Vector Interface
duckdb_selection_vector duckdb_create_selection_vector(idx_t size);
void duckdb_destroy_selection_vector(duckdb_selection_vector vector);
sel_t *duckdb_selection_vector_get_data_ptr(duckdb_selection_vector vector);
### Aggregate Functions
duckdb_aggregate_function duckdb_create_aggregate_function();
void duckdb_destroy_aggregate_function(duckdb_aggregate_function *aggregate_function);
void duckdb_aggregate_function_set_name(duckdb_aggregate_function aggregate_function, const char *name);
void duckdb_aggregate_function_add_parameter(duckdb_aggregate_function aggregate_function, duckdb_logical_type type);
void duckdb_aggregate_function_set_return_type(duckdb_aggregate_function aggregate_function, duckdb_logical_type type);
void duckdb_aggregate_function_set_functions(duckdb_aggregate_function aggregate_function, duckdb_aggregate_state_size state_size, duckdb_aggregate_init_t state_init, duckdb_aggregate_update_t update, duckdb_aggregate_combine_t combine, duckdb_aggregate_finalize_t finalize);
void duckdb_aggregate_function_set_destructor(duckdb_aggregate_function aggregate_function, duckdb_aggregate_destroy_t destroy);
duckdb_state duckdb_register_aggregate_function(duckdb_connection con, duckdb_aggregate_function aggregate_function);
void duckdb_aggregate_function_set_special_handling(duckdb_aggregate_function aggregate_function);
void duckdb_aggregate_function_set_extra_info(duckdb_aggregate_function aggregate_function, void *extra_info, duckdb_delete_callback_t destroy);
void *duckdb_aggregate_function_get_extra_info(duckdb_function_info info);
void duckdb_aggregate_function_set_error(duckdb_function_info info, const char *error);
duckdb_aggregate_function_set duckdb_create_aggregate_function_set(const char *name);
void duckdb_destroy_aggregate_function_set(duckdb_aggregate_function_set *aggregate_function_set);
duckdb_state duckdb_add_aggregate_function_to_set(duckdb_aggregate_function_set set, duckdb_aggregate_function function);
duckdb_state duckdb_register_aggregate_function_set(duckdb_connection con, duckdb_aggregate_function_set set);
### Table Functions
duckdb_table_function duckdb_create_table_function();
void duckdb_destroy_table_function(duckdb_table_function *table_function);
void duckdb_table_function_set_name(duckdb_table_function table_function, const char *name);
void duckdb_table_function_add_parameter(duckdb_table_function table_function, duckdb_logical_type type);
void duckdb_table_function_add_named_parameter(duckdb_table_function table_function, const char *name, duckdb_logical_type type);
void duckdb_table_function_set_extra_info(duckdb_table_function table_function, void *extra_info, duckdb_delete_callback_t destroy);
void duckdb_table_function_set_bind(duckdb_table_function table_function, duckdb_table_function_bind_t bind);
void duckdb_table_function_set_init(duckdb_table_function table_function, duckdb_table_function_init_t init);
void duckdb_table_function_set_local_init(duckdb_table_function table_function, duckdb_table_function_init_t init);
void duckdb_table_function_set_function(duckdb_table_function table_function, duckdb_table_function_t function);
void duckdb_table_function_supports_projection_pushdown(duckdb_table_function table_function, bool pushdown);
duckdb_state duckdb_register_table_function(duckdb_connection con, duckdb_table_function function);
### Table Function Bind
void *duckdb_bind_get_extra_info(duckdb_bind_info info);
void duckdb_bind_add_result_column(duckdb_bind_info info, const char *name, duckdb_logical_type type);
idx_t duckdb_bind_get_parameter_count(duckdb_bind_info info);
duckdb_value duckdb_bind_get_parameter(duckdb_bind_info info, idx_t index);
duckdb_value duckdb_bind_get_named_parameter(duckdb_bind_info info, const char *name);
void duckdb_bind_set_bind_data(duckdb_bind_info info, void *bind_data, duckdb_delete_callback_t destroy);
void duckdb_bind_set_cardinality(duckdb_bind_info info, idx_t cardinality, bool is_exact);
void duckdb_bind_set_error(duckdb_bind_info info, const char *error);
### Table Function Init
void *duckdb_init_get_extra_info(duckdb_init_info info);
void *duckdb_init_get_bind_data(duckdb_init_info info);
void duckdb_init_set_init_data(duckdb_init_info info, void *init_data, duckdb_delete_callback_t destroy);
idx_t duckdb_init_get_column_count(duckdb_init_info info);
idx_t duckdb_init_get_column_index(duckdb_init_info info, idx_t column_index);
void duckdb_init_set_max_threads(duckdb_init_info info, idx_t max_threads);
void duckdb_init_set_error(duckdb_init_info info, const char *error);
### Table Function
void *duckdb_function_get_extra_info(duckdb_function_info info);
void *duckdb_function_get_bind_data(duckdb_function_info info);
void *duckdb_function_get_init_data(duckdb_function_info info);
void *duckdb_function_get_local_init_data(duckdb_function_info info);
void duckdb_function_set_error(duckdb_function_info info, const char *error);
### Replacement Scans
void duckdb_add_replacement_scan(duckdb_database db, duckdb_replacement_callback_t replacement, void *extra_data, duckdb_delete_callback_t delete_callback);
void duckdb_replacement_scan_set_function_name(duckdb_replacement_scan_info info, const char *function_name);
void duckdb_replacement_scan_add_parameter(duckdb_replacement_scan_info info, duckdb_value parameter);
void duckdb_replacement_scan_set_error(duckdb_replacement_scan_info info, const char *error);
### Profiling Info
duckdb_profiling_info duckdb_get_profiling_info(duckdb_connection connection);
duckdb_value duckdb_profiling_info_get_value(duckdb_profiling_info info, const char *key);
duckdb_value duckdb_profiling_info_get_metrics(duckdb_profiling_info info);
idx_t duckdb_profiling_info_get_child_count(duckdb_profiling_info info);
duckdb_profiling_info duckdb_profiling_info_get_child(duckdb_profiling_info info, idx_t index);
### Appender
duckdb_state duckdb_appender_create(duckdb_connection connection, const char *schema, const char *table, duckdb_appender *out_appender);
duckdb_state duckdb_appender_create_ext(duckdb_connection connection, const char *catalog, const char *schema, const char *table, duckdb_appender *out_appender);
idx_t duckdb_appender_column_count(duckdb_appender appender);
duckdb_logical_type duckdb_appender_column_type(duckdb_appender appender, idx_t col_idx);
const char *duckdb_appender_error(duckdb_appender appender);
duckdb_state duckdb_appender_flush(duckdb_appender appender);
duckdb_state duckdb_appender_close(duckdb_appender appender);
duckdb_state duckdb_appender_destroy(duckdb_appender *appender);
duckdb_state duckdb_appender_add_column(duckdb_appender appender, const char *name);
duckdb_state duckdb_appender_clear_columns(duckdb_appender appender);
duckdb_state duckdb_appender_begin_row(duckdb_appender appender);
duckdb_state duckdb_appender_end_row(duckdb_appender appender);
duckdb_state duckdb_append_default(duckdb_appender appender);
duckdb_state duckdb_append_default_to_chunk(duckdb_appender appender, duckdb_data_chunk chunk, idx_t col, idx_t row);
duckdb_state duckdb_append_bool(duckdb_appender appender, bool value);
duckdb_state duckdb_append_int8(duckdb_appender appender, int8_t value);
duckdb_state duckdb_append_int16(duckdb_appender appender, int16_t value);
duckdb_state duckdb_append_int32(duckdb_appender appender, int32_t value);
duckdb_state duckdb_append_int64(duckdb_appender appender, int64_t value);
duckdb_state duckdb_append_hugeint(duckdb_appender appender, duckdb_hugeint value);
duckdb_state duckdb_append_uint8(duckdb_appender appender, uint8_t value);
duckdb_state duckdb_append_uint16(duckdb_appender appender, uint16_t value);
duckdb_state duckdb_append_uint32(duckdb_appender appender, uint32_t value);
duckdb_state duckdb_append_uint64(duckdb_appender appender, uint64_t value);
duckdb_state duckdb_append_uhugeint(duckdb_appender appender, duckdb_uhugeint value);
duckdb_state duckdb_append_float(duckdb_appender appender, float value);
duckdb_state duckdb_append_double(duckdb_appender appender, double value);
duckdb_state duckdb_append_date(duckdb_appender appender, duckdb_date value);
duckdb_state duckdb_append_time(duckdb_appender appender, duckdb_time value);
duckdb_state duckdb_append_timestamp(duckdb_appender appender, duckdb_timestamp value);
duckdb_state duckdb_append_interval(duckdb_appender appender, duckdb_interval value);
duckdb_state duckdb_append_varchar(duckdb_appender appender, const char *val);
duckdb_state duckdb_append_varchar_length(duckdb_appender appender, const char *val, idx_t length);
duckdb_state duckdb_append_blob(duckdb_appender appender, const void *data, idx_t length);
duckdb_state duckdb_append_null(duckdb_appender appender);
duckdb_state duckdb_append_value(duckdb_appender appender, duckdb_value value);
duckdb_state duckdb_append_data_chunk(duckdb_appender appender, duckdb_data_chunk chunk);
### Table Description
duckdb_state duckdb_table_description_create(duckdb_connection connection, const char *schema, const char *table, duckdb_table_description *out);
duckdb_state duckdb_table_description_create_ext(duckdb_connection connection, const char *catalog, const char *schema, const char *table, duckdb_table_description *out);
void duckdb_table_description_destroy(duckdb_table_description *table_description);
const char *duckdb_table_description_error(duckdb_table_description table_description);
duckdb_state duckdb_column_has_default(duckdb_table_description table_description, idx_t index, bool *out);
char *duckdb_table_description_get_column_name(duckdb_table_description table_description, idx_t index);
### Arrow Interface
duckdb_state duckdb_query_arrow(duckdb_connection connection, const char *query, duckdb_arrow *out_result);
duckdb_state duckdb_query_arrow_schema(duckdb_arrow result, duckdb_arrow_schema *out_schema);
duckdb_state duckdb_prepared_arrow_schema(duckdb_prepared_statement prepared, duckdb_arrow_schema *out_schema);
void duckdb_result_arrow_array(duckdb_result result, duckdb_data_chunk chunk, duckdb_arrow_array *out_array);
duckdb_state duckdb_query_arrow_array(duckdb_arrow result, duckdb_arrow_array *out_array);
idx_t duckdb_arrow_column_count(duckdb_arrow result);
idx_t duckdb_arrow_row_count(duckdb_arrow result);
idx_t duckdb_arrow_rows_changed(duckdb_arrow result);
const char *duckdb_query_arrow_error(duckdb_arrow result);
void duckdb_destroy_arrow(duckdb_arrow *result);
void duckdb_destroy_arrow_stream(duckdb_arrow_stream *stream_p);
duckdb_state duckdb_execute_prepared_arrow(duckdb_prepared_statement prepared_statement, duckdb_arrow *out_result);
duckdb_state duckdb_arrow_scan(duckdb_connection connection, const char *table_name, duckdb_arrow_stream arrow);
duckdb_state duckdb_arrow_array_scan(duckdb_connection connection, const char *table_name, duckdb_arrow_schema arrow_schema, duckdb_arrow_array arrow_array, duckdb_arrow_stream *out_stream);
### Threading Information
void duckdb_execute_tasks(duckdb_database database, idx_t max_tasks);
duckdb_task_state duckdb_create_task_state(duckdb_database database);
void duckdb_execute_tasks_state(duckdb_task_state state);
idx_t duckdb_execute_n_tasks_state(duckdb_task_state state, idx_t max_tasks);
void duckdb_finish_execution(duckdb_task_state state);
bool duckdb_task_state_is_finished(duckdb_task_state state);
void duckdb_destroy_task_state(duckdb_task_state state);
bool duckdb_execution_is_finished(duckdb_connection con);
### Streaming Result Interface
duckdb_data_chunk duckdb_stream_fetch_chunk(duckdb_result result);
duckdb_data_chunk duckdb_fetch_chunk(duckdb_result result);
### Cast Functions
duckdb_cast_function duckdb_create_cast_function();
void duckdb_cast_function_set_source_type(duckdb_cast_function cast_function, duckdb_logical_type source_type);
void duckdb_cast_function_set_target_type(duckdb_cast_function cast_function, duckdb_logical_type target_type);
void duckdb_cast_function_set_implicit_cast_cost(duckdb_cast_function cast_function, int64_t cost);
void duckdb_cast_function_set_function(duckdb_cast_function cast_function, duckdb_cast_function_t function);
void duckdb_cast_function_set_extra_info(duckdb_cast_function cast_function, void *extra_info, duckdb_delete_callback_t destroy);
void *duckdb_cast_function_get_extra_info(duckdb_function_info info);
duckdb_cast_mode duckdb_cast_function_get_cast_mode(duckdb_function_info info);
void duckdb_cast_function_set_error(duckdb_function_info info, const char *error);
void duckdb_cast_function_set_row_error(duckdb_function_info info, const char *error, idx_t row, duckdb_vector output);
duckdb_state duckdb_register_cast_function(duckdb_connection con, duckdb_cast_function cast_function);
void duckdb_destroy_cast_function(duckdb_cast_function *cast_function);
#### `duckdb_create_instance_cache` Creates a new database instance cache. The instance cache is necessary if a client/program (re)opens multiple databases to the same file within the same process. Must be destroyed with 'duckdb_destroy_instance_cache'. ##### Return Value The database instance cache. ##### Syntax
duckdb_instance_cache duckdb_create_instance_cache(
  
);

#### `duckdb_get_or_create_from_cache` Creates a new database instance in the instance cache, or retrieves an existing database instance. Must be closed with 'duckdb_close'. ##### Syntax
duckdb_state duckdb_get_or_create_from_cache(
  duckdb_instance_cache instance_cache,
  const char *path,
  duckdb_database *out_database,
  duckdb_config config,
  char **out_error
);
##### Parameters * `instance_cache`: The instance cache in which to create the database, or from which to take the database. * `path`: Path to the database file on disk. Both `nullptr` and `:memory:` open or retrieve an in-memory database. * `out_database`: The resulting cached database. * `config`: (Optional) configuration used to create the database. * `out_error`: If set and the function returns `DuckDBError`, this contains the error message. Note that the error message must be freed using `duckdb_free`. ##### Return Value `DuckDBSuccess` on success or `DuckDBError` on failure.
#### `duckdb_destroy_instance_cache` Destroys an existing database instance cache and de-allocates its memory. ##### Syntax
void duckdb_destroy_instance_cache(
  duckdb_instance_cache *instance_cache
);
##### Parameters * `instance_cache`: The instance cache to destroy.
#### `duckdb_open` Creates a new database or opens an existing database file stored at the given path. If no path is given a new in-memory database is created instead. The database must be closed with 'duckdb_close'. ##### Syntax
duckdb_state duckdb_open(
  const char *path,
  duckdb_database *out_database
);
##### Parameters * `path`: Path to the database file on disk. Both `nullptr` and `:memory:` open an in-memory database. * `out_database`: The result database object. ##### Return Value `DuckDBSuccess` on success or `DuckDBError` on failure.
#### `duckdb_open_ext` Extended version of duckdb_open. Creates a new database or opens an existing database file stored at the given path. The database must be closed with 'duckdb_close'. ##### Syntax
duckdb_state duckdb_open_ext(
  const char *path,
  duckdb_database *out_database,
  duckdb_config config,
  char **out_error
);
##### Parameters * `path`: Path to the database file on disk. Both `nullptr` and `:memory:` open an in-memory database. * `out_database`: The result database object. * `config`: (Optional) configuration used to start up the database. * `out_error`: If set and the function returns `DuckDBError`, this contains the error message. Note that the error message must be freed using `duckdb_free`. ##### Return Value `DuckDBSuccess` on success or `DuckDBError` on failure.
#### `duckdb_close` Closes the specified database and de-allocates all memory allocated for that database. This should be called after you are done with any database allocated through `duckdb_open` or `duckdb_open_ext`. Note that failing to call `duckdb_close` (in case of e.g., a program crash) will not cause data corruption. Still, it is recommended to always correctly close a database object after you are done with it. ##### Syntax
void duckdb_close(
  duckdb_database *database
);
##### Parameters * `database`: The database object to shut down.
#### `duckdb_connect` Opens a connection to a database. Connections are required to query the database, and store transactional state associated with the connection. The instantiated connection should be closed using 'duckdb_disconnect'. ##### Syntax
duckdb_state duckdb_connect(
  duckdb_database database,
  duckdb_connection *out_connection
);
##### Parameters * `database`: The database file to connect to. * `out_connection`: The result connection object. ##### Return Value `DuckDBSuccess` on success or `DuckDBError` on failure.
#### `duckdb_interrupt` Interrupt running query ##### Syntax
void duckdb_interrupt(
  duckdb_connection connection
);
##### Parameters * `connection`: The connection to interrupt
#### `duckdb_query_progress` Get progress of the running query ##### Syntax
duckdb_query_progress_type duckdb_query_progress(
  duckdb_connection connection
);
##### Parameters * `connection`: The working connection ##### Return Value -1 if no progress or a percentage of the progress
#### `duckdb_disconnect` Closes the specified connection and de-allocates all memory allocated for that connection. ##### Syntax
void duckdb_disconnect(
  duckdb_connection *connection
);
##### Parameters * `connection`: The connection to close.
#### `duckdb_connection_get_client_context` Retrieves the client context of the connection. ##### Syntax
void duckdb_connection_get_client_context(
  duckdb_connection connection,
  duckdb_client_context *out_context
);
##### Parameters * `connection`: The connection. * `out_context`: The client context of the connection. Must be destroyed with `duckdb_destroy_client_context`.
#### `duckdb_client_context_get_connection_id` Returns the connection id of the client context. ##### Syntax
idx_t duckdb_client_context_get_connection_id(
  duckdb_client_context context
);
##### Parameters * `context`: The client context. ##### Return Value The connection id of the client context.
#### `duckdb_destroy_client_context` Destroys the client context and deallocates its memory. ##### Syntax
void duckdb_destroy_client_context(
  duckdb_client_context *context
);
##### Parameters * `context`: The client context to destroy.
#### `duckdb_library_version` Returns the version of the linked DuckDB, with a version postfix for dev versions Usually used for developing C extensions that must return this for a compatibility check. ##### Syntax
const char *duckdb_library_version(
  
);

#### `duckdb_get_table_names` Get the list of (fully qualified) table names of the query. ##### Syntax
duckdb_value duckdb_get_table_names(
  duckdb_connection connection,
  const char *query,
  bool qualified
);
##### Parameters * `connection`: The connection for which to get the table names. * `query`: The query for which to get the table names. * `qualified`: Returns fully qualified table names (catalog.schema.table), if set to true, else only the (not escaped) table names. ##### Return Value A duckdb_value of type VARCHAR[] containing the (fully qualified) table names of the query. Must be destroyed with duckdb_destroy_value.
#### `duckdb_create_config` Initializes an empty configuration object that can be used to provide start-up options for the DuckDB instance through `duckdb_open_ext`. The duckdb_config must be destroyed using 'duckdb_destroy_config' This will always succeed unless there is a malloc failure. Note that `duckdb_destroy_config` should always be called on the resulting config, even if the function returns `DuckDBError`. ##### Syntax
duckdb_state duckdb_create_config(
  duckdb_config *out_config
);
##### Parameters * `out_config`: The result configuration object. ##### Return Value `DuckDBSuccess` on success or `DuckDBError` on failure.
#### `duckdb_config_count` This returns the total amount of configuration options available for usage with `duckdb_get_config_flag`. This should not be called in a loop as it internally loops over all the options. ##### Return Value The amount of config options available. ##### Syntax
size_t duckdb_config_count(
  
);

#### `duckdb_get_config_flag` Obtains a human-readable name and description of a specific configuration option. This can be used to e.g. display configuration options. This will succeed unless `index` is out of range (i.e., `>= duckdb_config_count`). The result name or description MUST NOT be freed. ##### Syntax
duckdb_state duckdb_get_config_flag(
  size_t index,
  const char **out_name,
  const char **out_description
);
##### Parameters * `index`: The index of the configuration option (between 0 and `duckdb_config_count`) * `out_name`: A name of the configuration flag. * `out_description`: A description of the configuration flag. ##### Return Value `DuckDBSuccess` on success or `DuckDBError` on failure.
#### `duckdb_set_config` Sets the specified option for the specified configuration. The configuration option is indicated by name. To obtain a list of config options, see `duckdb_get_config_flag`. In the source code, configuration options are defined in `config.cpp`. This can fail if either the name is invalid, or if the value provided for the option is invalid. ##### Syntax
duckdb_state duckdb_set_config(
  duckdb_config config,
  const char *name,
  const char *option
);
##### Parameters * `config`: The configuration object to set the option on. * `name`: The name of the configuration flag to set. * `option`: The value to set the configuration flag to. ##### Return Value `DuckDBSuccess` on success or `DuckDBError` on failure.
#### `duckdb_destroy_config` Destroys the specified configuration object and de-allocates all memory allocated for the object. ##### Syntax
void duckdb_destroy_config(
  duckdb_config *config
);
##### Parameters * `config`: The configuration object to destroy.
#### `duckdb_query` Executes a SQL query within a connection and stores the full (materialized) result in the out_result pointer. If the query fails to execute, DuckDBError is returned and the error message can be retrieved by calling `duckdb_result_error`. Note that after running `duckdb_query`, `duckdb_destroy_result` must be called on the result object even if the query fails, otherwise the error stored within the result will not be freed correctly. ##### Syntax
duckdb_state duckdb_query(
  duckdb_connection connection,
  const char *query,
  duckdb_result *out_result
);
##### Parameters * `connection`: The connection to perform the query in. * `query`: The SQL query to run. * `out_result`: The query result. ##### Return Value `DuckDBSuccess` on success or `DuckDBError` on failure.
#### `duckdb_destroy_result` Closes the result and de-allocates all memory allocated for that result. ##### Syntax
void duckdb_destroy_result(
  duckdb_result *result
);
##### Parameters * `result`: The result to destroy.
#### `duckdb_column_name` Returns the column name of the specified column. The result should not need to be freed; the column names will automatically be destroyed when the result is destroyed. Returns `NULL` if the column is out of range. ##### Syntax
const char *duckdb_column_name(
  duckdb_result *result,
  idx_t col
);
##### Parameters * `result`: The result object to fetch the column name from. * `col`: The column index. ##### Return Value The column name of the specified column.
#### `duckdb_column_type` Returns the column type of the specified column. Returns `DUCKDB_TYPE_INVALID` if the column is out of range. ##### Syntax
duckdb_type duckdb_column_type(
  duckdb_result *result,
  idx_t col
);
##### Parameters * `result`: The result object to fetch the column type from. * `col`: The column index. ##### Return Value The column type of the specified column.
#### `duckdb_result_statement_type` Returns the statement type of the statement that was executed ##### Syntax
duckdb_statement_type duckdb_result_statement_type(
  duckdb_result result
);
##### Parameters * `result`: The result object to fetch the statement type from. ##### Return Value duckdb_statement_type value or DUCKDB_STATEMENT_TYPE_INVALID
#### `duckdb_column_logical_type` Returns the logical column type of the specified column. The return type of this call should be destroyed with `duckdb_destroy_logical_type`. Returns `NULL` if the column is out of range. ##### Syntax
duckdb_logical_type duckdb_column_logical_type(
  duckdb_result *result,
  idx_t col
);
##### Parameters * `result`: The result object to fetch the column type from. * `col`: The column index. ##### Return Value The logical column type of the specified column.
#### `duckdb_column_count` Returns the number of columns present in a the result object. ##### Syntax
idx_t duckdb_column_count(
  duckdb_result *result
);
##### Parameters * `result`: The result object. ##### Return Value The number of columns present in the result object.
#### `duckdb_row_count` > Warning Deprecation notice. This method is scheduled for removal in a future release. Returns the number of rows present in the result object. ##### Syntax
idx_t duckdb_row_count(
  duckdb_result *result
);
##### Parameters * `result`: The result object. ##### Return Value The number of rows present in the result object.
#### `duckdb_rows_changed` Returns the number of rows changed by the query stored in the result. This is relevant only for INSERT/UPDATE/DELETE queries. For other queries the rows_changed will be 0. ##### Syntax
idx_t duckdb_rows_changed(
  duckdb_result *result
);
##### Parameters * `result`: The result object. ##### Return Value The number of rows changed.
#### `duckdb_column_data` > Deprecated This method has been deprecated. Prefer using `duckdb_result_get_chunk` instead. Returns the data of a specific column of a result in columnar format. The function returns a dense array which contains the result data. The exact type stored in the array depends on the corresponding duckdb_type (as provided by `duckdb_column_type`). For the exact type by which the data should be accessed, see the comments in [the types section](types) or the `DUCKDB_TYPE` enum. For example, for a column of type `DUCKDB_TYPE_INTEGER`, rows can be accessed in the following manner: ```c int32_t *data = (int32_t *) duckdb_column_data(&result, 0); printf("Data for row %d: %d\n", row, data[row]); ``` ##### Syntax
void *duckdb_column_data(
  duckdb_result *result,
  idx_t col
);
##### Parameters * `result`: The result object to fetch the column data from. * `col`: The column index. ##### Return Value The column data of the specified column.
#### `duckdb_nullmask_data` > Deprecated This method has been deprecated. Prefer using `duckdb_result_get_chunk` instead. Returns the nullmask of a specific column of a result in columnar format. The nullmask indicates for every row whether or not the corresponding row is `NULL`. If a row is `NULL`, the values present in the array provided by `duckdb_column_data` are undefined. ```c int32_t *data = (int32_t *) duckdb_column_data(&result, 0); bool *nullmask = duckdb_nullmask_data(&result, 0); if (nullmask[row]) { printf("Data for row %d: NULL\n", row); } else { printf("Data for row %d: %d\n", row, data[row]); } ``` ##### Syntax
bool *duckdb_nullmask_data(
  duckdb_result *result,
  idx_t col
);
##### Parameters * `result`: The result object to fetch the nullmask from. * `col`: The column index. ##### Return Value The nullmask of the specified column.
#### `duckdb_result_error` Returns the error message contained within the result. The error is only set if `duckdb_query` returns `DuckDBError`. The result of this function must not be freed. It will be cleaned up when `duckdb_destroy_result` is called. ##### Syntax
const char *duckdb_result_error(
  duckdb_result *result
);
##### Parameters * `result`: The result object to fetch the error from. ##### Return Value The error of the result.
#### `duckdb_result_error_type` Returns the result error type contained within the result. The error is only set if `duckdb_query` returns `DuckDBError`. ##### Syntax
duckdb_error_type duckdb_result_error_type(
  duckdb_result *result
);
##### Parameters * `result`: The result object to fetch the error from. ##### Return Value The error type of the result.
#### `duckdb_result_get_chunk` > Warning Deprecation notice. This method is scheduled for removal in a future release. Fetches a data chunk from the duckdb_result. This function should be called repeatedly until the result is exhausted. The result must be destroyed with `duckdb_destroy_data_chunk`. This function supersedes all `duckdb_value` functions, as well as the `duckdb_column_data` and `duckdb_nullmask_data` functions. It results in significantly better performance, and should be preferred in newer code-bases. If this function is used, none of the other result functions can be used and vice versa (i.e., this function cannot be mixed with the legacy result functions). Use `duckdb_result_chunk_count` to figure out how many chunks there are in the result. ##### Syntax
duckdb_data_chunk duckdb_result_get_chunk(
  duckdb_result result,
  idx_t chunk_index
);
##### Parameters * `result`: The result object to fetch the data chunk from. * `chunk_index`: The chunk index to fetch from. ##### Return Value The resulting data chunk. Returns `NULL` if the chunk index is out of bounds.
#### `duckdb_result_is_streaming` > Warning Deprecation notice. This method is scheduled for removal in a future release. Checks if the type of the internal result is StreamQueryResult. ##### Syntax
bool duckdb_result_is_streaming(
  duckdb_result result
);
##### Parameters * `result`: The result object to check. ##### Return Value Whether or not the result object is of the type StreamQueryResult
#### `duckdb_result_chunk_count` > Warning Deprecation notice. This method is scheduled for removal in a future release. Returns the number of data chunks present in the result. ##### Syntax
idx_t duckdb_result_chunk_count(
  duckdb_result result
);
##### Parameters * `result`: The result object ##### Return Value Number of data chunks present in the result.
#### `duckdb_result_return_type` Returns the return_type of the given result, or DUCKDB_RETURN_TYPE_INVALID on error ##### Syntax
duckdb_result_type duckdb_result_return_type(
  duckdb_result result
);
##### Parameters * `result`: The result object ##### Return Value The return_type
#### `duckdb_value_boolean` > Warning Deprecation notice. This method is scheduled for removal in a future release. ##### Return Value The boolean value at the specified location, or false if the value cannot be converted. ##### Syntax
bool duckdb_value_boolean(
  duckdb_result *result,
  idx_t col,
  idx_t row
);

#### `duckdb_value_int8` > Warning Deprecation notice. This method is scheduled for removal in a future release. ##### Return Value The int8_t value at the specified location, or 0 if the value cannot be converted. ##### Syntax
int8_t duckdb_value_int8(
  duckdb_result *result,
  idx_t col,
  idx_t row
);

#### `duckdb_value_int16` > Warning Deprecation notice. This method is scheduled for removal in a future release. ##### Return Value The int16_t value at the specified location, or 0 if the value cannot be converted. ##### Syntax
int16_t duckdb_value_int16(
  duckdb_result *result,
  idx_t col,
  idx_t row
);

#### `duckdb_value_int32` > Warning Deprecation notice. This method is scheduled for removal in a future release. ##### Return Value The int32_t value at the specified location, or 0 if the value cannot be converted. ##### Syntax
int32_t duckdb_value_int32(
  duckdb_result *result,
  idx_t col,
  idx_t row
);

#### `duckdb_value_int64` > Warning Deprecation notice. This method is scheduled for removal in a future release. ##### Return Value The int64_t value at the specified location, or 0 if the value cannot be converted. ##### Syntax
int64_t duckdb_value_int64(
  duckdb_result *result,
  idx_t col,
  idx_t row
);

#### `duckdb_value_hugeint` > Warning Deprecation notice. This method is scheduled for removal in a future release. ##### Return Value The duckdb_hugeint value at the specified location, or 0 if the value cannot be converted. ##### Syntax
duckdb_hugeint duckdb_value_hugeint(
  duckdb_result *result,
  idx_t col,
  idx_t row
);

#### `duckdb_value_uhugeint` > Warning Deprecation notice. This method is scheduled for removal in a future release. ##### Return Value The duckdb_uhugeint value at the specified location, or 0 if the value cannot be converted. ##### Syntax
duckdb_uhugeint duckdb_value_uhugeint(
  duckdb_result *result,
  idx_t col,
  idx_t row
);

#### `duckdb_value_decimal` > Warning Deprecation notice. This method is scheduled for removal in a future release. ##### Return Value The duckdb_decimal value at the specified location, or 0 if the value cannot be converted. ##### Syntax
duckdb_decimal duckdb_value_decimal(
  duckdb_result *result,
  idx_t col,
  idx_t row
);

#### `duckdb_value_uint8` > Warning Deprecation notice. This method is scheduled for removal in a future release. ##### Return Value The uint8_t value at the specified location, or 0 if the value cannot be converted. ##### Syntax
uint8_t duckdb_value_uint8(
  duckdb_result *result,
  idx_t col,
  idx_t row
);

#### `duckdb_value_uint16` > Warning Deprecation notice. This method is scheduled for removal in a future release. ##### Return Value The uint16_t value at the specified location, or 0 if the value cannot be converted. ##### Syntax
uint16_t duckdb_value_uint16(
  duckdb_result *result,
  idx_t col,
  idx_t row
);

#### `duckdb_value_uint32` > Warning Deprecation notice. This method is scheduled for removal in a future release. ##### Return Value The uint32_t value at the specified location, or 0 if the value cannot be converted. ##### Syntax
uint32_t duckdb_value_uint32(
  duckdb_result *result,
  idx_t col,
  idx_t row
);

#### `duckdb_value_uint64` > Warning Deprecation notice. This method is scheduled for removal in a future release. ##### Return Value The uint64_t value at the specified location, or 0 if the value cannot be converted. ##### Syntax
uint64_t duckdb_value_uint64(
  duckdb_result *result,
  idx_t col,
  idx_t row
);

#### `duckdb_value_float` > Warning Deprecation notice. This method is scheduled for removal in a future release. ##### Return Value The float value at the specified location, or 0 if the value cannot be converted. ##### Syntax
float duckdb_value_float(
  duckdb_result *result,
  idx_t col,
  idx_t row
);

#### `duckdb_value_double` > Warning Deprecation notice. This method is scheduled for removal in a future release. ##### Return Value The double value at the specified location, or 0 if the value cannot be converted. ##### Syntax
double duckdb_value_double(
  duckdb_result *result,
  idx_t col,
  idx_t row
);

#### `duckdb_value_date` > Warning Deprecation notice. This method is scheduled for removal in a future release. ##### Return Value The duckdb_date value at the specified location, or 0 if the value cannot be converted. ##### Syntax
duckdb_date duckdb_value_date(
  duckdb_result *result,
  idx_t col,
  idx_t row
);

#### `duckdb_value_time` > Warning Deprecation notice. This method is scheduled for removal in a future release. ##### Return Value The duckdb_time value at the specified location, or 0 if the value cannot be converted. ##### Syntax
duckdb_time duckdb_value_time(
  duckdb_result *result,
  idx_t col,
  idx_t row
);

#### `duckdb_value_timestamp` > Warning Deprecation notice. This method is scheduled for removal in a future release. ##### Return Value The duckdb_timestamp value at the specified location, or 0 if the value cannot be converted. ##### Syntax
duckdb_timestamp duckdb_value_timestamp(
  duckdb_result *result,
  idx_t col,
  idx_t row
);

#### `duckdb_value_interval` > Warning Deprecation notice. This method is scheduled for removal in a future release. ##### Return Value The duckdb_interval value at the specified location, or 0 if the value cannot be converted. ##### Syntax
duckdb_interval duckdb_value_interval(
  duckdb_result *result,
  idx_t col,
  idx_t row
);

#### `duckdb_value_varchar` > Deprecated This method has been deprecated. Use duckdb_value_string instead. This function does not work correctly if the string contains null bytes. ##### Return Value The text value at the specified location as a null-terminated string, or nullptr if the value cannot be converted. The result must be freed with `duckdb_free`. ##### Syntax
char *duckdb_value_varchar(
  duckdb_result *result,
  idx_t col,
  idx_t row
);

#### `duckdb_value_string` > Warning Deprecation notice. This method is scheduled for removal in a future release. No support for nested types, and for other complex types. The resulting field "string.data" must be freed with `duckdb_free.` ##### Return Value The string value at the specified location. Attempts to cast the result value to string. ##### Syntax
duckdb_string duckdb_value_string(
  duckdb_result *result,
  idx_t col,
  idx_t row
);

#### `duckdb_value_varchar_internal` > Deprecated This method has been deprecated. Use duckdb_value_string_internal instead. This function does not work correctly if the string contains null bytes. ##### Return Value The char* value at the specified location. ONLY works on VARCHAR columns and does not auto-cast. If the column is NOT a VARCHAR column this function will return NULL. The result must NOT be freed. ##### Syntax
char *duckdb_value_varchar_internal(
  duckdb_result *result,
  idx_t col,
  idx_t row
);

#### `duckdb_value_string_internal` > Deprecated This method has been deprecated. Use duckdb_value_string_internal instead. This function does not work correctly if the string contains null bytes. ##### Return Value The char* value at the specified location. ONLY works on VARCHAR columns and does not auto-cast. If the column is NOT a VARCHAR column this function will return NULL. The result must NOT be freed. ##### Syntax
duckdb_string duckdb_value_string_internal(
  duckdb_result *result,
  idx_t col,
  idx_t row
);

#### `duckdb_value_blob` > Warning Deprecation notice. This method is scheduled for removal in a future release. ##### Return Value The duckdb_blob value at the specified location. Returns a blob with blob.data set to nullptr if the value cannot be converted. The resulting field "blob.data" must be freed with `duckdb_free.` ##### Syntax
duckdb_blob duckdb_value_blob(
  duckdb_result *result,
  idx_t col,
  idx_t row
);

#### `duckdb_value_is_null` > Warning Deprecation notice. This method is scheduled for removal in a future release. ##### Return Value Returns true if the value at the specified index is NULL, and false otherwise. ##### Syntax
bool duckdb_value_is_null(
  duckdb_result *result,
  idx_t col,
  idx_t row
);

#### `duckdb_malloc` Allocate `size` bytes of memory using the duckdb internal malloc function. Any memory allocated in this manner should be freed using `duckdb_free`. ##### Syntax
void *duckdb_malloc(
  size_t size
);
##### Parameters * `size`: The number of bytes to allocate. ##### Return Value A pointer to the allocated memory region.
#### `duckdb_free` Free a value returned from `duckdb_malloc`, `duckdb_value_varchar`, `duckdb_value_blob`, or `duckdb_value_string`. ##### Syntax
void duckdb_free(
  void *ptr
);
##### Parameters * `ptr`: The memory region to de-allocate.
#### `duckdb_vector_size` The internal vector size used by DuckDB. This is the amount of tuples that will fit into a data chunk created by `duckdb_create_data_chunk`. ##### Return Value The vector size. ##### Syntax
idx_t duckdb_vector_size(
  
);

#### `duckdb_string_is_inlined` Whether or not the duckdb_string_t value is inlined. This means that the data of the string does not have a separate allocation. ##### Syntax
bool duckdb_string_is_inlined(
  duckdb_string_t string
);

#### `duckdb_string_t_length` Get the string length of a string_t ##### Syntax
uint32_t duckdb_string_t_length(
  duckdb_string_t string
);
##### Parameters * `string`: The string to get the length of. ##### Return Value The length.
#### `duckdb_string_t_data` Get a pointer to the string data of a string_t ##### Syntax
const char *duckdb_string_t_data(
  duckdb_string_t *string
);
##### Parameters * `string`: The string to get the pointer to. ##### Return Value The pointer.
#### `duckdb_from_date` Decompose a `duckdb_date` object into year, month and date (stored as `duckdb_date_struct`). ##### Syntax
duckdb_date_struct duckdb_from_date(
  duckdb_date date
);
##### Parameters * `date`: The date object, as obtained from a `DUCKDB_TYPE_DATE` column. ##### Return Value The `duckdb_date_struct` with the decomposed elements.
#### `duckdb_to_date` Re-compose a `duckdb_date` from year, month and date (`duckdb_date_struct`). ##### Syntax
duckdb_date duckdb_to_date(
  duckdb_date_struct date
);
##### Parameters * `date`: The year, month and date stored in a `duckdb_date_struct`. ##### Return Value The `duckdb_date` element.
#### `duckdb_is_finite_date` Test a `duckdb_date` to see if it is a finite value. ##### Syntax
bool duckdb_is_finite_date(
  duckdb_date date
);
##### Parameters * `date`: The date object, as obtained from a `DUCKDB_TYPE_DATE` column. ##### Return Value True if the date is finite, false if it is ±infinity.
#### `duckdb_from_time` Decompose a `duckdb_time` object into hour, minute, second and microsecond (stored as `duckdb_time_struct`). ##### Syntax
duckdb_time_struct duckdb_from_time(
  duckdb_time time
);
##### Parameters * `time`: The time object, as obtained from a `DUCKDB_TYPE_TIME` column. ##### Return Value The `duckdb_time_struct` with the decomposed elements.
#### `duckdb_create_time_tz` Create a `duckdb_time_tz` object from micros and a timezone offset. ##### Syntax
duckdb_time_tz duckdb_create_time_tz(
  int64_t micros,
  int32_t offset
);
##### Parameters * `micros`: The microsecond component of the time. * `offset`: The timezone offset component of the time. ##### Return Value The `duckdb_time_tz` element.
#### `duckdb_from_time_tz` Decompose a TIME_TZ objects into micros and a timezone offset. Use `duckdb_from_time` to further decompose the micros into hour, minute, second and microsecond. ##### Syntax
duckdb_time_tz_struct duckdb_from_time_tz(
  duckdb_time_tz micros
);
##### Parameters * `micros`: The time object, as obtained from a `DUCKDB_TYPE_TIME_TZ` column.
#### `duckdb_to_time` Re-compose a `duckdb_time` from hour, minute, second and microsecond (`duckdb_time_struct`). ##### Syntax
duckdb_time duckdb_to_time(
  duckdb_time_struct time
);
##### Parameters * `time`: The hour, minute, second and microsecond in a `duckdb_time_struct`. ##### Return Value The `duckdb_time` element.
#### `duckdb_from_timestamp` Decompose a `duckdb_timestamp` object into a `duckdb_timestamp_struct`. ##### Syntax
duckdb_timestamp_struct duckdb_from_timestamp(
  duckdb_timestamp ts
);
##### Parameters * `ts`: The ts object, as obtained from a `DUCKDB_TYPE_TIMESTAMP` column. ##### Return Value The `duckdb_timestamp_struct` with the decomposed elements.
#### `duckdb_to_timestamp` Re-compose a `duckdb_timestamp` from a duckdb_timestamp_struct. ##### Syntax
duckdb_timestamp duckdb_to_timestamp(
  duckdb_timestamp_struct ts
);
##### Parameters * `ts`: The de-composed elements in a `duckdb_timestamp_struct`. ##### Return Value The `duckdb_timestamp` element.
#### `duckdb_is_finite_timestamp` Test a `duckdb_timestamp` to see if it is a finite value. ##### Syntax
bool duckdb_is_finite_timestamp(
  duckdb_timestamp ts
);
##### Parameters * `ts`: The duckdb_timestamp object, as obtained from a `DUCKDB_TYPE_TIMESTAMP` column. ##### Return Value True if the timestamp is finite, false if it is ±infinity.
#### `duckdb_is_finite_timestamp_s` Test a `duckdb_timestamp_s` to see if it is a finite value. ##### Syntax
bool duckdb_is_finite_timestamp_s(
  duckdb_timestamp_s ts
);
##### Parameters * `ts`: The duckdb_timestamp_s object, as obtained from a `DUCKDB_TYPE_TIMESTAMP_S` column. ##### Return Value True if the timestamp is finite, false if it is ±infinity.
#### `duckdb_is_finite_timestamp_ms` Test a `duckdb_timestamp_ms` to see if it is a finite value. ##### Syntax
bool duckdb_is_finite_timestamp_ms(
  duckdb_timestamp_ms ts
);
##### Parameters * `ts`: The duckdb_timestamp_ms object, as obtained from a `DUCKDB_TYPE_TIMESTAMP_MS` column. ##### Return Value True if the timestamp is finite, false if it is ±infinity.
#### `duckdb_is_finite_timestamp_ns` Test a `duckdb_timestamp_ns` to see if it is a finite value. ##### Syntax
bool duckdb_is_finite_timestamp_ns(
  duckdb_timestamp_ns ts
);
##### Parameters * `ts`: The duckdb_timestamp_ns object, as obtained from a `DUCKDB_TYPE_TIMESTAMP_NS` column. ##### Return Value True if the timestamp is finite, false if it is ±infinity.
#### `duckdb_hugeint_to_double` Converts a duckdb_hugeint object (as obtained from a `DUCKDB_TYPE_HUGEINT` column) into a double. ##### Syntax
double duckdb_hugeint_to_double(
  duckdb_hugeint val
);
##### Parameters * `val`: The hugeint value. ##### Return Value The converted `double` element.
#### `duckdb_double_to_hugeint` Converts a double value to a duckdb_hugeint object. If the conversion fails because the double value is too big the result will be 0. ##### Syntax
duckdb_hugeint duckdb_double_to_hugeint(
  double val
);
##### Parameters * `val`: The double value. ##### Return Value The converted `duckdb_hugeint` element.
#### `duckdb_uhugeint_to_double` Converts a duckdb_uhugeint object (as obtained from a `DUCKDB_TYPE_UHUGEINT` column) into a double. ##### Syntax
double duckdb_uhugeint_to_double(
  duckdb_uhugeint val
);
##### Parameters * `val`: The uhugeint value. ##### Return Value The converted `double` element.
#### `duckdb_double_to_uhugeint` Converts a double value to a duckdb_uhugeint object. If the conversion fails because the double value is too big the result will be 0. ##### Syntax
duckdb_uhugeint duckdb_double_to_uhugeint(
  double val
);
##### Parameters * `val`: The double value. ##### Return Value The converted `duckdb_uhugeint` element.
#### `duckdb_double_to_decimal` Converts a double value to a duckdb_decimal object. If the conversion fails because the double value is too big, or the width/scale are invalid the result will be 0. ##### Syntax
duckdb_decimal duckdb_double_to_decimal(
  double val,
  uint8_t width,
  uint8_t scale
);
##### Parameters * `val`: The double value. ##### Return Value The converted `duckdb_decimal` element.
#### `duckdb_decimal_to_double` Converts a duckdb_decimal object (as obtained from a `DUCKDB_TYPE_DECIMAL` column) into a double. ##### Syntax
double duckdb_decimal_to_double(
  duckdb_decimal val
);
##### Parameters * `val`: The decimal value. ##### Return Value The converted `double` element.
#### `duckdb_prepare` Create a prepared statement object from a query. Note that after calling `duckdb_prepare`, the prepared statement should always be destroyed using `duckdb_destroy_prepare`, even if the prepare fails. If the prepare fails, `duckdb_prepare_error` can be called to obtain the reason why the prepare failed. ##### Syntax
duckdb_state duckdb_prepare(
  duckdb_connection connection,
  const char *query,
  duckdb_prepared_statement *out_prepared_statement
);
##### Parameters * `connection`: The connection object * `query`: The SQL query to prepare * `out_prepared_statement`: The resulting prepared statement object ##### Return Value `DuckDBSuccess` on success or `DuckDBError` on failure.
#### `duckdb_destroy_prepare` Closes the prepared statement and de-allocates all memory allocated for the statement. ##### Syntax
void duckdb_destroy_prepare(
  duckdb_prepared_statement *prepared_statement
);
##### Parameters * `prepared_statement`: The prepared statement to destroy.
#### `duckdb_prepare_error` Returns the error message associated with the given prepared statement. If the prepared statement has no error message, this returns `nullptr` instead. The error message should not be freed. It will be de-allocated when `duckdb_destroy_prepare` is called. ##### Syntax
const char *duckdb_prepare_error(
  duckdb_prepared_statement prepared_statement
);
##### Parameters * `prepared_statement`: The prepared statement to obtain the error from. ##### Return Value The error message, or `nullptr` if there is none.
#### `duckdb_nparams` Returns the number of parameters that can be provided to the given prepared statement. Returns 0 if the query was not successfully prepared. ##### Syntax
idx_t duckdb_nparams(
  duckdb_prepared_statement prepared_statement
);
##### Parameters * `prepared_statement`: The prepared statement to obtain the number of parameters for.
#### `duckdb_parameter_name` Returns the name used to identify the parameter The returned string should be freed using `duckdb_free`. Returns NULL if the index is out of range for the provided prepared statement. ##### Syntax
const char *duckdb_parameter_name(
  duckdb_prepared_statement prepared_statement,
  idx_t index
);
##### Parameters * `prepared_statement`: The prepared statement for which to get the parameter name from.
#### `duckdb_param_type` Returns the parameter type for the parameter at the given index. Returns `DUCKDB_TYPE_INVALID` if the parameter index is out of range or the statement was not successfully prepared. ##### Syntax
duckdb_type duckdb_param_type(
  duckdb_prepared_statement prepared_statement,
  idx_t param_idx
);
##### Parameters * `prepared_statement`: The prepared statement. * `param_idx`: The parameter index. ##### Return Value The parameter type
#### `duckdb_param_logical_type` Returns the logical type for the parameter at the given index. Returns `nullptr` if the parameter index is out of range or the statement was not successfully prepared. The return type of this call should be destroyed with `duckdb_destroy_logical_type`. ##### Syntax
duckdb_logical_type duckdb_param_logical_type(
  duckdb_prepared_statement prepared_statement,
  idx_t param_idx
);
##### Parameters * `prepared_statement`: The prepared statement. * `param_idx`: The parameter index. ##### Return Value The logical type of the parameter
#### `duckdb_clear_bindings` Clear the params bind to the prepared statement. ##### Syntax
duckdb_state duckdb_clear_bindings(
  duckdb_prepared_statement prepared_statement
);

#### `duckdb_prepared_statement_type` Returns the statement type of the statement to be executed ##### Syntax
duckdb_statement_type duckdb_prepared_statement_type(
  duckdb_prepared_statement statement
);
##### Parameters * `statement`: The prepared statement. ##### Return Value duckdb_statement_type value or DUCKDB_STATEMENT_TYPE_INVALID
#### `duckdb_bind_value` Binds a value to the prepared statement at the specified index. ##### Syntax
duckdb_state duckdb_bind_value(
  duckdb_prepared_statement prepared_statement,
  idx_t param_idx,
  duckdb_value val
);

#### `duckdb_bind_parameter_index` Retrieve the index of the parameter for the prepared statement, identified by name ##### Syntax
duckdb_state duckdb_bind_parameter_index(
  duckdb_prepared_statement prepared_statement,
  idx_t *param_idx_out,
  const char *name
);

#### `duckdb_bind_boolean` Binds a bool value to the prepared statement at the specified index. ##### Syntax
duckdb_state duckdb_bind_boolean(
  duckdb_prepared_statement prepared_statement,
  idx_t param_idx,
  bool val
);

#### `duckdb_bind_int8` Binds an int8_t value to the prepared statement at the specified index. ##### Syntax
duckdb_state duckdb_bind_int8(
  duckdb_prepared_statement prepared_statement,
  idx_t param_idx,
  int8_t val
);

#### `duckdb_bind_int16` Binds an int16_t value to the prepared statement at the specified index. ##### Syntax
duckdb_state duckdb_bind_int16(
  duckdb_prepared_statement prepared_statement,
  idx_t param_idx,
  int16_t val
);

#### `duckdb_bind_int32` Binds an int32_t value to the prepared statement at the specified index. ##### Syntax
duckdb_state duckdb_bind_int32(
  duckdb_prepared_statement prepared_statement,
  idx_t param_idx,
  int32_t val
);

#### `duckdb_bind_int64` Binds an int64_t value to the prepared statement at the specified index. ##### Syntax
duckdb_state duckdb_bind_int64(
  duckdb_prepared_statement prepared_statement,
  idx_t param_idx,
  int64_t val
);

#### `duckdb_bind_hugeint` Binds a duckdb_hugeint value to the prepared statement at the specified index. ##### Syntax
duckdb_state duckdb_bind_hugeint(
  duckdb_prepared_statement prepared_statement,
  idx_t param_idx,
  duckdb_hugeint val
);

#### `duckdb_bind_uhugeint` Binds a duckdb_uhugeint value to the prepared statement at the specified index. ##### Syntax
duckdb_state duckdb_bind_uhugeint(
  duckdb_prepared_statement prepared_statement,
  idx_t param_idx,
  duckdb_uhugeint val
);

#### `duckdb_bind_decimal` Binds a duckdb_decimal value to the prepared statement at the specified index. ##### Syntax
duckdb_state duckdb_bind_decimal(
  duckdb_prepared_statement prepared_statement,
  idx_t param_idx,
  duckdb_decimal val
);

#### `duckdb_bind_uint8` Binds a uint8_t value to the prepared statement at the specified index. ##### Syntax
duckdb_state duckdb_bind_uint8(
  duckdb_prepared_statement prepared_statement,
  idx_t param_idx,
  uint8_t val
);

#### `duckdb_bind_uint16` Binds a uint16_t value to the prepared statement at the specified index. ##### Syntax
duckdb_state duckdb_bind_uint16(
  duckdb_prepared_statement prepared_statement,
  idx_t param_idx,
  uint16_t val
);

#### `duckdb_bind_uint32` Binds a uint32_t value to the prepared statement at the specified index. ##### Syntax
duckdb_state duckdb_bind_uint32(
  duckdb_prepared_statement prepared_statement,
  idx_t param_idx,
  uint32_t val
);

#### `duckdb_bind_uint64` Binds a uint64_t value to the prepared statement at the specified index. ##### Syntax
duckdb_state duckdb_bind_uint64(
  duckdb_prepared_statement prepared_statement,
  idx_t param_idx,
  uint64_t val
);

#### `duckdb_bind_float` Binds a float value to the prepared statement at the specified index. ##### Syntax
duckdb_state duckdb_bind_float(
  duckdb_prepared_statement prepared_statement,
  idx_t param_idx,
  float val
);

#### `duckdb_bind_double` Binds a double value to the prepared statement at the specified index. ##### Syntax
duckdb_state duckdb_bind_double(
  duckdb_prepared_statement prepared_statement,
  idx_t param_idx,
  double val
);

#### `duckdb_bind_date` Binds a duckdb_date value to the prepared statement at the specified index. ##### Syntax
duckdb_state duckdb_bind_date(
  duckdb_prepared_statement prepared_statement,
  idx_t param_idx,
  duckdb_date val
);

#### `duckdb_bind_time` Binds a duckdb_time value to the prepared statement at the specified index. ##### Syntax
duckdb_state duckdb_bind_time(
  duckdb_prepared_statement prepared_statement,
  idx_t param_idx,
  duckdb_time val
);

#### `duckdb_bind_timestamp` Binds a duckdb_timestamp value to the prepared statement at the specified index. ##### Syntax
duckdb_state duckdb_bind_timestamp(
  duckdb_prepared_statement prepared_statement,
  idx_t param_idx,
  duckdb_timestamp val
);

#### `duckdb_bind_timestamp_tz` Binds a duckdb_timestamp value to the prepared statement at the specified index. ##### Syntax
duckdb_state duckdb_bind_timestamp_tz(
  duckdb_prepared_statement prepared_statement,
  idx_t param_idx,
  duckdb_timestamp val
);

#### `duckdb_bind_interval` Binds a duckdb_interval value to the prepared statement at the specified index. ##### Syntax
duckdb_state duckdb_bind_interval(
  duckdb_prepared_statement prepared_statement,
  idx_t param_idx,
  duckdb_interval val
);

#### `duckdb_bind_varchar` Binds a null-terminated varchar value to the prepared statement at the specified index. ##### Syntax
duckdb_state duckdb_bind_varchar(
  duckdb_prepared_statement prepared_statement,
  idx_t param_idx,
  const char *val
);

#### `duckdb_bind_varchar_length` Binds a varchar value to the prepared statement at the specified index. ##### Syntax
duckdb_state duckdb_bind_varchar_length(
  duckdb_prepared_statement prepared_statement,
  idx_t param_idx,
  const char *val,
  idx_t length
);

#### `duckdb_bind_blob` Binds a blob value to the prepared statement at the specified index. ##### Syntax
duckdb_state duckdb_bind_blob(
  duckdb_prepared_statement prepared_statement,
  idx_t param_idx,
  const void *data,
  idx_t length
);

#### `duckdb_bind_null` Binds a NULL value to the prepared statement at the specified index. ##### Syntax
duckdb_state duckdb_bind_null(
  duckdb_prepared_statement prepared_statement,
  idx_t param_idx
);

#### `duckdb_execute_prepared` Executes the prepared statement with the given bound parameters, and returns a materialized query result. This method can be called multiple times for each prepared statement, and the parameters can be modified between calls to this function. Note that the result must be freed with `duckdb_destroy_result`. ##### Syntax
duckdb_state duckdb_execute_prepared(
  duckdb_prepared_statement prepared_statement,
  duckdb_result *out_result
);
##### Parameters * `prepared_statement`: The prepared statement to execute. * `out_result`: The query result. ##### Return Value `DuckDBSuccess` on success or `DuckDBError` on failure.
#### `duckdb_execute_prepared_streaming` > Warning Deprecation notice. This method is scheduled for removal in a future release. Executes the prepared statement with the given bound parameters, and returns an optionally-streaming query result. To determine if the resulting query was in fact streamed, use `duckdb_result_is_streaming` This method can be called multiple times for each prepared statement, and the parameters can be modified between calls to this function. Note that the result must be freed with `duckdb_destroy_result`. ##### Syntax
duckdb_state duckdb_execute_prepared_streaming(
  duckdb_prepared_statement prepared_statement,
  duckdb_result *out_result
);
##### Parameters * `prepared_statement`: The prepared statement to execute. * `out_result`: The query result. ##### Return Value `DuckDBSuccess` on success or `DuckDBError` on failure.
#### `duckdb_extract_statements` Extract all statements from a query. Note that after calling `duckdb_extract_statements`, the extracted statements should always be destroyed using `duckdb_destroy_extracted`, even if no statements were extracted. If the extract fails, `duckdb_extract_statements_error` can be called to obtain the reason why the extract failed. ##### Syntax
idx_t duckdb_extract_statements(
  duckdb_connection connection,
  const char *query,
  duckdb_extracted_statements *out_extracted_statements
);
##### Parameters * `connection`: The connection object * `query`: The SQL query to extract * `out_extracted_statements`: The resulting extracted statements object ##### Return Value The number of extracted statements or 0 on failure.
#### `duckdb_prepare_extracted_statement` Prepare an extracted statement. Note that after calling `duckdb_prepare_extracted_statement`, the prepared statement should always be destroyed using `duckdb_destroy_prepare`, even if the prepare fails. If the prepare fails, `duckdb_prepare_error` can be called to obtain the reason why the prepare failed. ##### Syntax
duckdb_state duckdb_prepare_extracted_statement(
  duckdb_connection connection,
  duckdb_extracted_statements extracted_statements,
  idx_t index,
  duckdb_prepared_statement *out_prepared_statement
);
##### Parameters * `connection`: The connection object * `extracted_statements`: The extracted statements object * `index`: The index of the extracted statement to prepare * `out_prepared_statement`: The resulting prepared statement object ##### Return Value `DuckDBSuccess` on success or `DuckDBError` on failure.
#### `duckdb_extract_statements_error` Returns the error message contained within the extracted statements. The result of this function must not be freed. It will be cleaned up when `duckdb_destroy_extracted` is called. ##### Syntax
const char *duckdb_extract_statements_error(
  duckdb_extracted_statements extracted_statements
);
##### Parameters * `extracted_statements`: The extracted statements to fetch the error from. ##### Return Value The error of the extracted statements.
#### `duckdb_destroy_extracted` De-allocates all memory allocated for the extracted statements. ##### Syntax
void duckdb_destroy_extracted(
  duckdb_extracted_statements *extracted_statements
);
##### Parameters * `extracted_statements`: The extracted statements to destroy.
#### `duckdb_pending_prepared` Executes the prepared statement with the given bound parameters, and returns a pending result. The pending result represents an intermediate structure for a query that is not yet fully executed. The pending result can be used to incrementally execute a query, returning control to the client between tasks. Note that after calling `duckdb_pending_prepared`, the pending result should always be destroyed using `duckdb_destroy_pending`, even if this function returns DuckDBError. ##### Syntax
duckdb_state duckdb_pending_prepared(
  duckdb_prepared_statement prepared_statement,
  duckdb_pending_result *out_result
);
##### Parameters * `prepared_statement`: The prepared statement to execute. * `out_result`: The pending query result. ##### Return Value `DuckDBSuccess` on success or `DuckDBError` on failure.
#### `duckdb_pending_prepared_streaming` > Warning Deprecation notice. This method is scheduled for removal in a future release. Executes the prepared statement with the given bound parameters, and returns a pending result. This pending result will create a streaming duckdb_result when executed. The pending result represents an intermediate structure for a query that is not yet fully executed. Note that after calling `duckdb_pending_prepared_streaming`, the pending result should always be destroyed using `duckdb_destroy_pending`, even if this function returns DuckDBError. ##### Syntax
duckdb_state duckdb_pending_prepared_streaming(
  duckdb_prepared_statement prepared_statement,
  duckdb_pending_result *out_result
);
##### Parameters * `prepared_statement`: The prepared statement to execute. * `out_result`: The pending query result. ##### Return Value `DuckDBSuccess` on success or `DuckDBError` on failure.
#### `duckdb_destroy_pending` Closes the pending result and de-allocates all memory allocated for the result. ##### Syntax
void duckdb_destroy_pending(
  duckdb_pending_result *pending_result
);
##### Parameters * `pending_result`: The pending result to destroy.
#### `duckdb_pending_error` Returns the error message contained within the pending result. The result of this function must not be freed. It will be cleaned up when `duckdb_destroy_pending` is called. ##### Syntax
const char *duckdb_pending_error(
  duckdb_pending_result pending_result
);
##### Parameters * `pending_result`: The pending result to fetch the error from. ##### Return Value The error of the pending result.
#### `duckdb_pending_execute_task` Executes a single task within the query, returning whether or not the query is ready. If this returns DUCKDB_PENDING_RESULT_READY, the duckdb_execute_pending function can be called to obtain the result. If this returns DUCKDB_PENDING_RESULT_NOT_READY, the duckdb_pending_execute_task function should be called again. If this returns DUCKDB_PENDING_ERROR, an error occurred during execution. The error message can be obtained by calling duckdb_pending_error on the pending_result. ##### Syntax
duckdb_pending_state duckdb_pending_execute_task(
  duckdb_pending_result pending_result
);
##### Parameters * `pending_result`: The pending result to execute a task within. ##### Return Value The state of the pending result after the execution.
#### `duckdb_pending_execute_check_state` If this returns DUCKDB_PENDING_RESULT_READY, the duckdb_execute_pending function can be called to obtain the result. If this returns DUCKDB_PENDING_RESULT_NOT_READY, the duckdb_pending_execute_check_state function should be called again. If this returns DUCKDB_PENDING_ERROR, an error occurred during execution. The error message can be obtained by calling duckdb_pending_error on the pending_result. ##### Syntax
duckdb_pending_state duckdb_pending_execute_check_state(
  duckdb_pending_result pending_result
);
##### Parameters * `pending_result`: The pending result. ##### Return Value The state of the pending result.
#### `duckdb_execute_pending` Fully execute a pending query result, returning the final query result. If duckdb_pending_execute_task has been called until DUCKDB_PENDING_RESULT_READY was returned, this will return fast. Otherwise, all remaining tasks must be executed first. Note that the result must be freed with `duckdb_destroy_result`. ##### Syntax
duckdb_state duckdb_execute_pending(
  duckdb_pending_result pending_result,
  duckdb_result *out_result
);
##### Parameters * `pending_result`: The pending result to execute. * `out_result`: The result object. ##### Return Value `DuckDBSuccess` on success or `DuckDBError` on failure.
#### `duckdb_pending_execution_is_finished` Returns whether a duckdb_pending_state is finished executing. For example if `pending_state` is DUCKDB_PENDING_RESULT_READY, this function will return true. ##### Syntax
bool duckdb_pending_execution_is_finished(
  duckdb_pending_state pending_state
);
##### Parameters * `pending_state`: The pending state on which to decide whether to finish execution. ##### Return Value Boolean indicating pending execution should be considered finished.
#### `duckdb_destroy_value` Destroys the value and de-allocates all memory allocated for that type. ##### Syntax
void duckdb_destroy_value(
  duckdb_value *value
);
##### Parameters * `value`: The value to destroy.
#### `duckdb_create_varchar` Creates a value from a null-terminated string ##### Syntax
duckdb_value duckdb_create_varchar(
  const char *text
);
##### Parameters * `text`: The null-terminated string ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`.
#### `duckdb_create_varchar_length` Creates a value from a string ##### Syntax
duckdb_value duckdb_create_varchar_length(
  const char *text,
  idx_t length
);
##### Parameters * `text`: The text * `length`: The length of the text ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`.
#### `duckdb_create_bool` Creates a value from a boolean ##### Syntax
duckdb_value duckdb_create_bool(
  bool input
);
##### Parameters * `input`: The boolean value ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`.
#### `duckdb_create_int8` Creates a value from an int8_t (a tinyint) ##### Syntax
duckdb_value duckdb_create_int8(
  int8_t input
);
##### Parameters * `input`: The tinyint value ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`.
#### `duckdb_create_uint8` Creates a value from a uint8_t (a utinyint) ##### Syntax
duckdb_value duckdb_create_uint8(
  uint8_t input
);
##### Parameters * `input`: The utinyint value ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`.
#### `duckdb_create_int16` Creates a value from an int16_t (a smallint) ##### Syntax
duckdb_value duckdb_create_int16(
  int16_t input
);
##### Parameters * `input`: The smallint value ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`.
#### `duckdb_create_uint16` Creates a value from a uint16_t (a usmallint) ##### Syntax
duckdb_value duckdb_create_uint16(
  uint16_t input
);
##### Parameters * `input`: The usmallint value ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`.
#### `duckdb_create_int32` Creates a value from an int32_t (an integer) ##### Syntax
duckdb_value duckdb_create_int32(
  int32_t input
);
##### Parameters * `input`: The integer value ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`.
#### `duckdb_create_uint32` Creates a value from a uint32_t (a uinteger) ##### Syntax
duckdb_value duckdb_create_uint32(
  uint32_t input
);
##### Parameters * `input`: The uinteger value ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`.
#### `duckdb_create_uint64` Creates a value from a uint64_t (a ubigint) ##### Syntax
duckdb_value duckdb_create_uint64(
  uint64_t input
);
##### Parameters * `input`: The ubigint value ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`.
#### `duckdb_create_int64` Creates a value from an int64 ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`. ##### Syntax
duckdb_value duckdb_create_int64(
  int64_t val
);

#### `duckdb_create_hugeint` Creates a value from a hugeint ##### Syntax
duckdb_value duckdb_create_hugeint(
  duckdb_hugeint input
);
##### Parameters * `input`: The hugeint value ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`.
#### `duckdb_create_uhugeint` Creates a value from a uhugeint ##### Syntax
duckdb_value duckdb_create_uhugeint(
  duckdb_uhugeint input
);
##### Parameters * `input`: The uhugeint value ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`.
#### `duckdb_create_varint` Creates a VARINT value from a duckdb_varint ##### Syntax
duckdb_value duckdb_create_varint(
  duckdb_varint input
);
##### Parameters * `input`: The duckdb_varint value ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`.
#### `duckdb_create_decimal` Creates a DECIMAL value from a duckdb_decimal ##### Syntax
duckdb_value duckdb_create_decimal(
  duckdb_decimal input
);
##### Parameters * `input`: The duckdb_decimal value ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`.
#### `duckdb_create_float` Creates a value from a float ##### Syntax
duckdb_value duckdb_create_float(
  float input
);
##### Parameters * `input`: The float value ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`.
#### `duckdb_create_double` Creates a value from a double ##### Syntax
duckdb_value duckdb_create_double(
  double input
);
##### Parameters * `input`: The double value ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`.
#### `duckdb_create_date` Creates a value from a date ##### Syntax
duckdb_value duckdb_create_date(
  duckdb_date input
);
##### Parameters * `input`: The date value ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`.
#### `duckdb_create_time` Creates a value from a time ##### Syntax
duckdb_value duckdb_create_time(
  duckdb_time input
);
##### Parameters * `input`: The time value ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`.
#### `duckdb_create_time_tz_value` Creates a value from a time_tz. Not to be confused with `duckdb_create_time_tz`, which creates a duckdb_time_tz_t. ##### Syntax
duckdb_value duckdb_create_time_tz_value(
  duckdb_time_tz value
);
##### Parameters * `value`: The time_tz value ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`.
#### `duckdb_create_timestamp` Creates a TIMESTAMP value from a duckdb_timestamp ##### Syntax
duckdb_value duckdb_create_timestamp(
  duckdb_timestamp input
);
##### Parameters * `input`: The duckdb_timestamp value ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`.
#### `duckdb_create_timestamp_tz` Creates a TIMESTAMP_TZ value from a duckdb_timestamp ##### Syntax
duckdb_value duckdb_create_timestamp_tz(
  duckdb_timestamp input
);
##### Parameters * `input`: The duckdb_timestamp value ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`.
#### `duckdb_create_timestamp_s` Creates a TIMESTAMP_S value from a duckdb_timestamp_s ##### Syntax
duckdb_value duckdb_create_timestamp_s(
  duckdb_timestamp_s input
);
##### Parameters * `input`: The duckdb_timestamp_s value ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`.
#### `duckdb_create_timestamp_ms` Creates a TIMESTAMP_MS value from a duckdb_timestamp_ms ##### Syntax
duckdb_value duckdb_create_timestamp_ms(
  duckdb_timestamp_ms input
);
##### Parameters * `input`: The duckdb_timestamp_ms value ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`.
#### `duckdb_create_timestamp_ns` Creates a TIMESTAMP_NS value from a duckdb_timestamp_ns ##### Syntax
duckdb_value duckdb_create_timestamp_ns(
  duckdb_timestamp_ns input
);
##### Parameters * `input`: The duckdb_timestamp_ns value ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`.
#### `duckdb_create_interval` Creates a value from an interval ##### Syntax
duckdb_value duckdb_create_interval(
  duckdb_interval input
);
##### Parameters * `input`: The interval value ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`.
#### `duckdb_create_blob` Creates a value from a blob ##### Syntax
duckdb_value duckdb_create_blob(
  const uint8_t *data,
  idx_t length
);
##### Parameters * `data`: The blob data * `length`: The length of the blob data ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`.
#### `duckdb_create_bit` Creates a BIT value from a duckdb_bit ##### Syntax
duckdb_value duckdb_create_bit(
  duckdb_bit input
);
##### Parameters * `input`: The duckdb_bit value ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`.
#### `duckdb_create_uuid` Creates a UUID value from a uhugeint ##### Syntax
duckdb_value duckdb_create_uuid(
  duckdb_uhugeint input
);
##### Parameters * `input`: The duckdb_uhugeint containing the UUID ##### Return Value The value. This must be destroyed with `duckdb_destroy_value`.
#### `duckdb_get_bool` Returns the boolean value of the given value. ##### Syntax
bool duckdb_get_bool(
  duckdb_value val
);
##### Parameters * `val`: A duckdb_value containing a boolean ##### Return Value A boolean, or false if the value cannot be converted
#### `duckdb_get_int8` Returns the int8_t value of the given value. ##### Syntax
int8_t duckdb_get_int8(
  duckdb_value val
);
##### Parameters * `val`: A duckdb_value containing a tinyint ##### Return Value A int8_t, or MinValue if the value cannot be converted
#### `duckdb_get_uint8` Returns the uint8_t value of the given value. ##### Syntax
uint8_t duckdb_get_uint8(
  duckdb_value val
);
##### Parameters * `val`: A duckdb_value containing a utinyint ##### Return Value A uint8_t, or MinValue if the value cannot be converted
#### `duckdb_get_int16` Returns the int16_t value of the given value. ##### Syntax
int16_t duckdb_get_int16(
  duckdb_value val
);
##### Parameters * `val`: A duckdb_value containing a smallint ##### Return Value A int16_t, or MinValue if the value cannot be converted
#### `duckdb_get_uint16` Returns the uint16_t value of the given value. ##### Syntax
uint16_t duckdb_get_uint16(
  duckdb_value val
);
##### Parameters * `val`: A duckdb_value containing a usmallint ##### Return Value A uint16_t, or MinValue if the value cannot be converted
#### `duckdb_get_int32` Returns the int32_t value of the given value. ##### Syntax
int32_t duckdb_get_int32(
  duckdb_value val
);
##### Parameters * `val`: A duckdb_value containing an integer ##### Return Value A int32_t, or MinValue if the value cannot be converted
#### `duckdb_get_uint32` Returns the uint32_t value of the given value. ##### Syntax
uint32_t duckdb_get_uint32(
  duckdb_value val
);
##### Parameters * `val`: A duckdb_value containing a uinteger ##### Return Value A uint32_t, or MinValue if the value cannot be converted
#### `duckdb_get_int64` Returns the int64_t value of the given value. ##### Syntax
int64_t duckdb_get_int64(
  duckdb_value val
);
##### Parameters * `val`: A duckdb_value containing a bigint ##### Return Value A int64_t, or MinValue if the value cannot be converted
#### `duckdb_get_uint64` Returns the uint64_t value of the given value. ##### Syntax
uint64_t duckdb_get_uint64(
  duckdb_value val
);
##### Parameters * `val`: A duckdb_value containing a ubigint ##### Return Value A uint64_t, or MinValue if the value cannot be converted
#### `duckdb_get_hugeint` Returns the hugeint value of the given value. ##### Syntax
duckdb_hugeint duckdb_get_hugeint(
  duckdb_value val
);
##### Parameters * `val`: A duckdb_value containing a hugeint ##### Return Value A duckdb_hugeint, or MinValue if the value cannot be converted
#### `duckdb_get_uhugeint` Returns the uhugeint value of the given value. ##### Syntax
duckdb_uhugeint duckdb_get_uhugeint(
  duckdb_value val
);
##### Parameters * `val`: A duckdb_value containing a uhugeint ##### Return Value A duckdb_uhugeint, or MinValue if the value cannot be converted
#### `duckdb_get_varint` Returns the duckdb_varint value of the given value. The `data` field must be destroyed with `duckdb_free`. ##### Syntax
duckdb_varint duckdb_get_varint(
  duckdb_value val
);
##### Parameters * `val`: A duckdb_value containing a VARINT ##### Return Value A duckdb_varint. The `data` field must be destroyed with `duckdb_free`.
#### `duckdb_get_decimal` Returns the duckdb_decimal value of the given value. ##### Syntax
duckdb_decimal duckdb_get_decimal(
  duckdb_value val
);
##### Parameters * `val`: A duckdb_value containing a DECIMAL ##### Return Value A duckdb_decimal, or MinValue if the value cannot be converted
#### `duckdb_get_float` Returns the float value of the given value. ##### Syntax
float duckdb_get_float(
  duckdb_value val
);
##### Parameters * `val`: A duckdb_value containing a float ##### Return Value A float, or NAN if the value cannot be converted
#### `duckdb_get_double` Returns the double value of the given value. ##### Syntax
double duckdb_get_double(
  duckdb_value val
);
##### Parameters * `val`: A duckdb_value containing a double ##### Return Value A double, or NAN if the value cannot be converted
#### `duckdb_get_date` Returns the date value of the given value. ##### Syntax
duckdb_date duckdb_get_date(
  duckdb_value val
);
##### Parameters * `val`: A duckdb_value containing a date ##### Return Value A duckdb_date, or MinValue if the value cannot be converted
#### `duckdb_get_time` Returns the time value of the given value. ##### Syntax
duckdb_time duckdb_get_time(
  duckdb_value val
);
##### Parameters * `val`: A duckdb_value containing a time ##### Return Value A duckdb_time, or MinValue