Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 45 additions & 45 deletions data/search_data.json

Large diffs are not rendered by default.

212 changes: 200 additions & 12 deletions docs/api/c/api.md

Large diffs are not rendered by default.

23 changes: 13 additions & 10 deletions docs/api/c/appender.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,10 @@ The error message, or `nullptr` if there is none.
### `duckdb_appender_flush`

---
Flush the appender to the table, forcing the cache of the appender to be cleared and the data to be appended to the
base table.

This should generally not be used unless you know what you are doing. Instead, call `duckdb_appender_destroy` when you
are done with the appender.
Flush the appender to the table, forcing the cache of the appender to be cleared. If flushing the data triggers a
constraint violation or any other error, then all data is invalidated, and this function returns DuckDBError.
It is not possible to append more values. Call duckdb_appender_error to obtain the error message followed by
duckdb_appender_destroy to destroy the invalidated appender.

#### Syntax

Expand All @@ -229,9 +228,10 @@ The appender to flush.
### `duckdb_appender_close`

---
Close the appender, flushing all intermediate state in the appender to the table and closing it for further appends.

This is generally not necessary. Call `duckdb_appender_destroy` instead.
Closes the appender by flushing all intermediate states and closing it for further appends. If flushing the data
triggers a constraint violation or any other error, then all data is invalidated, and this function returns DuckDBError.
Call duckdb_appender_error to obtain the error message followed by duckdb_appender_destroy to destroy the invalidated
appender.

#### Syntax

Expand All @@ -257,8 +257,11 @@ The appender to flush and close.
### `duckdb_appender_destroy`

---
Close the appender and destroy it. Flushing all intermediate state in the appender to the table, and de-allocating
all memory associated with the appender.
Closes the appender by flushing all intermediate states to the table and destroying it. By destroying it, this function
de-allocates all memory associated with the appender. If flushing the data triggers a constraint violation,
then all data is invalidated, and this function returns DuckDBError. Due to the destruction of the appender, it is no
longer possible to obtain the specific error message with duckdb_appender_error. Therefore, call duckdb_appender_close
before destroying the appender, if you need insights into the specific error.

#### Syntax

Expand Down
32 changes: 31 additions & 1 deletion docs/api/c/data_chunk.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ The primary manner of interfacing with data chunks is by obtaining the internal
<span class="kt">duckdb_state</span> <a href="#duckdb_list_vector_set_size"><span class="nf">duckdb_list_vector_set_size</span></a>(<span class="kt">duckdb_vector</span> <span class="nv">vector</span>, <span class="kt">idx_t</span> <span class="nv">size</span>);
<span class="kt">duckdb_state</span> <a href="#duckdb_list_vector_reserve"><span class="nf">duckdb_list_vector_reserve</span></a>(<span class="kt">duckdb_vector</span> <span class="nv">vector</span>, <span class="kt">idx_t</span> <span class="nv">required_capacity</span>);
<span class="kt">duckdb_vector</span> <a href="#duckdb_struct_vector_get_child"><span class="nf">duckdb_struct_vector_get_child</span></a>(<span class="kt">duckdb_vector</span> <span class="nv">vector</span>, <span class="kt">idx_t</span> <span class="nv">index</span>);
<span class="kt">duckdb_vector</span> <a href="#duckdb_array_vector_get_child"><span class="nf">duckdb_array_vector_get_child</span></a>(<span class="kt">duckdb_vector</span> <span class="nv">vector</span>);
</code></pre></div></div>

### Validity Mask Functions
Expand Down Expand Up @@ -391,7 +392,7 @@ The null-terminated string
### `duckdb_vector_assign_string_element_len`

---
Assigns a string element in the vector at the specified location.
Assigns a string element in the vector at the specified location. You may also use this function to assign BLOBs.

#### Syntax

Expand Down Expand Up @@ -569,6 +570,35 @@ The child vector
<br>


### `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

---
<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">duckdb_vector</span> <span class="nv">duckdb_array_vector_get_child</span>(<span class="nv">
</span> <span class="kt">duckdb_vector</span> <span class="nv">vector
</span>);
</code></pre></div></div>

#### Parameters

---
* `vector`

The vector
* `returns`

The child vector

<br>


### `duckdb_validity_row_is_valid`

