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_create_date` | Creates a value from a date
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_value duckdb_create_date(
duckdb_date input
);
```
###### Parameters {#docs:api:c:api::parameters}
* `input`: The date value
###### Return Value {#docs:api:c:api::return-value}
The value. This must be destroyed with `duckdb_destroy_value`.
<br> | 95 |
Client APIs | C | API Reference Overview | `duckdb_create_time` | Creates a value from a time
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_value duckdb_create_time(
duckdb_time input
);
```
###### Parameters {#docs:api:c:api::parameters}
* `input`: The time value
###### Return Value {#docs:api:c:api::return-value}
The value. This must be destroyed with `duckdb_destroy_value`.
<br> | 95 |
Client APIs | C | API Reference Overview | `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 {#docs:api:c:api::syntax}
```c
duckdb_value duckdb_create_time_tz_value(
duckdb_time_tz value
);
```
###### Parameters {#docs:api:c:api::parameters}
* `value`: The time_tz value
###### Return Value {#docs:api:c:api::return-value}
The value. This must be destroyed with `duckdb_destroy_value`.
<br> | 128 |
Client APIs | C | API Reference Overview | `duckdb_create_timestamp` | Creates a value from a timestamp
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_value duckdb_create_timestamp(
duckdb_timestamp input
);
```
###### Parameters {#docs:api:c:api::parameters}
* `input`: The timestamp value
###### Return Value {#docs:api:c:api::return-value}
The value. This must be destroyed with `duckdb_destroy_value`.
<br> | 95 |
Client APIs | C | API Reference Overview | `duckdb_create_interval` | Creates a value from an interval
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_value duckdb_create_interval(
duckdb_interval input
);
```
###### Parameters {#docs:api:c:api::parameters}
* `input`: The interval value
###### Return Value {#docs:api:c:api::return-value}
The value. This must be destroyed with `duckdb_destroy_value`.
<br> | 95 |
Client APIs | C | API Reference Overview | `duckdb_create_blob` | Creates a value from a blob
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_value duckdb_create_blob(
const uint8_t *data,
idx_t length
);
```
###### Parameters {#docs:api:c:api::parameters}
* `data`: The blob data
* `length`: The length of the blob data
###### Return Value {#docs:api:c:api::return-value}
The value. This must be destroyed with `duckdb_destroy_value`.
<br> | 112 |
Client APIs | C | API Reference Overview | `duckdb_get_bool` | Returns the boolean value of the given value.
###### Syntax {#docs:api:c:api::syntax}
```c
bool duckdb_get_bool(
duckdb_value val
);
```
###### Parameters {#docs:api:c:api::parameters}
* `val`: A duckdb_value containing a boolean
###### Return Value {#docs:api:c:api::return-value}
A boolean, or false if the value cannot be converted
<br> | 97 |
Client APIs | C | API Reference Overview | `duckdb_get_int8` | Returns the int8_t value of the given value.
###### Syntax {#docs:api:c:api::syntax}
```c
int8_t duckdb_get_int8(
duckdb_value val
);
```
###### Parameters {#docs:api:c:api::parameters}
* `val`: A duckdb_value containing a tinyint
###### Return Value {#docs:api:c:api::return-value}
A int8_t, or MinValue<int8> if the value cannot be converted
<br> | 109 |
Client APIs | C | API Reference Overview | `duckdb_get_uint8` | Returns the uint8_t value of the given value.
###### Syntax {#docs:api:c:api::syntax}
```c
uint8_t duckdb_get_uint8(
duckdb_value val
);
```
###### Parameters {#docs:api:c:api::parameters}
* `val`: A duckdb_value containing a utinyint
###### Return Value {#docs:api:c:api::return-value}
A uint8_t, or MinValue<uint8> if the value cannot be converted
<br> | 110 |
Client APIs | C | API Reference Overview | `duckdb_get_int16` | Returns the int16_t value of the given value.
###### Syntax {#docs:api:c:api::syntax}
```c
int16_t duckdb_get_int16(
duckdb_value val
);
```
###### Parameters {#docs:api:c:api::parameters}
* `val`: A duckdb_value containing a smallint
###### Return Value {#docs:api:c:api::return-value}
A int16_t, or MinValue<int16> if the value cannot be converted
<br> | 109 |
Client APIs | C | API Reference Overview | `duckdb_get_uint16` | Returns the uint16_t value of the given value.
###### Syntax {#docs:api:c:api::syntax}
```c
uint16_t duckdb_get_uint16(
duckdb_value val
);
```
###### Parameters {#docs:api:c:api::parameters}
* `val`: A duckdb_value containing a usmallint
###### Return Value {#docs:api:c:api::return-value}
A uint16_t, or MinValue<uint16> if the value cannot be converted
<br> | 110 |
Client APIs | C | API Reference Overview | `duckdb_get_int32` | Returns the int32_t value of the given value.
###### Syntax {#docs:api:c:api::syntax}
```c
int32_t duckdb_get_int32(
duckdb_value val
);
```
###### Parameters {#docs:api:c:api::parameters}
* `val`: A duckdb_value containing a integer
###### Return Value {#docs:api:c:api::return-value}
A int32_t, or MinValue<int32> if the value cannot be converted
<br> | 108 |
Client APIs | C | API Reference Overview | `duckdb_get_uint32` | Returns the uint32_t value of the given value.
###### Syntax {#docs:api:c:api::syntax}
```c
uint32_t duckdb_get_uint32(
duckdb_value val
);
```
###### Parameters {#docs:api:c:api::parameters}
* `val`: A duckdb_value containing a uinteger
###### Return Value {#docs:api:c:api::return-value}
A uint32_t, or MinValue<uint32> if the value cannot be converted
<br> | 109 |
Client APIs | C | API Reference Overview | `duckdb_get_int64` | Returns the int64_t value of the given value.
###### Syntax {#docs:api:c:api::syntax}
```c
int64_t duckdb_get_int64(
duckdb_value val
);
```
###### Parameters {#docs:api:c:api::parameters}
* `val`: A duckdb_value containing a bigint
###### Return Value {#docs:api:c:api::return-value}
A int64_t, or MinValue<int64> if the value cannot be converted
<br> | 108 |
Client APIs | C | API Reference Overview | `duckdb_get_uint64` | Returns the uint64_t value of the given value.
###### Syntax {#docs:api:c:api::syntax}
```c
uint64_t duckdb_get_uint64(
duckdb_value val
);
```
###### Parameters {#docs:api:c:api::parameters}
* `val`: A duckdb_value containing a ubigint
###### Return Value {#docs:api:c:api::return-value}
A uint64_t, or MinValue<uint64> if the value cannot be converted
<br> | 110 |
Client APIs | C | API Reference Overview | `duckdb_get_hugeint` | Returns the hugeint value of the given value.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_hugeint duckdb_get_hugeint(
duckdb_value val
);
```
###### Parameters {#docs:api:c:api::parameters}
* `val`: A duckdb_value containing a hugeint
###### Return Value {#docs:api:c:api::return-value}
A duckdb_hugeint, or MinValue<hugeint> if the value cannot be converted
<br> | 114 |
Client APIs | C | API Reference Overview | `duckdb_get_uhugeint` | Returns the uhugeint value of the given value.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_uhugeint duckdb_get_uhugeint(
duckdb_value val
);
```
###### Parameters {#docs:api:c:api::parameters}
* `val`: A duckdb_value containing a uhugeint
###### Return Value {#docs:api:c:api::return-value}
A duckdb_uhugeint, or MinValue<uhugeint> if the value cannot be converted
<br> | 117 |
Client APIs | C | API Reference Overview | `duckdb_get_float` | Returns the float value of the given value.
###### Syntax {#docs:api:c:api::syntax}
```c
float duckdb_get_float(
duckdb_value val
);
```
###### Parameters {#docs:api:c:api::parameters}
* `val`: A duckdb_value containing a float
###### Return Value {#docs:api:c:api::return-value}
A float, or NAN if the value cannot be converted
<br> | 97 |
Client APIs | C | API Reference Overview | `duckdb_get_double` | Returns the double value of the given value.
###### Syntax {#docs:api:c:api::syntax}
```c
double duckdb_get_double(
duckdb_value val
);
```
###### Parameters {#docs:api:c:api::parameters}
* `val`: A duckdb_value containing a double
###### Return Value {#docs:api:c:api::return-value}
A double, or NAN if the value cannot be converted
<br> | 97 |
Client APIs | C | API Reference Overview | `duckdb_get_date` | Returns the date value of the given value.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_date duckdb_get_date(
duckdb_value val
);
```
###### Parameters {#docs:api:c:api::parameters}
* `val`: A duckdb_value containing a date
###### Return Value {#docs:api:c:api::return-value}
A duckdb_date, or MinValue<date> if the value cannot be converted
<br> | 105 |
Client APIs | C | API Reference Overview | `duckdb_get_time` | Returns the time value of the given value.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_time duckdb_get_time(
duckdb_value val
);
```
###### Parameters {#docs:api:c:api::parameters}
* `val`: A duckdb_value containing a time
###### Return Value {#docs:api:c:api::return-value}
A duckdb_time, or MinValue<time> if the value cannot be converted
<br> | 105 |
Client APIs | C | API Reference Overview | `duckdb_get_time_tz` | Returns the time_tz value of the given value.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_time_tz duckdb_get_time_tz(
duckdb_value val
);
```
###### Parameters {#docs:api:c:api::parameters}
* `val`: A duckdb_value containing a time_tz
###### Return Value {#docs:api:c:api::return-value}
A duckdb_time_tz, or MinValue<time_tz> if the value cannot be converted
<br> | 117 |
Client APIs | C | API Reference Overview | `duckdb_get_timestamp` | Returns the timestamp value of the given value.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_timestamp duckdb_get_timestamp(
duckdb_value val
);
```
###### Parameters {#docs:api:c:api::parameters}
* `val`: A duckdb_value containing a timestamp
###### Return Value {#docs:api:c:api::return-value}
A duckdb_timestamp, or MinValue<timestamp> if the value cannot be converted
<br> | 105 |
Client APIs | C | API Reference Overview | `duckdb_get_interval` | Returns the interval value of the given value.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_interval duckdb_get_interval(
duckdb_value val
);
```
###### Parameters {#docs:api:c:api::parameters}
* `val`: A duckdb_value containing a interval
###### Return Value {#docs:api:c:api::return-value}
A duckdb_interval, or MinValue<interval> if the value cannot be converted
<br> | 105 |
Client APIs | C | API Reference Overview | `duckdb_get_value_type` | Returns the type of the given value. The type is valid as long as the value is not destroyed.
The type itself must not be destroyed.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_logical_type duckdb_get_value_type(
duckdb_value val
);
```
###### Parameters {#docs:api:c:api::parameters}
* `val`: A duckdb_value
###### Return Value {#docs:api:c:api::return-value}
A duckdb_logical_type.
<br> | 113 |
Client APIs | C | API Reference Overview | `duckdb_get_blob` | Returns the blob value of the given value.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_blob duckdb_get_blob(
duckdb_value val
);
```
###### Parameters {#docs:api:c:api::parameters}
* `val`: A duckdb_value containing a blob
###### Return Value {#docs:api:c:api::return-value}
A duckdb_blob
<br> | 92 |
Client APIs | C | API Reference Overview | `duckdb_get_varchar` | Obtains a string representation of the given value.
The result must be destroyed with `duckdb_free`.
###### Syntax {#docs:api:c:api::syntax}
```c
char *duckdb_get_varchar(
duckdb_value value
);
```
###### Parameters {#docs:api:c:api::parameters}
* `value`: The value
###### Return Value {#docs:api:c:api::return-value}
The string value. This must be destroyed with `duckdb_free`.
<br> | 110 |
Client APIs | C | API Reference Overview | `duckdb_create_struct_value` | Creates a struct value from a type and an array of values. Must be destroyed with `duckdb_destroy_value`.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_value duckdb_create_struct_value(
duckdb_logical_type type,
duckdb_value *values
);
```
###### Parameters {#docs:api:c:api::parameters}
* `type`: The type of the struct
* `values`: The values for the struct fields
###### Return Value {#docs:api:c:api::return-value}
The struct value, or nullptr, if any child type is `DUCKDB_TYPE_ANY` or `DUCKDB_TYPE_INVALID`.
<br> | 146 |
Client APIs | C | API Reference Overview | `duckdb_create_list_value` | Creates a list value from a child (element) type and an array of values of length `value_count`.
Must be destroyed with `duckdb_destroy_value`.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_value duckdb_create_list_value(
duckdb_logical_type type,
duckdb_value *values,
idx_t value_count
);
```
###### Parameters {#docs:api:c:api::parameters}
* `type`: The type of the list
* `values`: The values for the list
* `value_count`: The number of values in the list
###### Return Value {#docs:api:c:api::return-value}
The list value, or nullptr, if the child type is `DUCKDB_TYPE_ANY` or `DUCKDB_TYPE_INVALID`.
<br> | 172 |
Client APIs | C | API Reference Overview | `duckdb_create_array_value` | Creates an array value from a child (element) type and an array of values of length `value_count`.
Must be destroyed with `duckdb_destroy_value`.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_value duckdb_create_array_value(
duckdb_logical_type type,
duckdb_value *values,
idx_t value_count
);
```
###### Parameters {#docs:api:c:api::parameters}
* `type`: The type of the array
* `values`: The values for the array
* `value_count`: The number of values in the array
###### Return Value {#docs:api:c:api::return-value}
The array value, or nullptr, if the child type is `DUCKDB_TYPE_ANY` or `DUCKDB_TYPE_INVALID`.
<br> | 172 |
Client APIs | C | API Reference Overview | `duckdb_get_map_size` | Returns the number of elements in a MAP value.
###### Syntax {#docs:api:c:api::syntax}
```c
idx_t duckdb_get_map_size(
duckdb_value value
);
```
###### Parameters {#docs:api:c:api::parameters}
* `value`: The MAP value.
###### Return Value {#docs:api:c:api::return-value}
The number of elements in the map.
<br> | 94 |
Client APIs | C | API Reference Overview | `duckdb_get_map_key` | Returns the MAP key at index as a duckdb_value.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_value duckdb_get_map_key(
duckdb_value value,
idx_t index
);
```
###### Parameters {#docs:api:c:api::parameters}
* `value`: The MAP value.
* `index`: The index of the key.
###### Return Value {#docs:api:c:api::return-value}
The key as a duckdb_value.
<br> | 111 |
Client APIs | C | API Reference Overview | `duckdb_get_map_value` | Returns the MAP value at index as a duckdb_value.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_value duckdb_get_map_value(
duckdb_value value,
idx_t index
);
```
###### Parameters {#docs:api:c:api::parameters}
* `value`: The MAP value.
* `index`: The index of the value.
###### Return Value {#docs:api:c:api::return-value}
The value as a duckdb_value.
<br> | 111 |
Client APIs | C | API Reference Overview | `duckdb_create_logical_type` | Creates a `duckdb_logical_type` from a primitive type.
The resulting logical type must be destroyed with `duckdb_destroy_logical_type`.
Returns an invalid logical type, if type is: `DUCKDB_TYPE_INVALID`, `DUCKDB_TYPE_DECIMAL`, `DUCKDB_TYPE_ENUM`,
`DUCKDB_TYPE_LIST`, `DUCKDB_TYPE_STRUCT`, `DUCKDB_TYPE_MAP`, `DUCKDB_TYPE_ARRAY`, or `DUCKDB_TYPE_UNION`.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_logical_type duckdb_create_logical_type(
duckdb_type type
);
```
###### Parameters {#docs:api:c:api::parameters}
* `type`: The primitive type to create.
###### Return Value {#docs:api:c:api::return-value}
The logical type.
<br> | 182 |
Client APIs | C | API Reference Overview | `duckdb_logical_type_get_alias` | Returns the alias of a duckdb_logical_type, if set, else `nullptr`.
The result must be destroyed with `duckdb_free`.
###### Syntax {#docs:api:c:api::syntax}
```c
char *duckdb_logical_type_get_alias(
duckdb_logical_type type
);
```
###### Parameters {#docs:api:c:api::parameters}
* `type`: The logical type
###### Return Value {#docs:api:c:api::return-value}
The alias or `nullptr`
<br> | 111 |
Client APIs | C | API Reference Overview | `duckdb_logical_type_set_alias` | Sets the alias of a duckdb_logical_type.
###### Syntax {#docs:api:c:api::syntax}
```c
void duckdb_logical_type_set_alias(
duckdb_logical_type type,
const char *alias
);
```
###### Parameters {#docs:api:c:api::parameters}
* `type`: The logical type
* `alias`: The alias to set
<br> | 83 |
Client APIs | C | API Reference Overview | `duckdb_create_list_type` | Creates a LIST type from its child type.
The return type must be destroyed with `duckdb_destroy_logical_type`.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_logical_type duckdb_create_list_type(
duckdb_logical_type type
);
```
###### Parameters {#docs:api:c:api::parameters}
* `type`: The child type of the list
###### Return Value {#docs:api:c:api::return-value}
The logical type.
<br> | 108 |
Client APIs | C | API Reference Overview | `duckdb_create_array_type` | Creates an ARRAY type from its child type.
The return type must be destroyed with `duckdb_destroy_logical_type`.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_logical_type duckdb_create_array_type(
duckdb_logical_type type,
idx_t array_size
);
```
###### Parameters {#docs:api:c:api::parameters}
* `type`: The child type of the array.
* `array_size`: The number of elements in the array.
###### Return Value {#docs:api:c:api::return-value}
The logical type.
<br> | 127 |
Client APIs | C | API Reference Overview | `duckdb_create_map_type` | Creates a MAP type from its key type and value type.
The return type must be destroyed with `duckdb_destroy_logical_type`.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_logical_type duckdb_create_map_type(
duckdb_logical_type key_type,
duckdb_logical_type value_type
);
```
###### Parameters {#docs:api:c:api::parameters}
* `key_type`: The map's key type.
* `value_type`: The map's value type.
###### Return Value {#docs:api:c:api::return-value}
The logical type.
<br> | 131 |
Client APIs | C | API Reference Overview | `duckdb_create_union_type` | Creates a UNION type from the passed arrays.
The return type must be destroyed with `duckdb_destroy_logical_type`.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_logical_type duckdb_create_union_type(
duckdb_logical_type *member_types,
const char **member_names,
idx_t member_count
);
```
###### Parameters {#docs:api:c:api::parameters}
* `member_types`: The array of union member types.
* `member_names`: The union member names.
* `member_count`: The number of union members.
###### Return Value {#docs:api:c:api::return-value}
The logical type.
<br> | 144 |
Client APIs | C | API Reference Overview | `duckdb_create_struct_type` | Creates a STRUCT type based on the member types and names.
The resulting type must be destroyed with `duckdb_destroy_logical_type`.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_logical_type duckdb_create_struct_type(
duckdb_logical_type *member_types,
const char **member_names,
idx_t member_count
);
```
###### Parameters {#docs:api:c:api::parameters}
* `member_types`: The array of types of the struct members.
* `member_names`: The array of names of the struct members.
* `member_count`: The number of members of the struct.
###### Return Value {#docs:api:c:api::return-value}
The logical type.
<br> | 155 |
Client APIs | C | API Reference Overview | `duckdb_create_enum_type` | Creates an ENUM type from the passed member name array.
The resulting type should be destroyed with `duckdb_destroy_logical_type`.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_logical_type duckdb_create_enum_type(
const char **member_names,
idx_t member_count
);
```
###### Parameters {#docs:api:c:api::parameters}
* `member_names`: The array of names that the enum should consist of.
* `member_count`: The number of elements that were specified in the array.
###### Return Value {#docs:api:c:api::return-value}
The logical type.
<br> | 137 |
Client APIs | C | API Reference Overview | `duckdb_create_decimal_type` | Creates a DECIMAL type with the specified width and scale.
The resulting type should be destroyed with `duckdb_destroy_logical_type`.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_logical_type duckdb_create_decimal_type(
uint8_t width,
uint8_t scale
);
```
###### Parameters {#docs:api:c:api::parameters}
* `width`: The width of the decimal type
* `scale`: The scale of the decimal type
###### Return Value {#docs:api:c:api::return-value}
The logical type.
<br> | 126 |
Client APIs | C | API Reference Overview | `duckdb_get_type_id` | Retrieves the enum `duckdb_type` of a `duckdb_logical_type`.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_type duckdb_get_type_id(
duckdb_logical_type type
);
```
###### Parameters {#docs:api:c:api::parameters}
* `type`: The logical type.
###### Return Value {#docs:api:c:api::return-value}
The `duckdb_type` id.
<br> | 104 |
Client APIs | C | API Reference Overview | `duckdb_decimal_width` | Retrieves the width of a decimal type.
###### Syntax {#docs:api:c:api::syntax}
```c
uint8_t duckdb_decimal_width(
duckdb_logical_type type
);
```
###### Parameters {#docs:api:c:api::parameters}
* `type`: The logical type object
###### Return Value {#docs:api:c:api::return-value}
The width of the decimal type
<br> | 93 |
Client APIs | C | API Reference Overview | `duckdb_decimal_scale` | Retrieves the scale of a decimal type.
###### Syntax {#docs:api:c:api::syntax}
```c
uint8_t duckdb_decimal_scale(
duckdb_logical_type type
);
```
###### Parameters {#docs:api:c:api::parameters}
* `type`: The logical type object
###### Return Value {#docs:api:c:api::return-value}
The scale of the decimal type
<br> | 93 |
Client APIs | C | API Reference Overview | `duckdb_decimal_internal_type` | Retrieves the internal storage type of a decimal type.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_type duckdb_decimal_internal_type(
duckdb_logical_type type
);
```
###### Parameters {#docs:api:c:api::parameters}
* `type`: The logical type object
###### Return Value {#docs:api:c:api::return-value}
The internal type of the decimal type
<br> | 97 |
Client APIs | C | API Reference Overview | `duckdb_enum_internal_type` | Retrieves the internal storage type of an enum type.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_type duckdb_enum_internal_type(
duckdb_logical_type type
);
```
###### Parameters {#docs:api:c:api::parameters}
* `type`: The logical type object
###### Return Value {#docs:api:c:api::return-value}
The internal type of the enum type
<br> | 97 |
Client APIs | C | API Reference Overview | `duckdb_enum_dictionary_size` | Retrieves the dictionary size of the enum type.
###### Syntax {#docs:api:c:api::syntax}
```c
uint32_t duckdb_enum_dictionary_size(
duckdb_logical_type type
);
```
###### Parameters {#docs:api:c:api::parameters}
* `type`: The logical type object
###### Return Value {#docs:api:c:api::return-value}
The dictionary size of the enum type
<br> | 96 |
Client APIs | C | API Reference Overview | `duckdb_enum_dictionary_value` | Retrieves the dictionary value at the specified position from the enum.
The result must be freed with `duckdb_free`.
###### Syntax {#docs:api:c:api::syntax}
```c
char *duckdb_enum_dictionary_value(
duckdb_logical_type type,
idx_t index
);
```
###### Parameters {#docs:api:c:api::parameters}
* `type`: The logical type object
* `index`: The index in the dictionary
###### Return Value {#docs:api:c:api::return-value}
The string value of the enum type. Must be freed with `duckdb_free`.
<br> | 134 |
Client APIs | C | API Reference Overview | `duckdb_list_type_child_type` | Retrieves the child type of the given LIST type. Also accepts MAP types.
The result must be freed with `duckdb_destroy_logical_type`.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_logical_type duckdb_list_type_child_type(
duckdb_logical_type type
);
```
###### Parameters {#docs:api:c:api::parameters}
* `type`: The logical type, either LIST or MAP.
###### Return Value {#docs:api:c:api::return-value}
The child type of the LIST or MAP type.
<br> | 125 |
Client APIs | C | API Reference Overview | `duckdb_array_type_child_type` | Retrieves the child type of the given ARRAY type.
The result must be freed with `duckdb_destroy_logical_type`.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_logical_type duckdb_array_type_child_type(
duckdb_logical_type type
);
```
###### Parameters {#docs:api:c:api::parameters}
* `type`: The logical type. Must be ARRAY.
###### Return Value {#docs:api:c:api::return-value}
The child type of the ARRAY type.
<br> | 118 |
Client APIs | C | API Reference Overview | `duckdb_array_type_array_size` | Retrieves the array size of the given array type.
###### Syntax {#docs:api:c:api::syntax}
```c
idx_t duckdb_array_type_array_size(
duckdb_logical_type type
);
```
###### Parameters {#docs:api:c:api::parameters}
* `type`: The logical type object
###### Return Value {#docs:api:c:api::return-value}
The fixed number of elements the values of this array type can store.
<br> | 104 |
Client APIs | C | API Reference Overview | `duckdb_map_type_key_type` | Retrieves the key type of the given map type.
The result must be freed with `duckdb_destroy_logical_type`.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_logical_type duckdb_map_type_key_type(
duckdb_logical_type type
);
```
###### Parameters {#docs:api:c:api::parameters}
* `type`: The logical type object
###### Return Value {#docs:api:c:api::return-value}
The key type of the map type. Must be destroyed with `duckdb_destroy_logical_type`.
<br> | 125 |
Client APIs | C | API Reference Overview | `duckdb_map_type_value_type` | Retrieves the value type of the given map type.
The result must be freed with `duckdb_destroy_logical_type`.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_logical_type duckdb_map_type_value_type(
duckdb_logical_type type
);
```
###### Parameters {#docs:api:c:api::parameters}
* `type`: The logical type object
###### Return Value {#docs:api:c:api::return-value}
The value type of the map type. Must be destroyed with `duckdb_destroy_logical_type`.
<br> | 125 |
Client APIs | C | API Reference Overview | `duckdb_struct_type_child_count` | Returns the number of children of a struct type.
###### Syntax {#docs:api:c:api::syntax}
```c
idx_t duckdb_struct_type_child_count(
duckdb_logical_type type
);
```
###### Parameters {#docs:api:c:api::parameters}
* `type`: The logical type object
###### Return Value {#docs:api:c:api::return-value}
The number of children of a struct type.
<br> | 97 |
Client APIs | C | API Reference Overview | `duckdb_struct_type_child_name` | Retrieves the name of the struct child.
The result must be freed with `duckdb_free`.
###### Syntax {#docs:api:c:api::syntax}
```c
char *duckdb_struct_type_child_name(
duckdb_logical_type type,
idx_t index
);
```
###### Parameters {#docs:api:c:api::parameters}
* `type`: The logical type object
* `index`: The child index
###### Return Value {#docs:api:c:api::return-value}
The name of the struct type. Must be freed with `duckdb_free`.
<br> | 128 |
Client APIs | C | API Reference Overview | `duckdb_struct_type_child_type` | Retrieves the child type of the given struct type at the specified index.
The result must be freed with `duckdb_destroy_logical_type`.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_logical_type duckdb_struct_type_child_type(
duckdb_logical_type type,
idx_t index
);
```
###### Parameters {#docs:api:c:api::parameters}
* `type`: The logical type object
* `index`: The child index
###### Return Value {#docs:api:c:api::return-value}
The child type of the struct type. Must be destroyed with `duckdb_destroy_logical_type`.
<br> | 141 |
Client APIs | C | API Reference Overview | `duckdb_union_type_member_count` | Returns the number of members that the union type has.
###### Syntax {#docs:api:c:api::syntax}
```c
idx_t duckdb_union_type_member_count(
duckdb_logical_type type
);
```
###### Parameters {#docs:api:c:api::parameters}
* `type`: The logical type (union) object
###### Return Value {#docs:api:c:api::return-value}
The number of members of a union type.
<br> | 101 |
Client APIs | C | API Reference Overview | `duckdb_union_type_member_name` | Retrieves the name of the union member.
The result must be freed with `duckdb_free`.
###### Syntax {#docs:api:c:api::syntax}
```c
char *duckdb_union_type_member_name(
duckdb_logical_type type,
idx_t index
);
```
###### Parameters {#docs:api:c:api::parameters}
* `type`: The logical type object
* `index`: The child index
###### Return Value {#docs:api:c:api::return-value}
The name of the union member. Must be freed with `duckdb_free`.
<br> | 128 |
Client APIs | C | API Reference Overview | `duckdb_union_type_member_type` | Retrieves the child type of the given union member at the specified index.
The result must be freed with `duckdb_destroy_logical_type`.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_logical_type duckdb_union_type_member_type(
duckdb_logical_type type,
idx_t index
);
```
###### Parameters {#docs:api:c:api::parameters}
* `type`: The logical type object
* `index`: The child index
###### Return Value {#docs:api:c:api::return-value}
The child type of the union member. Must be destroyed with `duckdb_destroy_logical_type`.
<br> | 141 |
Client APIs | C | API Reference Overview | `duckdb_destroy_logical_type` | Destroys the logical type and de-allocates all memory allocated for that type.
###### Syntax {#docs:api:c:api::syntax}
```c
void duckdb_destroy_logical_type(
duckdb_logical_type *type
);
```
###### Parameters {#docs:api:c:api::parameters}
* `type`: The logical type to destroy.
<br> | 79 |
Client APIs | C | API Reference Overview | `duckdb_register_logical_type` | Registers a custom type within the given connection.
The type must have an alias
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_register_logical_type(
duckdb_connection con,
duckdb_logical_type type,
duckdb_create_type_info info
);
```
###### Parameters {#docs:api:c:api::parameters}
* `con`: The connection to use
* `type`: The custom type to register
###### Return Value {#docs:api:c:api::return-value}
Whether or not the registration was successful.
<br> | 123 |
Client APIs | C | API Reference Overview | `duckdb_create_data_chunk` | Creates an empty data chunk with the specified column types.
The result must be destroyed with `duckdb_destroy_data_chunk`.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_data_chunk duckdb_create_data_chunk(
duckdb_logical_type *types,
idx_t column_count
);
```
###### Parameters {#docs:api:c:api::parameters}
* `types`: An array of column types. Column types can not contain ANY and INVALID types.
* `column_count`: The number of columns.
###### Return Value {#docs:api:c:api::return-value}
The data chunk.
<br> | 135 |
Client APIs | C | API Reference Overview | `duckdb_destroy_data_chunk` | Destroys the data chunk and de-allocates all memory allocated for that chunk.
###### Syntax {#docs:api:c:api::syntax}
```c
void duckdb_destroy_data_chunk(
duckdb_data_chunk *chunk
);
```
###### Parameters {#docs:api:c:api::parameters}
* `chunk`: The data chunk to destroy.
<br> | 79 |
Client APIs | C | API Reference Overview | `duckdb_data_chunk_reset` | Resets a data chunk, clearing the validity masks and setting the cardinality of the data chunk to 0.
After calling this method, you must call `duckdb_vector_get_validity` and `duckdb_vector_get_data` to obtain current
data and validity pointers
###### Syntax {#docs:api:c:api::syntax}
```c
void duckdb_data_chunk_reset(
duckdb_data_chunk chunk
);
```
###### Parameters {#docs:api:c:api::parameters}
* `chunk`: The data chunk to reset.
<br> | 116 |
Client APIs | C | API Reference Overview | `duckdb_data_chunk_get_column_count` | Retrieves the number of columns in a data chunk.
###### Syntax {#docs:api:c:api::syntax}
```c
idx_t duckdb_data_chunk_get_column_count(
duckdb_data_chunk chunk
);
```
###### Parameters {#docs:api:c:api::parameters}
* `chunk`: The data chunk to get the data from
###### Return Value {#docs:api:c:api::return-value}
The number of columns in the data chunk
<br> | 103 |
Client APIs | C | API Reference Overview | `duckdb_data_chunk_get_vector` | Retrieves the vector at the specified column index in the data chunk.
The pointer to the vector is valid for as long as the chunk is alive.
It does NOT need to be destroyed.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_vector duckdb_data_chunk_get_vector(
duckdb_data_chunk chunk,
idx_t col_idx
);
```
###### Parameters {#docs:api:c:api::parameters}
* `chunk`: The data chunk to get the data from
###### Return Value {#docs:api:c:api::return-value}
The vector
<br> | 130 |
Client APIs | C | API Reference Overview | `duckdb_data_chunk_get_size` | Retrieves the current number of tuples in a data chunk.
###### Syntax {#docs:api:c:api::syntax}
```c
idx_t duckdb_data_chunk_get_size(
duckdb_data_chunk chunk
);
```
###### Parameters {#docs:api:c:api::parameters}
* `chunk`: The data chunk to get the data from
###### Return Value {#docs:api:c:api::return-value}
The number of tuples in the data chunk
<br> | 103 |
Client APIs | C | API Reference Overview | `duckdb_data_chunk_set_size` | Sets the current number of tuples in a data chunk.
###### Syntax {#docs:api:c:api::syntax}
```c
void duckdb_data_chunk_set_size(
duckdb_data_chunk chunk,
idx_t size
);
```
###### Parameters {#docs:api:c:api::parameters}
* `chunk`: The data chunk to set the size in
* `size`: The number of tuples in the data chunk
<br> | 92 |
Client APIs | C | API Reference Overview | `duckdb_vector_get_column_type` | Retrieves the column type of the specified vector.
The result must be destroyed with `duckdb_destroy_logical_type`.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_logical_type duckdb_vector_get_column_type(
duckdb_vector vector
);
```
###### Parameters {#docs:api:c:api::parameters}
* `vector`: The vector get the data from
###### Return Value {#docs:api:c:api::return-value}
The type of the vector
<br> | 111 |
Client APIs | C | API Reference Overview | `duckdb_vector_get_data` | Retrieves the data pointer of the vector.
The data pointer can be used to read or write values from the vector.
How to read or write values depends on the type of the vector.
###### Syntax {#docs:api:c:api::syntax}
```c
void *duckdb_vector_get_data(
duckdb_vector vector
);
```
###### Parameters {#docs:api:c:api::parameters}
* `vector`: The vector to get the data from
###### Return Value {#docs:api:c:api::return-value}
The data pointer
<br> | 122 |
Client APIs | C | API Reference Overview | `duckdb_vector_get_validity` | Retrieves the validity mask pointer of the specified vector.
If all values are valid, this function MIGHT return NULL!
The validity mask is a bitset that signifies null-ness within the data chunk.
It is a series of uint64_t values, where each uint64_t value contains validity for 64 tuples.
The bit is set to 1 if the value is valid (i.e., not NULL) or 0 if the value is invalid (i.e., NULL).
Validity of a specific value can be obtained like this:
idx_t entry_idx = row_idx / 64;
idx_t idx_in_entry = row_idx % 64;
bool is_valid = validity_mask[entry_idx] & (1 << idx_in_entry);
Alternatively, the (slower) duckdb_validity_row_is_valid function can be used.
###### Syntax {#docs:api:c:api::syntax}
```c
uint64_t *duckdb_vector_get_validity(
duckdb_vector vector
);
```
###### Parameters {#docs:api:c:api::parameters}
* `vector`: The vector to get the data from
###### Return Value {#docs:api:c:api::return-value}
The pointer to the validity mask, or NULL if no validity mask is present
<br> | 271 |
Client APIs | C | API Reference Overview | `duckdb_vector_ensure_validity_writable` | Ensures the validity mask is writable by allocating it.
After this function is called, `duckdb_vector_get_validity` will ALWAYS return non-NULL.
This allows null values to be written to the vector, regardless of whether a validity mask was present before.
###### Syntax {#docs:api:c:api::syntax}
```c
void duckdb_vector_ensure_validity_writable(
duckdb_vector vector
);
```
###### Parameters {#docs:api:c:api::parameters}
* `vector`: The vector to alter
<br> | 116 |
Client APIs | C | API Reference Overview | `duckdb_vector_assign_string_element` | Assigns a string element in the vector at the specified location.
###### Syntax {#docs:api:c:api::syntax}
```c
void duckdb_vector_assign_string_element(
duckdb_vector vector,
idx_t index,
const char *str
);
```
###### Parameters {#docs:api:c:api::parameters}
* `vector`: The vector to alter
* `index`: The row position in the vector to assign the string to
* `str`: The null-terminated string
<br> | 107 |
Client APIs | C | API Reference Overview | `duckdb_vector_assign_string_element_len` | Assigns a string element in the vector at the specified location. You may also use this function to assign BLOBs.
###### Syntax {#docs:api:c:api::syntax}
```c
void duckdb_vector_assign_string_element_len(
duckdb_vector vector,
idx_t index,
const char *str,
idx_t str_len
);
```
###### Parameters {#docs:api:c:api::parameters}
* `vector`: The vector to alter
* `index`: The row position in the vector to assign the string to
* `str`: The string
* `str_len`: The length of the string (in bytes)
<br> | 137 |
Client APIs | C | API Reference Overview | `duckdb_list_vector_get_child` | Retrieves the child vector of a list vector.
The resulting vector is valid as long as the parent vector is valid.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_vector duckdb_list_vector_get_child(
duckdb_vector vector
);
```
###### Parameters {#docs:api:c:api::parameters}
* `vector`: The vector
###### Return Value {#docs:api:c:api::return-value}
The child vector
<br> | 105 |
Client APIs | C | API Reference Overview | `duckdb_list_vector_get_size` | Returns the size of the child vector of the list.
###### Syntax {#docs:api:c:api::syntax}
```c
idx_t duckdb_list_vector_get_size(
duckdb_vector vector
);
```
###### Parameters {#docs:api:c:api::parameters}
* `vector`: The vector
###### Return Value {#docs:api:c:api::return-value}
The size of the child list
<br> | 92 |
Client APIs | C | API Reference Overview | `duckdb_list_vector_set_size` | Sets the total size of the underlying child-vector of a list vector.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_list_vector_set_size(
duckdb_vector vector,
idx_t size
);
```
###### Parameters {#docs:api:c:api::parameters}
* `vector`: The list vector.
* `size`: The size of the child list.
###### Return Value {#docs:api:c:api::return-value}
The duckdb state. Returns DuckDBError if the vector is nullptr.
<br> | 122 |
Client APIs | C | API Reference Overview | `duckdb_list_vector_reserve` | Sets the total capacity of the underlying child-vector of a list.
After calling this method, you must call `duckdb_vector_get_validity` and `duckdb_vector_get_data` to obtain current
data and validity pointers
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_list_vector_reserve(
duckdb_vector vector,
idx_t required_capacity
);
```
###### Parameters {#docs:api:c:api::parameters}
* `vector`: The list vector.
* `required_capacity`: the total capacity to reserve.
###### Return Value {#docs:api:c:api::return-value}
The duckdb state. Returns DuckDBError if the vector is nullptr.
<br> | 154 |
Client APIs | C | API Reference Overview | `duckdb_struct_vector_get_child` | Retrieves the child vector of a struct vector.
The resulting vector is valid as long as the parent vector is valid.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_vector duckdb_struct_vector_get_child(
duckdb_vector vector,
idx_t index
);
```
###### Parameters {#docs:api:c:api::parameters}
* `vector`: The vector
* `index`: The child index
###### Return Value {#docs:api:c:api::return-value}
The child vector
<br> | 117 |
Client APIs | C | API Reference Overview | `duckdb_array_vector_get_child` | Retrieves the child vector of a array vector.
The resulting vector is valid as long as the parent vector is valid.
The resulting vector has the size of the parent vector multiplied by the array size.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_vector duckdb_array_vector_get_child(
duckdb_vector vector
);
```
###### Parameters {#docs:api:c:api::parameters}
* `vector`: The vector
###### Return Value {#docs:api:c:api::return-value}
The child vector
<br> | 121 |
Client APIs | C | API Reference Overview | `duckdb_validity_row_is_valid` | Returns whether or not a row is valid (i.e., not NULL) in the given validity mask.
###### Syntax {#docs:api:c:api::syntax}
```c
bool duckdb_validity_row_is_valid(
uint64_t *validity,
idx_t row
);
```
###### Parameters {#docs:api:c:api::parameters}
* `validity`: The validity mask, as obtained through `duckdb_vector_get_validity`
* `row`: The row index
###### Return Value {#docs:api:c:api::return-value}
true if the row is valid, false otherwise
<br> | 132 |
Client APIs | C | API Reference Overview | `duckdb_validity_set_row_validity` | In a validity mask, sets a specific row to either valid or invalid.
Note that `duckdb_vector_ensure_validity_writable` should be called before calling `duckdb_vector_get_validity`,
to ensure that there is a validity mask to write to.
###### Syntax {#docs:api:c:api::syntax}
```c
void duckdb_validity_set_row_validity(
uint64_t *validity,
idx_t row,
bool valid
);
```
###### Parameters {#docs:api:c:api::parameters}
* `validity`: The validity mask, as obtained through `duckdb_vector_get_validity`.
* `row`: The row index
* `valid`: Whether or not to set the row to valid, or invalid
<br> | 160 |
Client APIs | C | API Reference Overview | `duckdb_validity_set_row_invalid` | In a validity mask, sets a specific row to invalid.
Equivalent to `duckdb_validity_set_row_validity` with valid set to false.
###### Syntax {#docs:api:c:api::syntax}
```c
void duckdb_validity_set_row_invalid(
uint64_t *validity,
idx_t row
);
```
###### Parameters {#docs:api:c:api::parameters}
* `validity`: The validity mask
* `row`: The row index
<br> | 105 |
Client APIs | C | API Reference Overview | `duckdb_validity_set_row_valid` | In a validity mask, sets a specific row to valid.
Equivalent to `duckdb_validity_set_row_validity` with valid set to true.
###### Syntax {#docs:api:c:api::syntax}
```c
void duckdb_validity_set_row_valid(
uint64_t *validity,
idx_t row
);
```
###### Parameters {#docs:api:c:api::parameters}
* `validity`: The validity mask
* `row`: The row index
<br> | 105 |
Client APIs | C | API Reference Overview | `duckdb_create_scalar_function` | Creates a new empty scalar function.
The return value should be destroyed with `duckdb_destroy_scalar_function`.
###### Return Value {#docs:api:c:api::return-value}
The scalar function object.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_scalar_function duckdb_create_scalar_function(
);
```
<br> | 77 |
Client APIs | C | API Reference Overview | `duckdb_destroy_scalar_function` | Destroys the given scalar function object.
###### Syntax {#docs:api:c:api::syntax}
```c
void duckdb_destroy_scalar_function(
duckdb_scalar_function *scalar_function
);
```
###### Parameters {#docs:api:c:api::parameters}
* `scalar_function`: The scalar function to destroy
<br> | 71 |
Client APIs | C | API Reference Overview | `duckdb_scalar_function_set_name` | Sets the name of the given scalar function.
###### Syntax {#docs:api:c:api::syntax}
```c
void duckdb_scalar_function_set_name(
duckdb_scalar_function scalar_function,
const char *name
);
```
###### Parameters {#docs:api:c:api::parameters}
* `scalar_function`: The scalar function
* `name`: The name of the scalar function
<br> | 86 |
Client APIs | C | API Reference Overview | `duckdb_scalar_function_set_varargs` | Sets the parameters of the given scalar function to varargs. Does not require adding parameters with
duckdb_scalar_function_add_parameter.
###### Syntax {#docs:api:c:api::syntax}
```c
void duckdb_scalar_function_set_varargs(
duckdb_scalar_function scalar_function,
duckdb_logical_type type
);
```
###### Parameters {#docs:api:c:api::parameters}
* `scalar_function`: The scalar function.
* `type`: The type of the arguments.
###### Return Value {#docs:api:c:api::return-value}
The parameter type. Cannot contain INVALID.
<br> | 130 |
Client APIs | C | API Reference Overview | `duckdb_scalar_function_set_special_handling` | Sets the parameters of the given scalar function to varargs. Does not require adding parameters with
duckdb_scalar_function_add_parameter.
###### Syntax {#docs:api:c:api::syntax}
```c
void duckdb_scalar_function_set_special_handling(
duckdb_scalar_function scalar_function
);
```
###### Parameters {#docs:api:c:api::parameters}
* `scalar_function`: The scalar function.
<br> | 89 |
Client APIs | C | API Reference Overview | `duckdb_scalar_function_set_volatile` | Sets the Function Stability of the scalar function to VOLATILE, indicating the function should be re-run for every row.
This limits optimization that can be performed for the function.
###### Syntax {#docs:api:c:api::syntax}
```c
void duckdb_scalar_function_set_volatile(
duckdb_scalar_function scalar_function
);
```
###### Parameters {#docs:api:c:api::parameters}
* `scalar_function`: The scalar function.
<br> | 98 |
Client APIs | C | API Reference Overview | `duckdb_scalar_function_add_parameter` | Adds a parameter to the scalar function.
###### Syntax {#docs:api:c:api::syntax}
```c
void duckdb_scalar_function_add_parameter(
duckdb_scalar_function scalar_function,
duckdb_logical_type type
);
```
###### Parameters {#docs:api:c:api::parameters}
* `scalar_function`: The scalar function.
* `type`: The parameter type. Cannot contain INVALID.
<br> | 88 |
Client APIs | C | API Reference Overview | `duckdb_scalar_function_set_return_type` | Sets the return type of the scalar function.
###### Syntax {#docs:api:c:api::syntax}
```c
void duckdb_scalar_function_set_return_type(
duckdb_scalar_function scalar_function,
duckdb_logical_type type
);
```
###### Parameters {#docs:api:c:api::parameters}
* `scalar_function`: The scalar function
* `type`: Cannot contain INVALID or ANY.
<br> | 88 |
Client APIs | C | API Reference Overview | `duckdb_scalar_function_set_extra_info` | Assigns extra information to the scalar function that can be fetched during binding, etc.
###### Syntax {#docs:api:c:api::syntax}
```c
void duckdb_scalar_function_set_extra_info(
duckdb_scalar_function scalar_function,
void *extra_info,
duckdb_delete_callback_t destroy
);
```
###### Parameters {#docs:api:c:api::parameters}
* `scalar_function`: The scalar function
* `extra_info`: The extra information
* `destroy`: The callback that will be called to destroy the bind data (if any)
<br> | 120 |
Client APIs | C | API Reference Overview | `duckdb_scalar_function_set_function` | Sets the main function of the scalar function.
###### Syntax {#docs:api:c:api::syntax}
```c
void duckdb_scalar_function_set_function(
duckdb_scalar_function scalar_function,
duckdb_scalar_function_t function
);
```
###### Parameters {#docs:api:c:api::parameters}
* `scalar_function`: The scalar function
* `function`: The function
<br> | 84 |
Client APIs | C | API Reference Overview | `duckdb_register_scalar_function` | Register the scalar function object within the given connection.
The function requires at least a name, a function and a return type.
If the function is incomplete or a function with this name already exists DuckDBError is returned.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_state duckdb_register_scalar_function(
duckdb_connection con,
duckdb_scalar_function scalar_function
);
```
###### Parameters {#docs:api:c:api::parameters}
* `con`: The connection to register it in.
* `scalar_function`: The function pointer
###### Return Value {#docs:api:c:api::return-value}
Whether or not the registration was successful.
<br> | 149 |
Client APIs | C | API Reference Overview | `duckdb_scalar_function_get_extra_info` | Retrieves the extra info of the function as set in `duckdb_scalar_function_set_extra_info`.
###### Syntax {#docs:api:c:api::syntax}
```c
void *duckdb_scalar_function_get_extra_info(
duckdb_function_info info
);
```
###### Parameters {#docs:api:c:api::parameters}
* `info`: The info object.
###### Return Value {#docs:api:c:api::return-value}
The extra info.
<br> | 104 |
Client APIs | C | API Reference Overview | `duckdb_scalar_function_set_error` | Report that an error has occurred while executing the scalar function.
###### Syntax {#docs:api:c:api::syntax}
```c
void duckdb_scalar_function_set_error(
duckdb_function_info info,
const char *error
);
```
###### Parameters {#docs:api:c:api::parameters}
* `info`: The info object.
* `error`: The error message
<br> | 84 |
Client APIs | C | API Reference Overview | `duckdb_create_scalar_function_set` | Creates a new empty scalar function set.
The return value should be destroyed with `duckdb_destroy_scalar_function_set`.
###### Return Value {#docs:api:c:api::return-value}
The scalar function set object.
###### Syntax {#docs:api:c:api::syntax}
```c
duckdb_scalar_function_set duckdb_create_scalar_function_set(
const char *name
);
```
<br> | 87 |