@@ -40,7 +40,7 @@ duckdb_appender_destroy(&appender);
40
40
41
41
<!-- This section is generated by scripts/generate_c_api_docs.py -->
42
42
43
- <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>);
43
+ <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>);
44
44
<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>);
45
45
<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>);
46
46
<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>);
@@ -49,6 +49,7 @@ duckdb_appender_destroy(&appender);
49
49
<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>);
50
50
<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>);
51
51
<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>);
52
+ <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>);
52
53
<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>);
53
54
<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>);
54
55
<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>);
@@ -71,19 +72,14 @@ duckdb_appender_destroy(&appender);
71
72
<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>);
72
73
<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>);
73
74
<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>);
75
+ </code></pre></div></div>
74
76
75
77
#### `duckdb_appender_create`
76
78
77
79
Creates an appender object.
78
80
79
81
Note that the object must be destroyed with `duckdb_appender_destroy`.
80
82
81
- * connection: The connection context to create the appender in.
82
- * schema: The schema of the table to append to, or `nullptr` for the default schema.
83
- * table: The table name to append to.
84
- * out_appender: The resulting appender object.
85
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
86
-
87
83
##### Syntax
88
84
89
85
<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">
@@ -93,21 +89,39 @@ Note that the object must be destroyed with `duckdb_appender_destroy`.
93
89
</span> <span class="kt">duckdb_appender</span> *<span class="nv">out_appender
94
90
</span>);
95
91
</code></pre></div></div>
92
+
93
+ ##### Parameters
94
+
95
+ * `connection`: The connection context to create the appender in.
96
+ * `schema`: The schema of the table to append to, or `nullptr` for the default schema.
97
+ * `table`: The table name to append to.
98
+ * `out_appender`: The resulting appender object.
99
+
100
+ ##### Return Value
101
+
102
+ `DuckDBSuccess` on success or `DuckDBError` on failure.
103
+
96
104
<br>
97
105
98
106
#### `duckdb_appender_column_count`
99
107
100
108
Returns the number of columns in the table that belongs to the appender.
101
109
102
- * appender The appender to get the column count from.
103
- * returns: The number of columns in the table.
104
-
105
110
##### Syntax
106
111
107
112
<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">
108
113
</span> <span class="kt">duckdb_appender</span> <span class="nv">appender
109
114
</span>);
110
115
</code></pre></div></div>
116
+
117
+ ##### Parameters
118
+
119
+ * `appender`: The appender to get the column count from.
120
+
121
+ ##### Return Value
122
+
123
+ The number of columns in the table.
124
+
111
125
<br>
112
126
113
127
#### `duckdb_appender_column_type`
@@ -116,17 +130,23 @@ Returns the type of the column at the specified index.
116
130
117
131
Note: The resulting type should be destroyed with `duckdb_destroy_logical_type`.
118
132
119
- * appender The appender to get the column type from.
120
- * col_idx The index of the column to get the type of.
121
- * returns: The duckdb_logical_type of the column.
122
-
123
133
##### Syntax
124
134
125
135
<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">
126
136
</span> <span class="kt">duckdb_appender</span> <span class="nv">appender</span>,<span class="nv">
127
137
</span> <span class="kt">idx_t</span> <span class="nv">col_idx
128
138
</span>);
129
139
</code></pre></div></div>
140
+
141
+ ##### Parameters
142
+
143
+ * `appender`: The appender to get the column type from.
144
+ * `col_idx`: The index of the column to get the type of.
145
+
146
+ ##### Return Value
147
+
148
+ The duckdb_logical_type of the column.
149
+
130
150
<br>
131
151
132
152
#### `duckdb_appender_error`
@@ -136,15 +156,21 @@ If the appender has no error message, this returns `nullptr` instead.
136
156
137
157
The error message should not be freed. It will be de-allocated when `duckdb_appender_destroy` is called.
138
158
139
- * appender: The appender to get the error from.
140
- * returns: The error message, or `nullptr` if there is none.
141
-
142
159
##### Syntax
143
160
144
161
<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">
145
162
</span> <span class="kt">duckdb_appender</span> <span class="nv">appender
146
163
</span>);
147
164
</code></pre></div></div>
165
+
166
+ ##### Parameters
167
+
168
+ * `appender`: The appender to get the error from.
169
+
170
+ ##### Return Value
171
+
172
+ The error message, or `nullptr` if there is none.
173
+
148
174
<br>
149
175
150
176
#### `duckdb_appender_flush`
@@ -154,15 +180,21 @@ constraint violation or any other error, then all data is invalidated, and this
154
180
It is not possible to append more values. Call duckdb_appender_error to obtain the error message followed by
155
181
duckdb_appender_destroy to destroy the invalidated appender.
156
182
157
- * appender: The appender to flush.
158
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
159
-
160
183
##### Syntax
161
184
162
185
<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">
163
186
</span> <span class="kt">duckdb_appender</span> <span class="nv">appender
164
187
</span>);
165
188
</code></pre></div></div>
189
+
190
+ ##### Parameters
191
+
192
+ * `appender`: The appender to flush.
193
+
194
+ ##### Return Value
195
+
196
+ `DuckDBSuccess` on success or `DuckDBError` on failure.
197
+
166
198
<br>
167
199
168
200
#### `duckdb_appender_close`
@@ -172,15 +204,21 @@ triggers a constraint violation or any other error, then all data is invalidated
172
204
Call duckdb_appender_error to obtain the error message followed by duckdb_appender_destroy to destroy the invalidated
173
205
appender.
174
206
175
- * appender: The appender to flush and close.
176
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
177
-
178
207
##### Syntax
179
208
180
209
<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">
181
210
</span> <span class="kt">duckdb_appender</span> <span class="nv">appender
182
211
</span>);
183
212
</code></pre></div></div>
213
+
214
+ ##### Parameters
215
+
216
+ * `appender`: The appender to flush and close.
217
+
218
+ ##### Return Value
219
+
220
+ `DuckDBSuccess` on success or `DuckDBError` on failure.
221
+
184
222
<br>
185
223
186
224
#### `duckdb_appender_destroy`
@@ -191,15 +229,21 @@ then all data is invalidated, and this function returns DuckDBError. Due to the
191
229
longer possible to obtain the specific error message with duckdb_appender_error. Therefore, call duckdb_appender_close
192
230
before destroying the appender, if you need insights into the specific error.
193
231
194
- * appender: The appender to flush, close and destroy.
195
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
196
-
197
232
##### Syntax
198
233
199
234
<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">
200
235
</span> <span class="kt">duckdb_appender</span> *<span class="nv">appender
201
236
</span>);
202
237
</code></pre></div></div>
238
+
239
+ ##### Parameters
240
+
241
+ * `appender`: The appender to flush, close and destroy.
242
+
243
+ ##### Return Value
244
+
245
+ `DuckDBSuccess` on success or `DuckDBError` on failure.
246
+
203
247
<br>
204
248
205
249
#### `duckdb_appender_begin_row`
@@ -218,15 +262,33 @@ A nop function, provided for backwards compatibility reasons. Does nothing. Only
218
262
219
263
Finish the current row of appends. After end_row is called, the next row can be appended.
220
264
221
- * appender: The appender.
222
- * returns: `DuckDBSuccess` on success or `DuckDBError` on failure.
223
-
224
265
##### Syntax
225
266
226
267
<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">
227
268
</span> <span class="kt">duckdb_appender</span> <span class="nv">appender
228
269
</span>);
229
270
</code></pre></div></div>
271
+
272
+ ##### Parameters
273
+
274
+ * `appender`: The appender.
275
+
276
+ ##### Return Value
277
+
278
+ `DuckDBSuccess` on success or `DuckDBError` on failure.
279
+
280
+ <br>
281
+
282
+ #### `duckdb_append_default`
283
+
284
+ Append a DEFAULT value (NULL if DEFAULT not available for column) to the appender.
285
+
286
+ ##### Syntax
287
+
288
+ <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">
289
+ </span> <span class="kt">duckdb_appender</span> <span class="nv">appender
290
+ </span>);
291
+ </code></pre></div></div>
230
292
<br>
231
293
232
294
#### `duckdb_append_bool`
@@ -511,15 +573,21 @@ The types of the data chunk must exactly match the types of the table, no castin
511
573
If the types do not match or the appender is in an invalid state, DuckDBError is returned.
512
574
If the append is successful, DuckDBSuccess is returned.
513
575
514
- * appender: The appender to append to.
515
- * chunk: The data chunk to append.
516
- * returns: The return state.
517
-
518
576
##### Syntax
519
577
520
578
<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">
521
579
</span> <span class="kt">duckdb_appender</span> <span class="nv">appender</span>,<span class="nv">
522
580
</span> <span class="kt">duckdb_data_chunk</span> <span class="nv">chunk
523
581
</span>);
524
582
</code></pre></div></div>
583
+
584
+ ##### Parameters
585
+
586
+ * `appender`: The appender to append to.
587
+ * `chunk`: The data chunk to append.
588
+
589
+ ##### Return Value
590
+
591
+ The return state.
592
+
525
593
<br>
0 commit comments