---
Expand Down
88 changes: 88 additions & 0 deletions docs/api/c/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ For more information about data chunks, see the [documentation on data chunks](d
<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">duckdb_logical_type</span> <a href="#duckdb_create_logical_type"><span class="nf">duckdb_create_logical_type</span></a>(<span class="nv">duckdb_type</span> <span class="nv">type</span>);
<span class="kt">char</span> *<a href="#duckdb_logical_type_get_alias"><span class="nf">duckdb_logical_type_get_alias</span></a>(<span class="kt">duckdb_logical_type</span> <span class="nv">type</span>);
<span class="kt">duckdb_logical_type</span> <a href="#duckdb_create_list_type"><span class="nf">duckdb_create_list_type</span></a>(<span class="kt">duckdb_logical_type</span> <span class="nv">type</span>);
<span class="kt">duckdb_logical_type</span> <a href="#duckdb_create_array_type"><span class="nf">duckdb_create_array_type</span></a>(<span class="kt">duckdb_logical_type</span> <span class="nv">type</span>, <span class="kt">idx_t</span> <span class="nv">array_size</span>);
<span class="kt">duckdb_logical_type</span> <a href="#duckdb_create_map_type"><span class="nf">duckdb_create_map_type</span></a>(<span class="kt">duckdb_logical_type</span> <span class="nv">key_type</span>, <span class="kt">duckdb_logical_type</span> <span class="nv">value_type</span>);
<span class="kt">duckdb_logical_type</span> <a href="#duckdb_create_union_type"><span class="nf">duckdb_create_union_type</span></a>(<span class="kt">duckdb_logical_type</span> *<span class="nv">member_types</span>, <span class="kt">const</span> <span class="kt">char</span> **<span class="nv">member_names</span>, <span class="kt">idx_t</span> <span class="nv">member_count</span>);
<span class="kt">duckdb_logical_type</span> <a href="#duckdb_create_struct_type"><span class="nf">duckdb_create_struct_type</span></a>(<span class="kt">duckdb_logical_type</span> *<span class="nv">member_types</span>, <span class="kt">const</span> <span class="kt">char</span> **<span class="nv">member_names</span>, <span class="kt">idx_t</span> <span class="nv">member_count</span>);
Expand All @@ -124,6 +125,8 @@ For more information about data chunks, see the [documentation on data chunks](d
<span class="kt">uint32_t</span> <a href="#duckdb_enum_dictionary_size"><span class="nf">duckdb_enum_dictionary_size</span></a>(<span class="kt">duckdb_logical_type</span> <span class="nv">type</span>);
<span class="kt">char</span> *<a href="#duckdb_enum_dictionary_value"><span class="nf">duckdb_enum_dictionary_value</span></a>(<span class="kt">duckdb_logical_type</span> <span class="nv">type</span>, <span class="kt">idx_t</span> <span class="nv">index</span>);
<span class="kt">duckdb_logical_type</span> <a href="#duckdb_list_type_child_type"><span class="nf">duckdb_list_type_child_type</span></a>(<span class="kt">duckdb_logical_type</span> <span class="nv">type</span>);
<span class="kt">duckdb_logical_type</span> <a href="#duckdb_array_type_child_type"><span class="nf">duckdb_array_type_child_type</span></a>(<span class="kt">duckdb_logical_type</span> <span class="nv">type</span>);
<span class="kt">idx_t</span> <a href="#duckdb_array_type_array_size"><span class="nf">duckdb_array_type_array_size</span></a>(<span class="kt">duckdb_logical_type</span> <span class="nv">type</span>);
<span class="kt">duckdb_logical_type</span> <a href="#duckdb_map_type_key_type"><span class="nf">duckdb_map_type_key_type</span></a>(<span class="kt">duckdb_logical_type</span> <span class="nv">type</span>);
<span class="kt">duckdb_logical_type</span> <a href="#duckdb_map_type_value_type"><span class="nf">duckdb_map_type_value_type</span></a>(<span class="kt">duckdb_logical_type</span> <span class="nv">type</span>);
<span class="kt">idx_t</span> <a href="#duckdb_struct_type_child_count"><span class="nf">duckdb_struct_type_child_count</span></a>(<span class="kt">duckdb_logical_type</span> <span class="nv">type</span>);
Expand Down Expand Up @@ -715,6 +718,37 @@ The logical type.
<br>


### `duckdb_create_array_type`

---
Creates a array type from its child type.
The resulting type should be destroyed with `duckdb_destroy_logical_type`.

#### Syntax

---
<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">duckdb_logical_type</span> <span class="nv">duckdb_create_array_type</span>(<span class="nv">
</span> <span class="kt">duckdb_logical_type</span> <span class="nv">type</span>,<span class="nv">
</span> <span class="kt">idx_t</span> <span class="nv">array_size
</span>);
</code></pre></div></div>

#### Parameters

---
* `type`

The child type of array type to create.
* `array_size`

The number of elements in the array.
* `returns`

The logical type.

<br>


### `duckdb_create_map_type`

---
Expand Down Expand Up @@ -1091,6 +1125,60 @@ The child type of the list type. Must be destroyed with `duckdb_destroy_logical_
<br>


### `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

---
<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">duckdb_logical_type</span> <span class="nv">duckdb_array_type_child_type</span>(<span class="nv">
</span> <span class="kt">duckdb_logical_type</span> <span class="nv">type
</span>);
</code></pre></div></div>

