h1
stringclasses 12
values | h2
stringclasses 93
values | h3
stringclasses 960
values | h5
stringlengths 0
79
| content
stringlengths 24
533k
| tokens
int64 7
158k
|
---|---|---|---|---|---|
Client APIs | C | API Reference Overview | `duckdb_value_uint16` | > **Warning. ** Deprecation notice. This method is scheduled for removal in a future release.
###### Return Value {#docs:api:c:api::return-value}
The uint16_t value at the specified location, or 0 if the value cannot be converted.
###### Syntax {#docs:api:c:api::syntax}
```c
uint16_t duckdb_value_uint16(
duckdb_result *result,
idx_t col,
idx_t row
);
```
<br> | 105 |
Client APIs | C | API Reference Overview | `duckdb_value_uint32` | > **Warning. ** Deprecation notice. This method is scheduled for removal in a future release.
###### Return Value {#docs:api:c:api::return-value}
The uint32_t value at the specified location, or 0 if the value cannot be converted.
###### Syntax {#docs:api:c:api::syntax}
```c
uint32_t duckdb_value_uint32(
duckdb_result *result,
idx_t col,
idx_t row
);
```
<br> | 105 |
Client APIs | C | API Reference Overview | `duckdb_value_uint64` | > **Warning. ** Deprecation notice. This method is scheduled for removal in a future release.
###### Return Value {#docs:api:c:api::return-value}
The uint64_t value at the specified location, or 0 if the value cannot be converted.
###### Syntax {#docs:api:c:api::syntax}
```c
uint64_t duckdb_value_uint64(
duckdb_result *result,
idx_t col,
idx_t row
);
```
<br> | 105 |
Client APIs | C | API Reference Overview | `duckdb_value_float` | > **Warning. ** Deprecation notice. This method is scheduled for removal in a future release.
###### Return Value {#docs:api:c:api::return-value}
The float value at the specified location, or 0 if the value cannot be converted.
###### Syntax {#docs:api:c:api::syntax}
```c
float duckdb_value_float(
duckdb_result *result,
idx_t col,
idx_t row
);
```
<br> | 100 |
Client APIs | C | API Reference Overview | `duckdb_value_double` | > **Warning. ** Deprecation notice. This method is scheduled for removal in a future release.
###### Return Value {#docs:api:c:api::return-value}
The double value at the specified location, or 0 if the value cannot be converted.
###### Syntax {#docs:api:c:api::syntax}
```c
double duckdb_value_double(
duckdb_result *result,
idx_t col,
idx_t row
);
```
<br> | 100 |
Client APIs | C | API Reference Overview | `duckdb_value_date` | > **Warning. ** Deprecation notice. This method is scheduled for removal in a future release.
###### Return Value {#docs:api:c:api::return-value}
The duckdb_date value at the specified location, or 0 if the value cannot be converted.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_date duckdb_value_date(
duckdb_result *result,
idx_t col,
idx_t row
);
```
<br> | 104 |
Client APIs | C | API Reference Overview | `duckdb_value_time` | > **Warning. ** Deprecation notice. This method is scheduled for removal in a future release.
###### Return Value {#docs:api:c:api::return-value}
The duckdb_time value at the specified location, or 0 if the value cannot be converted.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_time duckdb_value_time(
duckdb_result *result,
idx_t col,
idx_t row
);
```
<br> | 104 |
Client APIs | C | API Reference Overview | `duckdb_value_timestamp` | > **Warning. ** Deprecation notice. This method is scheduled for removal in a future release.
###### Return Value {#docs:api:c:api::return-value}
The duckdb_timestamp value at the specified location, or 0 if the value cannot be converted.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_timestamp duckdb_value_timestamp(
duckdb_result *result,
idx_t col,
idx_t row
);
```
<br> | 104 |
Client APIs | C | API Reference Overview | `duckdb_value_interval` | > **Warning. ** Deprecation notice. This method is scheduled for removal in a future release.
###### Return Value {#docs:api:c:api::return-value}
The duckdb_interval value at the specified location, or 0 if the value cannot be converted.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_interval duckdb_value_interval(
duckdb_result *result,
idx_t col,
idx_t row
);
```
<br> | 104 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::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 {#docs:api:c:api::syntax}
```c
char *duckdb_value_varchar(
duckdb_result *result,
idx_t col,
idx_t row
);
```
<br> | 130 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::return-value}
The string value at the specified location. Attempts to cast the result value to string.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_string duckdb_value_string(
duckdb_result *result,
idx_t col,
idx_t row
);
```
<br> | 130 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::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 {#docs:api:c:api::syntax}
```c
char *duckdb_value_varchar_internal(
duckdb_result *result,
idx_t col,
idx_t row
);
```
<br> | 140 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::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 {#docs:api:c:api::syntax}
```c
duckdb_string duckdb_value_string_internal(
duckdb_result *result,
idx_t col,
idx_t row
);
```
<br> | 140 |
Client APIs | C | API Reference Overview | `duckdb_value_blob` | > **Warning. ** Deprecation notice. This method is scheduled for removal in a future release.
###### Return Value {#docs:api:c:api::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 {#docs:api:c:api::syntax}
```c
duckdb_blob duckdb_value_blob(
duckdb_result *result,
idx_t col,
idx_t row
);
```
<br> | 127 |
Client APIs | C | API Reference Overview | `duckdb_value_is_null` | > **Warning. ** Deprecation notice. This method is scheduled for removal in a future release.
###### Return Value {#docs:api:c:api::return-value}
Returns true if the value at the specified index is NULL, and false otherwise.
###### Syntax {#docs:api:c:api::syntax}
```c
bool duckdb_value_is_null(
duckdb_result *result,
idx_t col,
idx_t row
);
```
<br> | 99 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::syntax}
```c
void *duckdb_malloc(
size_t size
);
```
###### Parameters {#docs:api:c:api::parameters}
* `size`: The number of bytes to allocate.
###### Return Value {#docs:api:c:api::return-value}
A pointer to the allocated memory region.
<br> | 115 |
Client APIs | C | API Reference Overview | `duckdb_free` | Free a value returned from `duckdb_malloc`, `duckdb_value_varchar`, `duckdb_value_blob`, or
`duckdb_value_string`.
###### Syntax {#docs:api:c:api::syntax}
```c
void duckdb_free(
void *ptr
);
```
###### Parameters {#docs:api:c:api::parameters}
* `ptr`: The memory region to de-allocate.
<br> | 90 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::return-value}
The vector size.
###### Syntax {#docs:api:c:api::syntax}
```c
idx_t duckdb_vector_size(
);
```
<br> | 82 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::syntax}
```c
bool duckdb_string_is_inlined(
duckdb_string_t string
);
```
<br> | 65 |
Client APIs | C | API Reference Overview | `duckdb_string_t_length` | Get the string length of a string_t
###### Syntax {#docs:api:c:api::syntax}
```c
uint32_t duckdb_string_t_length(
duckdb_string_t string
);
```
###### Parameters {#docs:api:c:api::parameters}
* `string`: The string to get the length of.
###### Return Value {#docs:api:c:api::return-value}
The length.
<br> | 93 |
Client APIs | C | API Reference Overview | `duckdb_string_t_data` | Get a pointer to the string data of a string_t
###### Syntax {#docs:api:c:api::syntax}
```c
const char *duckdb_string_t_data(
duckdb_string_t *string
);
```
###### Parameters {#docs:api:c:api::parameters}
* `string`: The string to get the pointer to.
###### Return Value {#docs:api:c:api::return-value}
The pointer.
<br> | 97 |
Client APIs | C | API Reference Overview | `duckdb_from_date` | Decompose a `duckdb_date` object into year, month and date (stored as `duckdb_date_struct`).
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_date_struct duckdb_from_date(
duckdb_date date
);
```
###### Parameters {#docs:api:c:api::parameters}
* `date`: The date object, as obtained from a `DUCKDB_TYPE_DATE` column.
###### Return Value {#docs:api:c:api::return-value}
The `duckdb_date_struct` with the decomposed elements.
<br> | 128 |
Client APIs | C | API Reference Overview | `duckdb_to_date` | Re-compose a `duckdb_date` from year, month and date (` duckdb_date_struct`).
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_date duckdb_to_date(
duckdb_date_struct date
);
```
###### Parameters {#docs:api:c:api::parameters}
* `date`: The year, month and date stored in a `duckdb_date_struct`.
###### Return Value {#docs:api:c:api::return-value}
The `duckdb_date` element.
<br> | 116 |
Client APIs | C | API Reference Overview | `duckdb_is_finite_date` | Test a `duckdb_date` to see if it is a finite value.
###### Syntax {#docs:api:c:api::syntax}
```c
bool duckdb_is_finite_date(
duckdb_date date
);
```
###### Parameters {#docs:api:c:api::parameters}
* `date`: The date object, as obtained from a `DUCKDB_TYPE_DATE` column.
###### Return Value {#docs:api:c:api::return-value}
True if the date is finite, false if it is ±infinity.
<br> | 119 |
Client APIs | C | API Reference Overview | `duckdb_from_time` | Decompose a `duckdb_time` object into hour, minute, second and microsecond (stored as `duckdb_time_struct`).
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_time_struct duckdb_from_time(
duckdb_time time
);
```
###### Parameters {#docs:api:c:api::parameters}
* `time`: The time object, as obtained from a `DUCKDB_TYPE_TIME` column.
###### Return Value {#docs:api:c:api::return-value}
The `duckdb_time_struct` with the decomposed elements.
<br> | 131 |
Client APIs | C | API Reference Overview | `duckdb_create_time_tz` | Create a `duckdb_time_tz` object from micros and a timezone offset.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_time_tz duckdb_create_time_tz(
int64_t micros,
int32_t offset
);
```
###### Parameters {#docs:api:c:api::parameters}
* `micros`: The microsecond component of the time.
* `offset`: The timezone offset component of the time.
###### Return Value {#docs:api:c:api::return-value}
The `duckdb_time_tz` element.
<br> | 131 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::syntax}
```c
duckdb_time_tz_struct duckdb_from_time_tz(
duckdb_time_tz micros
);
```
###### Parameters {#docs:api:c:api::parameters}
* `micros`: The time object, as obtained from a `DUCKDB_TYPE_TIME_TZ` column.
<br> | 124 |
Client APIs | C | API Reference Overview | `duckdb_to_time` | Re-compose a `duckdb_time` from hour, minute, second and microsecond (` duckdb_time_struct`).
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_time duckdb_to_time(
duckdb_time_struct time
);
```
###### Parameters {#docs:api:c:api::parameters}
* `time`: The hour, minute, second and microsecond in a `duckdb_time_struct`.
###### Return Value {#docs:api:c:api::return-value}
The `duckdb_time` element.
<br> | 121 |
Client APIs | C | API Reference Overview | `duckdb_from_timestamp` | Decompose a `duckdb_timestamp` object into a `duckdb_timestamp_struct`.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_timestamp_struct duckdb_from_timestamp(
duckdb_timestamp ts
);
```
###### Parameters {#docs:api:c:api::parameters}
* `ts`: The ts object, as obtained from a `DUCKDB_TYPE_TIMESTAMP` column.
###### Return Value {#docs:api:c:api::return-value}
The `duckdb_timestamp_struct` with the decomposed elements.
<br> | 121 |
Client APIs | C | API Reference Overview | `duckdb_to_timestamp` | Re-compose a `duckdb_timestamp` from a duckdb_timestamp_struct.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_timestamp duckdb_to_timestamp(
duckdb_timestamp_struct ts
);
```
###### Parameters {#docs:api:c:api::parameters}
* `ts`: The de-composed elements in a `duckdb_timestamp_struct`.
###### Return Value {#docs:api:c:api::return-value}
The `duckdb_timestamp` element.
<br> | 109 |
Client APIs | C | API Reference Overview | `duckdb_is_finite_timestamp` | Test a `duckdb_timestamp` to see if it is a finite value.
###### Syntax {#docs:api:c:api::syntax}
```c
bool duckdb_is_finite_timestamp(
duckdb_timestamp ts
);
```
###### Parameters {#docs:api:c:api::parameters}
* `ts`: The timestamp object, as obtained from a `DUCKDB_TYPE_TIMESTAMP` column.
###### Return Value {#docs:api:c:api::return-value}
True if the timestamp is finite, false if it is ±infinity.
<br> | 119 |
Client APIs | C | API Reference Overview | `duckdb_hugeint_to_double` | Converts a duckdb_hugeint object (as obtained from a `DUCKDB_TYPE_HUGEINT` column) into a double.
###### Syntax {#docs:api:c:api::syntax}
```c
double duckdb_hugeint_to_double(
duckdb_hugeint val
);
```
###### Parameters {#docs:api:c:api::parameters}
* `val`: The hugeint value.
###### Return Value {#docs:api:c:api::return-value}
The converted `double` element.
<br> | 116 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::syntax}
```c
duckdb_hugeint duckdb_double_to_hugeint(
double val
);
```
###### Parameters {#docs:api:c:api::parameters}
* `val`: The double value.
###### Return Value {#docs:api:c:api::return-value}
The converted `duckdb_hugeint` element.
<br> | 123 |
Client APIs | C | API Reference Overview | `duckdb_uhugeint_to_double` | Converts a duckdb_uhugeint object (as obtained from a `DUCKDB_TYPE_UHUGEINT` column) into a double.
###### Syntax {#docs:api:c:api::syntax}
```c
double duckdb_uhugeint_to_double(
duckdb_uhugeint val
);
```
###### Parameters {#docs:api:c:api::parameters}
* `val`: The uhugeint value.
###### Return Value {#docs:api:c:api::return-value}
The converted `double` element.
<br> | 118 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::syntax}
```c
duckdb_uhugeint duckdb_double_to_uhugeint(
double val
);
```
###### Parameters {#docs:api:c:api::parameters}
* `val`: The double value.
###### Return Value {#docs:api:c:api::return-value}
The converted `duckdb_uhugeint` element.
<br> | 123 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::syntax}
```c
duckdb_decimal duckdb_double_to_decimal(
double val,
uint8_t width,
uint8_t scale
);
```
###### Parameters {#docs:api:c:api::parameters}
* `val`: The double value.
###### Return Value {#docs:api:c:api::return-value}
The converted `duckdb_decimal` element.
<br> | 133 |
Client APIs | C | API Reference Overview | `duckdb_decimal_to_double` | Converts a duckdb_decimal object (as obtained from a `DUCKDB_TYPE_DECIMAL` column) into a double.
###### Syntax {#docs:api:c:api::syntax}
```c
double duckdb_decimal_to_double(
duckdb_decimal val
);
```
###### Parameters {#docs:api:c:api::parameters}
* `val`: The decimal value.
###### Return Value {#docs:api:c:api::return-value}
The converted `double` element.
<br> | 108 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_prepare(
duckdb_connection connection,
const char *query,
duckdb_prepared_statement *out_prepared_statement
);
```
###### Parameters {#docs:api:c:api::parameters}
* `connection`: The connection object
* `query`: The SQL query to prepare
* `out_prepared_statement`: The resulting prepared statement object
###### Return Value {#docs:api:c:api::return-value}
`DuckDBSuccess` on success or `DuckDBError` on failure.
<br> | 195 |
Client APIs | C | API Reference Overview | `duckdb_destroy_prepare` | Closes the prepared statement and de-allocates all memory allocated for the statement.
###### Syntax {#docs:api:c:api::syntax}
```c
void duckdb_destroy_prepare(
duckdb_prepared_statement *prepared_statement
);
```
###### Parameters {#docs:api:c:api::parameters}
* `prepared_statement`: The prepared statement to destroy.
<br> | 81 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::syntax}
```c
const char *duckdb_prepare_error(
duckdb_prepared_statement prepared_statement
);
```
###### Parameters {#docs:api:c:api::parameters}
* `prepared_statement`: The prepared statement to obtain the error from.
###### Return Value {#docs:api:c:api::return-value}
The error message, or `nullptr` if there is none.
<br> | 150 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::syntax}
```c
idx_t duckdb_nparams(
duckdb_prepared_statement prepared_statement
);
```
###### Parameters {#docs:api:c:api::parameters}
* `prepared_statement`: The prepared statement to obtain the number of parameters for.
<br> | 96 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::syntax}
```c
const char *duckdb_parameter_name(
duckdb_prepared_statement prepared_statement,
idx_t index
);
```
###### Parameters {#docs:api:c:api::parameters}
* `prepared_statement`: The prepared statement for which to get the parameter name from.
<br> | 112 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::syntax}
```c
duckdb_type duckdb_param_type(
duckdb_prepared_statement prepared_statement,
idx_t param_idx
);
```
###### Parameters {#docs:api:c:api::parameters}
* `prepared_statement`: The prepared statement.
* `param_idx`: The parameter index.
###### Return Value {#docs:api:c:api::return-value}
The parameter type
<br> | 134 |
Client APIs | C | API Reference Overview | `duckdb_clear_bindings` | Clear the params bind to the prepared statement.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_clear_bindings(
duckdb_prepared_statement prepared_statement
);
```
<br> | 48 |
Client APIs | C | API Reference Overview | `duckdb_prepared_statement_type` | Returns the statement type of the statement to be executed
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_statement_type duckdb_prepared_statement_type(
duckdb_prepared_statement statement
);
```
###### Parameters {#docs:api:c:api::parameters}
* `statement`: The prepared statement.
###### Return Value {#docs:api:c:api::return-value}
duckdb_statement_type value or DUCKDB_STATEMENT_TYPE_INVALID
<br> | 104 |
Client APIs | C | API Reference Overview | `duckdb_bind_value` | Binds a value to the prepared statement at the specified index.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_bind_value(
duckdb_prepared_statement prepared_statement,
idx_t param_idx,
duckdb_value val
);
```
<br> | 62 |
Client APIs | C | API Reference Overview | `duckdb_bind_parameter_index` | Retrieve the index of the parameter for the prepared statement, identified by name
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_bind_parameter_index(
duckdb_prepared_statement prepared_statement,
idx_t *param_idx_out,
const char *name
);
```
<br> | 66 |
Client APIs | C | API Reference Overview | `duckdb_bind_boolean` | Binds a bool value to the prepared statement at the specified index.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_bind_boolean(
duckdb_prepared_statement prepared_statement,
idx_t param_idx,
bool val
);
```
<br> | 61 |
Client APIs | C | API Reference Overview | `duckdb_bind_int8` | Binds an int8_t value to the prepared statement at the specified index.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_bind_int8(
duckdb_prepared_statement prepared_statement,
idx_t param_idx,
int8_t val
);
```
<br> | 66 |
Client APIs | C | API Reference Overview | `duckdb_bind_int16` | Binds an int16_t value to the prepared statement at the specified index.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_bind_int16(
duckdb_prepared_statement prepared_statement,
idx_t param_idx,
int16_t val
);
```
<br> | 66 |
Client APIs | C | API Reference Overview | `duckdb_bind_int32` | Binds an int32_t value to the prepared statement at the specified index.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_bind_int32(
duckdb_prepared_statement prepared_statement,
idx_t param_idx,
int32_t val
);
```
<br> | 66 |
Client APIs | C | API Reference Overview | `duckdb_bind_int64` | Binds an int64_t value to the prepared statement at the specified index.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_bind_int64(
duckdb_prepared_statement prepared_statement,
idx_t param_idx,
int64_t val
);
```
<br> | 66 |
Client APIs | C | API Reference Overview | `duckdb_bind_hugeint` | Binds a duckdb_hugeint value to the prepared statement at the specified index.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_bind_hugeint(
duckdb_prepared_statement prepared_statement,
idx_t param_idx,
duckdb_hugeint val
);
```
<br> | 71 |
Client APIs | C | API Reference Overview | `duckdb_bind_uhugeint` | Binds an duckdb_uhugeint value to the prepared statement at the specified index.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_bind_uhugeint(
duckdb_prepared_statement prepared_statement,
idx_t param_idx,
duckdb_uhugeint val
);
```
<br> | 71 |
Client APIs | C | API Reference Overview | `duckdb_bind_decimal` | Binds a duckdb_decimal value to the prepared statement at the specified index.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_bind_decimal(
duckdb_prepared_statement prepared_statement,
idx_t param_idx,
duckdb_decimal val
);
```
<br> | 65 |
Client APIs | C | API Reference Overview | `duckdb_bind_uint8` | Binds an uint8_t value to the prepared statement at the specified index.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_bind_uint8(
duckdb_prepared_statement prepared_statement,
idx_t param_idx,
uint8_t val
);
```
<br> | 66 |
Client APIs | C | API Reference Overview | `duckdb_bind_uint16` | Binds an uint16_t value to the prepared statement at the specified index.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_bind_uint16(
duckdb_prepared_statement prepared_statement,
idx_t param_idx,
uint16_t val
);
```
<br> | 66 |
Client APIs | C | API Reference Overview | `duckdb_bind_uint32` | Binds an uint32_t value to the prepared statement at the specified index.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_bind_uint32(
duckdb_prepared_statement prepared_statement,
idx_t param_idx,
uint32_t val
);
```
<br> | 66 |
Client APIs | C | API Reference Overview | `duckdb_bind_uint64` | Binds an uint64_t value to the prepared statement at the specified index.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_bind_uint64(
duckdb_prepared_statement prepared_statement,
idx_t param_idx,
uint64_t val
);
```
<br> | 66 |
Client APIs | C | API Reference Overview | `duckdb_bind_float` | Binds a float value to the prepared statement at the specified index.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_bind_float(
duckdb_prepared_statement prepared_statement,
idx_t param_idx,
float val
);
```
<br> | 61 |
Client APIs | C | API Reference Overview | `duckdb_bind_double` | Binds a double value to the prepared statement at the specified index.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_bind_double(
duckdb_prepared_statement prepared_statement,
idx_t param_idx,
double val
);
```
<br> | 61 |
Client APIs | C | API Reference Overview | `duckdb_bind_date` | Binds a duckdb_date value to the prepared statement at the specified index.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_bind_date(
duckdb_prepared_statement prepared_statement,
idx_t param_idx,
duckdb_date val
);
```
<br> | 65 |
Client APIs | C | API Reference Overview | `duckdb_bind_time` | Binds a duckdb_time value to the prepared statement at the specified index.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_bind_time(
duckdb_prepared_statement prepared_statement,
idx_t param_idx,
duckdb_time val
);
```
<br> | 65 |
Client APIs | C | API Reference Overview | `duckdb_bind_timestamp` | Binds a duckdb_timestamp value to the prepared statement at the specified index.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_bind_timestamp(
duckdb_prepared_statement prepared_statement,
idx_t param_idx,
duckdb_timestamp val
);
```
<br> | 65 |
Client APIs | C | API Reference Overview | `duckdb_bind_timestamp_tz` | Binds a duckdb_timestamp value to the prepared statement at the specified index.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_bind_timestamp_tz(
duckdb_prepared_statement prepared_statement,
idx_t param_idx,
duckdb_timestamp val
);
```
<br> | 67 |
Client APIs | C | API Reference Overview | `duckdb_bind_interval` | Binds a duckdb_interval value to the prepared statement at the specified index.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_bind_interval(
duckdb_prepared_statement prepared_statement,
idx_t param_idx,
duckdb_interval val
);
```
<br> | 65 |
Client APIs | C | API Reference Overview | `duckdb_bind_varchar` | Binds a null-terminated varchar value to the prepared statement at the specified index.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_bind_varchar(
duckdb_prepared_statement prepared_statement,
idx_t param_idx,
const char *val
);
```
<br> | 67 |
Client APIs | C | API Reference Overview | `duckdb_bind_varchar_length` | Binds a varchar value to the prepared statement at the specified index.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_bind_varchar_length(
duckdb_prepared_statement prepared_statement,
idx_t param_idx,
const char *val,
idx_t length
);
```
<br> | 69 |
Client APIs | C | API Reference Overview | `duckdb_bind_blob` | Binds a blob value to the prepared statement at the specified index.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_bind_blob(
duckdb_prepared_statement prepared_statement,
idx_t param_idx,
const void *data,
idx_t length
);
```
<br> | 67 |
Client APIs | C | API Reference Overview | `duckdb_bind_null` | Binds a NULL value to the prepared statement at the specified index.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_bind_null(
duckdb_prepared_statement prepared_statement,
idx_t param_idx
);
```
<br> | 58 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_execute_prepared(
duckdb_prepared_statement prepared_statement,
duckdb_result *out_result
);
```
###### Parameters {#docs:api:c:api::parameters}
* `prepared_statement`: The prepared statement to execute.
* `out_result`: The query result.
###### Return Value {#docs:api:c:api::return-value}
`DuckDBSuccess` on success or `DuckDBError` on failure.
<br> | 177 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_execute_prepared_streaming(
duckdb_prepared_statement prepared_statement,
duckdb_result *out_result
);
```
###### Parameters {#docs:api:c:api::parameters}
* `prepared_statement`: The prepared statement to execute.
* `out_result`: The query result.
###### Return Value {#docs:api:c:api::return-value}
`DuckDBSuccess` on success or `DuckDBError` on failure.
<br> | 223 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::syntax}
```c
idx_t duckdb_extract_statements(
duckdb_connection connection,
const char *query,
duckdb_extracted_statements *out_extracted_statements
);
```
###### Parameters {#docs:api:c:api::parameters}
* `connection`: The connection object
* `query`: The SQL query to extract
* `out_extracted_statements`: The resulting extracted statements object
###### Return Value {#docs:api:c:api::return-value}
The number of extracted statements or 0 on failure.
<br> | 195 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_prepare_extracted_statement(
duckdb_connection connection,
duckdb_extracted_statements extracted_statements,
idx_t index,
duckdb_prepared_statement *out_prepared_statement
);
```
###### Parameters {#docs:api:c:api::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 {#docs:api:c:api::return-value}
`DuckDBSuccess` on success or `DuckDBError` on failure.
<br> | 220 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::syntax}
```c
const char *duckdb_extract_statements_error(
duckdb_extracted_statements extracted_statements
);
```
###### Parameters {#docs:api:c:api::parameters}
* `extracted_statements`: The extracted statements to fetch the error from.
###### Return Value {#docs:api:c:api::return-value}
The error of the extracted statements.
<br> | 134 |
Client APIs | C | API Reference Overview | `duckdb_destroy_extracted` | De-allocates all memory allocated for the extracted statements.
###### Syntax {#docs:api:c:api::syntax}
```c
void duckdb_destroy_extracted(
duckdb_extracted_statements *extracted_statements
);
```
###### Parameters {#docs:api:c:api::parameters}
* `extracted_statements`: The extracted statements to destroy.
<br> | 82 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_pending_prepared(
duckdb_prepared_statement prepared_statement,
duckdb_pending_result *out_result
);
```
###### Parameters {#docs:api:c:api::parameters}
* `prepared_statement`: The prepared statement to execute.
* `out_result`: The pending query result.
###### Return Value {#docs:api:c:api::return-value}
`DuckDBSuccess` on success or `DuckDBError` on failure.
<br> | 210 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_pending_prepared_streaming(
duckdb_prepared_statement prepared_statement,
duckdb_pending_result *out_result
);
```
###### Parameters {#docs:api:c:api::parameters}
* `prepared_statement`: The prepared statement to execute.
* `out_result`: The pending query result.
###### Return Value {#docs:api:c:api::return-value}
`DuckDBSuccess` on success or `DuckDBError` on failure.
<br> | 229 |
Client APIs | C | API Reference Overview | `duckdb_destroy_pending` | Closes the pending result and de-allocates all memory allocated for the result.
###### Syntax {#docs:api:c:api::syntax}
```c
void duckdb_destroy_pending(
duckdb_pending_result *pending_result
);
```
###### Parameters {#docs:api:c:api::parameters}
* `pending_result`: The pending result to destroy.
<br> | 80 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::syntax}
```c
const char *duckdb_pending_error(
duckdb_pending_result pending_result
);
```
###### Parameters {#docs:api:c:api::parameters}
* `pending_result`: The pending result to fetch the error from.
###### Return Value {#docs:api:c:api::return-value}
The error of the pending result.
<br> | 127 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::syntax}
```c
duckdb_pending_state duckdb_pending_execute_task(
duckdb_pending_result pending_result
);
```
###### Parameters {#docs:api:c:api::parameters}
* `pending_result`: The pending result to execute a task within.
###### Return Value {#docs:api:c:api::return-value}
The state of the pending result after the execution.
<br> | 195 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::syntax}
```c
duckdb_pending_state duckdb_pending_execute_check_state(
duckdb_pending_result pending_result
);
```
###### Parameters {#docs:api:c:api::parameters}
* `pending_result`: The pending result.
###### Return Value {#docs:api:c:api::return-value}
The state of the pending result.
<br> | 170 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_execute_pending(
duckdb_pending_result pending_result,
duckdb_result *out_result
);
```
###### Parameters {#docs:api:c:api::parameters}
* `pending_result`: The pending result to execute.
* `out_result`: The result object.
###### Return Value {#docs:api:c:api::return-value}
`DuckDBSuccess` on success or `DuckDBError` on failure.
<br> | 178 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::syntax}
```c
bool duckdb_pending_execution_is_finished(
duckdb_pending_state pending_state
);
```
###### Parameters {#docs:api:c:api::parameters}
* `pending_state`: The pending state on which to decide whether to finish execution.
###### Return Value {#docs:api:c:api::return-value}
Boolean indicating pending execution should be considered finished.
<br> | 129 |
Client APIs | C | API Reference Overview | `duckdb_destroy_value` | Destroys the value and de-allocates all memory allocated for that type.
###### Syntax {#docs:api:c:api::syntax}
```c
void duckdb_destroy_value(
duckdb_value *value
);
```
###### Parameters {#docs:api:c:api::parameters}
* `value`: The value to destroy.
<br> | 75 |
Client APIs | C | API Reference Overview | `duckdb_create_varchar` | Creates a value from a null-terminated string
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_value duckdb_create_varchar(
const char *text
);
```
###### Parameters {#docs:api:c:api::parameters}
* `text`: The null-terminated string
###### Return Value {#docs:api:c:api::return-value}
The value. This must be destroyed with `duckdb_destroy_value`.
<br> | 101 |
Client APIs | C | API Reference Overview | `duckdb_create_varchar_length` | Creates a value from a string
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_value duckdb_create_varchar_length(
const char *text,
idx_t length
);
```
###### Parameters {#docs:api:c:api::parameters}
* `text`: The text
* `length`: The length of the text
###### Return Value {#docs:api:c:api::return-value}
The value. This must be destroyed with `duckdb_destroy_value`.
<br> | 110 |
Client APIs | C | API Reference Overview | `duckdb_create_bool` | Creates a value from a boolean
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_value duckdb_create_bool(
bool input
);
```
###### Parameters {#docs:api:c:api::parameters}
* `input`: The boolean value
###### Return Value {#docs:api:c:api::return-value}
The value. This must be destroyed with `duckdb_destroy_value`.
<br> | 93 |
Client APIs | C | API Reference Overview | `duckdb_create_int8` | Creates a value from a int8_t (a tinyint)
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_value duckdb_create_int8(
int8_t input
);
```
###### Parameters {#docs:api:c:api::parameters}
* `input`: The tinyint value
###### Return Value {#docs:api:c:api::return-value}
The value. This must be destroyed with `duckdb_destroy_value`.
<br> | 104 |
Client APIs | C | API Reference Overview | `duckdb_create_uint8` | Creates a value from a uint8_t (a utinyint)
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_value duckdb_create_uint8(
uint8_t input
);
```
###### Parameters {#docs:api:c:api::parameters}
* `input`: The utinyint value
###### Return Value {#docs:api:c:api::return-value}
The value. This must be destroyed with `duckdb_destroy_value`.
<br> | 106 |
Client APIs | C | API Reference Overview | `duckdb_create_int16` | Creates a value from a int16_t (a smallint)
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_value duckdb_create_int16(
int16_t input
);
```
###### Parameters {#docs:api:c:api::parameters}
* `input`: The smallint value
###### Return Value {#docs:api:c:api::return-value}
The value. This must be destroyed with `duckdb_destroy_value`.
<br> | 104 |
Client APIs | C | API Reference Overview | `duckdb_create_uint16` | Creates a value from a uint16_t (a usmallint)
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_value duckdb_create_uint16(
uint16_t input
);
```
###### Parameters {#docs:api:c:api::parameters}
* `input`: The usmallint value
###### Return Value {#docs:api:c:api::return-value}
The value. This must be destroyed with `duckdb_destroy_value`.
<br> | 106 |
Client APIs | C | API Reference Overview | `duckdb_create_int32` | Creates a value from a int32_t (an integer)
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_value duckdb_create_int32(
int32_t input
);
```
###### Parameters {#docs:api:c:api::parameters}
* `input`: The integer value
###### Return Value {#docs:api:c:api::return-value}
The value. This must be destroyed with `duckdb_destroy_value`.
<br> | 102 |
Client APIs | C | API Reference Overview | `duckdb_create_uint32` | Creates a value from a uint32_t (a uinteger)
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_value duckdb_create_uint32(
uint32_t input
);
```
###### Parameters {#docs:api:c:api::parameters}
* `input`: The uinteger value
###### Return Value {#docs:api:c:api::return-value}
The value. This must be destroyed with `duckdb_destroy_value`.
<br> | 104 |
Client APIs | C | API Reference Overview | `duckdb_create_uint64` | Creates a value from a uint64_t (a ubigint)
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_value duckdb_create_uint64(
uint64_t input
);
```
###### Parameters {#docs:api:c:api::parameters}
* `input`: The ubigint value
###### Return Value {#docs:api:c:api::return-value}
The value. This must be destroyed with `duckdb_destroy_value`.
<br> | 106 |
Client APIs | C | API Reference Overview | `duckdb_create_int64` | Creates a value from an int64
###### Return Value {#docs:api:c:api::return-value}
The value. This must be destroyed with `duckdb_destroy_value`.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_value duckdb_create_int64(
int64_t val
);
```
<br> | 75 |
Client APIs | C | API Reference Overview | `duckdb_create_hugeint` | Creates a value from a hugeint
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_value duckdb_create_hugeint(
duckdb_hugeint input
);
```
###### Parameters {#docs:api:c:api::parameters}
* `input`: The hugeint value
###### Return Value {#docs:api:c:api::return-value}
The value. This must be destroyed with `duckdb_destroy_value`.
<br> | 101 |
Client APIs | C | API Reference Overview | `duckdb_create_uhugeint` | Creates a value from a uhugeint
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_value duckdb_create_uhugeint(
duckdb_uhugeint input
);
```
###### Parameters {#docs:api:c:api::parameters}
* `input`: The uhugeint value
###### Return Value {#docs:api:c:api::return-value}
The value. This must be destroyed with `duckdb_destroy_value`.
<br> | 103 |
Client APIs | C | API Reference Overview | `duckdb_create_float` | Creates a value from a float
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_value duckdb_create_float(
float input
);
```
###### Parameters {#docs:api:c:api::parameters}
* `input`: The float value
###### Return Value {#docs:api:c:api::return-value}
The value. This must be destroyed with `duckdb_destroy_value`.
<br> | 93 |
Client APIs | C | API Reference Overview | `duckdb_create_double` | Creates a value from a double
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_value duckdb_create_double(
double input
);
```
###### Parameters {#docs:api:c:api::parameters}
* `input`: The double value
###### Return Value {#docs:api:c:api::return-value}
The value. This must be destroyed with `duckdb_destroy_value`.
<br> | 93 |