Skip to content

Commit

Permalink
Merge pull request #3729 from szarnyasg/c-api-regen
Browse files Browse the repository at this point in the history
C API scripts fix and regeneration
  • Loading branch information
szarnyasg authored Sep 25, 2024
2 parents e1ea900 + 1075639 commit 8d2ddcd
Show file tree
Hide file tree
Showing 15 changed files with 6,923 additions and 1,694 deletions.
5,354 changes: 4,325 additions & 1,029 deletions docs/api/c/api.md

Large diffs are not rendered by default.

134 changes: 101 additions & 33 deletions docs/api/c/appender.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ duckdb_appender_destroy(&appender);
<!-- This section is generated by scripts/generate_c_api_docs.py -->
<span class="kt">duckdb_state</span> <a href="#duckdb_appender_create"><span class="nf">duckdb_appender_create</span></a>(<span class="kt">duckdb_connection</span> <span class="nv">connection</span>, <span class="kt">const</span> <span class="kt">char</span> *<span class="nv">schema</span>, <span class="kt">const</span> <span class="kt">char</span> *<span class="nv">table</span>, <span class="kt">duckdb_appender</span> *<span class="nv">out_appender</span>);
<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">duckdb_state</span> <a href="#duckdb_appender_create"><span class="nf">duckdb_appender_create</span></a>(<span class="kt">duckdb_connection</span> <span class="nv">connection</span>, <span class="kt">const</span> <span class="kt">char</span> *<span class="nv">schema</span>, <span class="kt">const</span> <span class="kt">char</span> *<span class="nv">table</span>, <span class="kt">duckdb_appender</span> *<span class="nv">out_appender</span>);
<span class="kt">idx_t</span> <a href="#duckdb_appender_column_count"><span class="nf">duckdb_appender_column_count</span></a>(<span class="kt">duckdb_appender</span> <span class="nv">appender</span>);
<span class="kt">duckdb_logical_type</span> <a href="#duckdb_appender_column_type"><span class="nf">duckdb_appender_column_type</span></a>(<span class="kt">duckdb_appender</span> <span class="nv">appender</span>, <span class="kt">idx_t</span> <span class="nv">col_idx</span>);
<span class="kt">const</span> <span class="kt">char</span> *<a href="#duckdb_appender_error"><span class="nf">duckdb_appender_error</span></a>(<span class="kt">duckdb_appender</span> <span class="nv">appender</span>);
Expand All @@ -49,6 +49,7 @@ duckdb_appender_destroy(&appender);
<span class="kt">duckdb_state</span> <a href="#duckdb_appender_destroy"><span class="nf">duckdb_appender_destroy</span></a>(<span class="kt">duckdb_appender</span> *<span class="nv">appender</span>);
<span class="kt">duckdb_state</span> <a href="#duckdb_appender_begin_row"><span class="nf">duckdb_appender_begin_row</span></a>(<span class="kt">duckdb_appender</span> <span class="nv">appender</span>);
<span class="kt">duckdb_state</span> <a href="#duckdb_appender_end_row"><span class="nf">duckdb_appender_end_row</span></a>(<span class="kt">duckdb_appender</span> <span class="nv">appender</span>);
<span class="kt">duckdb_state</span> <a href="#duckdb_append_default"><span class="nf">duckdb_append_default</span></a>(<span class="kt">duckdb_appender</span> <span class="nv">appender</span>);
<span class="kt">duckdb_state</span> <a href="#duckdb_append_bool"><span class="nf">duckdb_append_bool</span></a>(<span class="kt">duckdb_appender</span> <span class="nv">appender</span>, <span class="kt">bool</span> <span class="nv">value</span>);
<span class="kt">duckdb_state</span> <a href="#duckdb_append_int8"><span class="nf">duckdb_append_int8</span></a>(<span class="kt">duckdb_appender</span> <span class="nv">appender</span>, <span class="kt">int8_t</span> <span class="nv">value</span>);
<span class="kt">duckdb_state</span> <a href="#duckdb_append_int16"><span class="nf">duckdb_append_int16</span></a>(<span class="kt">duckdb_appender</span> <span class="nv">appender</span>, <span class="kt">int16_t</span> <span class="nv">value</span>);
Expand All @@ -71,19 +72,14 @@ duckdb_appender_destroy(&appender);
<span class="kt">duckdb_state</span> <a href="#duckdb_append_blob"><span class="nf">duckdb_append_blob</span></a>(<span class="kt">duckdb_appender</span> <span class="nv">appender</span>, <span class="kt">const</span> <span class="kt">void</span> *<span class="nv">data</span>, <span class="kt">idx_t</span> <span class="nv">length</span>);
<span class="kt">duckdb_state</span> <a href="#duckdb_append_null"><span class="nf">duckdb_append_null</span></a>(<span class="kt">duckdb_appender</span> <span class="nv">appender</span>);
<span class="kt">duckdb_state</span> <a href="#duckdb_append_data_chunk"><span class="nf">duckdb_append_data_chunk</span></a>(<span class="kt">duckdb_appender</span> <span class="nv">appender</span>, <span class="kt">duckdb_data_chunk</span> <span class="nv">chunk</span>);
</code></pre></div></div>
#### `duckdb_appender_create`
Creates an appender object.
Note that the object must be destroyed with `duckdb_appender_destroy`.
* connection: The connection context to create the appender in.
* schema: The schema of the table to append to, or `nullptr` for the default schema.
* table: The table name to append to.
* out_appender: The resulting appender object.
* returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
##### Syntax
<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">duckdb_state</span> <span class="nv">duckdb_appender_create</span>(<span class="nv">
Expand All @@ -93,21 +89,39 @@ Note that the object must be destroyed with `duckdb_appender_destroy`.
</span> <span class="kt">duckdb_appender</span> *<span class="nv">out_appender
</span>);
</code></pre></div></div>
##### Parameters
* `connection`: The connection context to create the appender in.
* `schema`: The schema of the table to append to, or `nullptr` for the default schema.
* `table`: The table name to append to.
* `out_appender`: The resulting appender object.
##### Return Value
`DuckDBSuccess` on success or `DuckDBError` on failure.
<br>
#### `duckdb_appender_column_count`
Returns the number of columns in the table that belongs to the appender.
* appender The appender to get the column count from.
* returns: The number of columns in the table.
##### Syntax
<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">idx_t</span> <span class="nv">duckdb_appender_column_count</span>(<span class="nv">
</span> <span class="kt">duckdb_appender</span> <span class="nv">appender
</span>);
</code></pre></div></div>
##### Parameters
* `appender`: The appender to get the column count from.
##### Return Value
The number of columns in the table.
<br>
#### `duckdb_appender_column_type`
Expand All @@ -116,17 +130,23 @@ Returns the type of the column at the specified index.
Note: The resulting type should be destroyed with `duckdb_destroy_logical_type`.
* appender The appender to get the column type from.
* col_idx The index of the column to get the type of.
* returns: The duckdb_logical_type of the column.
##### 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_appender_column_type</span>(<span class="nv">
</span> <span class="kt">duckdb_appender</span> <span class="nv">appender</span>,<span class="nv">
</span> <span class="kt">idx_t</span> <span class="nv">col_idx
</span>);
</code></pre></div></div>
##### Parameters
* `appender`: The appender to get the column type from.
* `col_idx`: The index of the column to get the type of.
##### Return Value
The duckdb_logical_type of the column.
<br>
#### `duckdb_appender_error`
Expand All @@ -136,15 +156,21 @@ If the appender has no error message, this returns `nullptr` instead.
The error message should not be freed. It will be de-allocated when `duckdb_appender_destroy` is called.
* appender: The appender to get the error from.
* returns: The error message, or `nullptr` if there is none.
##### Syntax
<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">const</span> <span class="kt">char</span> *<span class="nv">duckdb_appender_error</span>(<span class="nv">
</span> <span class="kt">duckdb_appender</span> <span class="nv">appender
</span>);
</code></pre></div></div>
##### Parameters
* `appender`: The appender to get the error from.
##### Return Value
The error message, or `nullptr` if there is none.
<br>
#### `duckdb_appender_flush`
Expand All @@ -154,15 +180,21 @@ constraint violation or any other error, then all data is invalidated, and this
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.
* appender: The appender to flush.
* returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
##### Syntax
<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">duckdb_state</span> <span class="nv">duckdb_appender_flush</span>(<span class="nv">
</span> <span class="kt">duckdb_appender</span> <span class="nv">appender
</span>);
</code></pre></div></div>
##### Parameters
* `appender`: The appender to flush.
##### Return Value
`DuckDBSuccess` on success or `DuckDBError` on failure.
<br>
#### `duckdb_appender_close`
Expand All @@ -172,15 +204,21 @@ triggers a constraint violation or any other error, then all data is invalidated
Call duckdb_appender_error to obtain the error message followed by duckdb_appender_destroy to destroy the invalidated
appender.
* appender: The appender to flush and close.
* returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
##### Syntax
<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">duckdb_state</span> <span class="nv">duckdb_appender_close</span>(<span class="nv">
</span> <span class="kt">duckdb_appender</span> <span class="nv">appender
</span>);
</code></pre></div></div>
##### Parameters
* `appender`: The appender to flush and close.
##### Return Value
`DuckDBSuccess` on success or `DuckDBError` on failure.
<br>
#### `duckdb_appender_destroy`
Expand All @@ -191,15 +229,21 @@ then all data is invalidated, and this function returns DuckDBError. Due to the
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.
* appender: The appender to flush, close and destroy.
* returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
##### Syntax
<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">duckdb_state</span> <span class="nv">duckdb_appender_destroy</span>(<span class="nv">
</span> <span class="kt">duckdb_appender</span> *<span class="nv">appender
</span>);
</code></pre></div></div>
##### Parameters
* `appender`: The appender to flush, close and destroy.
##### Return Value
`DuckDBSuccess` on success or `DuckDBError` on failure.
<br>
#### `duckdb_appender_begin_row`
Expand All @@ -218,15 +262,33 @@ A nop function, provided for backwards compatibility reasons. Does nothing. Only
Finish the current row of appends. After end_row is called, the next row can be appended.
* appender: The appender.
* returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
##### Syntax
<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">duckdb_state</span> <span class="nv">duckdb_appender_end_row</span>(<span class="nv">
</span> <span class="kt">duckdb_appender</span> <span class="nv">appender
</span>);
</code></pre></div></div>
##### Parameters
* `appender`: The appender.
##### Return Value
`DuckDBSuccess` on success or `DuckDBError` on failure.
<br>
#### `duckdb_append_default`
Append a DEFAULT value (NULL if DEFAULT not available for column) to the appender.
##### Syntax
<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">duckdb_state</span> <span class="nv">duckdb_append_default</span>(<span class="nv">
</span> <span class="kt">duckdb_appender</span> <span class="nv">appender
</span>);
</code></pre></div></div>
<br>
#### `duckdb_append_bool`
Expand Down Expand Up @@ -511,15 +573,21 @@ The types of the data chunk must exactly match the types of the table, no castin
If the types do not match or the appender is in an invalid state, DuckDBError is returned.
If the append is successful, DuckDBSuccess is returned.
* appender: The appender to append to.
* chunk: The data chunk to append.
* returns: The return state.
##### Syntax
<div class="language-c highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">duckdb_state</span> <span class="nv">duckdb_append_data_chunk</span>(<span class="nv">
</span> <span class="kt">duckdb_appender</span> <span class="nv">appender</span>,<span class="nv">
</span> <span class="kt">duckdb_data_chunk</span> <span class="nv">chunk
</span>);
</code></pre></div></div>
##### Parameters
* `appender`: The appender to append to.
* `chunk`: The data chunk to append.
##### Return Value
The return state.
<br>
Loading

0 comments on commit 8d2ddcd

Please sign in to comment.