#### Parameters

---
* `type`

The logical type object
* `returns`

The child type of the array type. Must be destroyed with `duckdb_destroy_logical_type`.

<br>


### `duckdb_array_type_array_size`

---
Retrieves the array size of the given array type.

#### Syntax

---
<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">idx_t</span> <span class="nv">duckdb_array_type_array_size</span>(<span class="nv">
</span> <span class="kt">duckdb_logical_type</span> <span class="nv">type
</span>);
</code></pre></div></div>

#### Parameters

---
* `type`

The logical type object
* `returns`

The fixed number of elements the values of this array type can store.

<br>


### `duckdb_map_type_key_type`

---
Expand Down
35 changes: 35 additions & 0 deletions docs/api/c/value.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The value class represents a single value of any type.
<span class="kt">duckdb_value</span> <a href="#duckdb_create_int64"><span class="nf">duckdb_create_int64</span></a>(<span class="kt">int64_t</span> <span class="nv">val</span>);
<span class="kt">duckdb_value</span> <a href="#duckdb_create_struct_value"><span class="nf">duckdb_create_struct_value</span></a>(<span class="kt">duckdb_logical_type</span> <span class="nv">type</span>, <span class="kt">duckdb_value</span> *<span class="nv">values</span>);
<span class="kt">duckdb_value</span> <a href="#duckdb_create_list_value"><span class="nf">duckdb_create_list_value</span></a>(<span class="kt">duckdb_logical_type</span> <span class="nv">type</span>, <span class="kt">duckdb_value</span> *<span class="nv">values</span>, <span class="kt">idx_t</span> <span class="nv">value_count</span>);
<span class="kt">duckdb_value</span> <a href="#duckdb_create_array_value"><span class="nf">duckdb_create_array_value</span></a>(<span class="kt">duckdb_logical_type</span> <span class="nv">type</span>, <span class="kt">duckdb_value</span> *<span class="nv">values</span>, <span class="kt">idx_t</span> <span class="nv">value_count</span>);
<span class="kt">char</span> *<a href="#duckdb_get_varchar"><span class="nf">duckdb_get_varchar</span></a>(<span class="kt">duckdb_value</span> <span class="nv">value</span>);
<span class="kt">int64_t</span> <a href="#duckdb_get_int64"><span class="nf">duckdb_get_int64</span></a>(<span class="kt">duckdb_value</span> <span class="nv">value</span>);
</code></pre></div></div>
Expand Down Expand Up @@ -188,6 +189,40 @@ The value. This must be destroyed with `duckdb_destroy_value`.
<br>


### `duckdb_create_array_value`

---
Creates a array value from a type and an array of values of length `value_count`

#### Syntax

---
<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">duckdb_value</span> <span class="nv">duckdb_create_array_value</span>(<span class="nv">
</span> <span class="kt">duckdb_logical_type</span> <span class="nv">type</span>,<span class="nv">
</span> <span class="kt">duckdb_value</span> *<span class="nv">values</span>,<span class="nv">
</span> <span class="kt">idx_t</span> <span class="nv">value_count
</span>);
</code></pre></div></div>

#### Parameters

---
* `type`

The type of the array
* `values`

The values for the array
* `value_count`

The number of values in the array
* `returns`

The value. This must be destroyed with `duckdb_destroy_value`.

<br>


### `duckdb_get_varchar`

---
Expand Down
Loading