1#![allow(rustdoc::invalid_html_tags)]
2#![allow(rustdoc::broken_intra_doc_links)]
3#![allow(rustdoc::invalid_rust_codeblocks)]
4#![allow(rustdoc::bare_urls)]
5
6pub const DUCKDB_TYPE_DUCKDB_TYPE_INVALID: DUCKDB_TYPE = 0;
9pub const DUCKDB_TYPE_DUCKDB_TYPE_BOOLEAN: DUCKDB_TYPE = 1;
10pub const DUCKDB_TYPE_DUCKDB_TYPE_TINYINT: DUCKDB_TYPE = 2;
11pub const DUCKDB_TYPE_DUCKDB_TYPE_SMALLINT: DUCKDB_TYPE = 3;
12pub const DUCKDB_TYPE_DUCKDB_TYPE_INTEGER: DUCKDB_TYPE = 4;
13pub const DUCKDB_TYPE_DUCKDB_TYPE_BIGINT: DUCKDB_TYPE = 5;
14pub const DUCKDB_TYPE_DUCKDB_TYPE_UTINYINT: DUCKDB_TYPE = 6;
15pub const DUCKDB_TYPE_DUCKDB_TYPE_USMALLINT: DUCKDB_TYPE = 7;
16pub const DUCKDB_TYPE_DUCKDB_TYPE_UINTEGER: DUCKDB_TYPE = 8;
17pub const DUCKDB_TYPE_DUCKDB_TYPE_UBIGINT: DUCKDB_TYPE = 9;
18pub const DUCKDB_TYPE_DUCKDB_TYPE_FLOAT: DUCKDB_TYPE = 10;
19pub const DUCKDB_TYPE_DUCKDB_TYPE_DOUBLE: DUCKDB_TYPE = 11;
20pub const DUCKDB_TYPE_DUCKDB_TYPE_TIMESTAMP: DUCKDB_TYPE = 12;
21pub const DUCKDB_TYPE_DUCKDB_TYPE_DATE: DUCKDB_TYPE = 13;
22pub const DUCKDB_TYPE_DUCKDB_TYPE_TIME: DUCKDB_TYPE = 14;
23pub const DUCKDB_TYPE_DUCKDB_TYPE_INTERVAL: DUCKDB_TYPE = 15;
24pub const DUCKDB_TYPE_DUCKDB_TYPE_HUGEINT: DUCKDB_TYPE = 16;
25pub const DUCKDB_TYPE_DUCKDB_TYPE_UHUGEINT: DUCKDB_TYPE = 32;
26pub const DUCKDB_TYPE_DUCKDB_TYPE_VARCHAR: DUCKDB_TYPE = 17;
27pub const DUCKDB_TYPE_DUCKDB_TYPE_BLOB: DUCKDB_TYPE = 18;
28pub const DUCKDB_TYPE_DUCKDB_TYPE_DECIMAL: DUCKDB_TYPE = 19;
29pub const DUCKDB_TYPE_DUCKDB_TYPE_TIMESTAMP_S: DUCKDB_TYPE = 20;
30pub const DUCKDB_TYPE_DUCKDB_TYPE_TIMESTAMP_MS: DUCKDB_TYPE = 21;
31pub const DUCKDB_TYPE_DUCKDB_TYPE_TIMESTAMP_NS: DUCKDB_TYPE = 22;
32pub const DUCKDB_TYPE_DUCKDB_TYPE_ENUM: DUCKDB_TYPE = 23;
33pub const DUCKDB_TYPE_DUCKDB_TYPE_LIST: DUCKDB_TYPE = 24;
34pub const DUCKDB_TYPE_DUCKDB_TYPE_STRUCT: DUCKDB_TYPE = 25;
35pub const DUCKDB_TYPE_DUCKDB_TYPE_MAP: DUCKDB_TYPE = 26;
36pub const DUCKDB_TYPE_DUCKDB_TYPE_ARRAY: DUCKDB_TYPE = 33;
37pub const DUCKDB_TYPE_DUCKDB_TYPE_UUID: DUCKDB_TYPE = 27;
38pub const DUCKDB_TYPE_DUCKDB_TYPE_UNION: DUCKDB_TYPE = 28;
39pub const DUCKDB_TYPE_DUCKDB_TYPE_BIT: DUCKDB_TYPE = 29;
40pub const DUCKDB_TYPE_DUCKDB_TYPE_TIME_TZ: DUCKDB_TYPE = 30;
41pub const DUCKDB_TYPE_DUCKDB_TYPE_TIMESTAMP_TZ: DUCKDB_TYPE = 31;
42pub const DUCKDB_TYPE_DUCKDB_TYPE_ANY: DUCKDB_TYPE = 34;
43pub const DUCKDB_TYPE_DUCKDB_TYPE_BIGNUM: DUCKDB_TYPE = 35;
44pub const DUCKDB_TYPE_DUCKDB_TYPE_SQLNULL: DUCKDB_TYPE = 36;
45pub const DUCKDB_TYPE_DUCKDB_TYPE_STRING_LITERAL: DUCKDB_TYPE = 37;
46pub const DUCKDB_TYPE_DUCKDB_TYPE_INTEGER_LITERAL: DUCKDB_TYPE = 38;
47pub const DUCKDB_TYPE_DUCKDB_TYPE_TIME_NS: DUCKDB_TYPE = 39;
48pub const DUCKDB_TYPE_DUCKDB_TYPE_GEOMETRY: DUCKDB_TYPE = 40;
49pub const DUCKDB_TYPE_DUCKDB_TYPE_VARIANT: DUCKDB_TYPE = 41;
50#[doc = "! An enum over DuckDB's internal types."]
51pub type DUCKDB_TYPE = ::std::os::raw::c_uint;
52#[doc = "! An enum over DuckDB's internal types."]
53pub use self::DUCKDB_TYPE as duckdb_type;
54pub const duckdb_state_DuckDBSuccess: duckdb_state = 0;
55pub const duckdb_state_DuckDBError: duckdb_state = 1;
56#[doc = "! An enum over the returned state of different functions."]
57pub type duckdb_state = ::std::os::raw::c_uint;
58pub const duckdb_pending_state_DUCKDB_PENDING_RESULT_READY: duckdb_pending_state = 0;
59pub const duckdb_pending_state_DUCKDB_PENDING_RESULT_NOT_READY: duckdb_pending_state = 1;
60pub const duckdb_pending_state_DUCKDB_PENDING_ERROR: duckdb_pending_state = 2;
61pub const duckdb_pending_state_DUCKDB_PENDING_NO_TASKS_AVAILABLE: duckdb_pending_state = 3;
62#[doc = "! An enum over the pending state of a pending query result."]
63pub type duckdb_pending_state = ::std::os::raw::c_uint;
64pub const duckdb_result_type_DUCKDB_RESULT_TYPE_INVALID: duckdb_result_type = 0;
65pub const duckdb_result_type_DUCKDB_RESULT_TYPE_CHANGED_ROWS: duckdb_result_type = 1;
66pub const duckdb_result_type_DUCKDB_RESULT_TYPE_NOTHING: duckdb_result_type = 2;
67pub const duckdb_result_type_DUCKDB_RESULT_TYPE_QUERY_RESULT: duckdb_result_type = 3;
68#[doc = "! An enum over DuckDB's different result types."]
69pub type duckdb_result_type = ::std::os::raw::c_uint;
70pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_INVALID: duckdb_statement_type = 0;
71pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_SELECT: duckdb_statement_type = 1;
72pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_INSERT: duckdb_statement_type = 2;
73pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_UPDATE: duckdb_statement_type = 3;
74pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_EXPLAIN: duckdb_statement_type = 4;
75pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_DELETE: duckdb_statement_type = 5;
76pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_PREPARE: duckdb_statement_type = 6;
77pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_CREATE: duckdb_statement_type = 7;
78pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_EXECUTE: duckdb_statement_type = 8;
79pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_ALTER: duckdb_statement_type = 9;
80pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_TRANSACTION: duckdb_statement_type = 10;
81pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_COPY: duckdb_statement_type = 11;
82pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_ANALYZE: duckdb_statement_type = 12;
83pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_VARIABLE_SET: duckdb_statement_type = 13;
84pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_CREATE_FUNC: duckdb_statement_type = 14;
85pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_DROP: duckdb_statement_type = 15;
86pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_EXPORT: duckdb_statement_type = 16;
87pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_PRAGMA: duckdb_statement_type = 17;
88pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_VACUUM: duckdb_statement_type = 18;
89pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_CALL: duckdb_statement_type = 19;
90pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_SET: duckdb_statement_type = 20;
91pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_LOAD: duckdb_statement_type = 21;
92pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_RELATION: duckdb_statement_type = 22;
93pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_EXTENSION: duckdb_statement_type = 23;
94pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_LOGICAL_PLAN: duckdb_statement_type = 24;
95pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_ATTACH: duckdb_statement_type = 25;
96pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_DETACH: duckdb_statement_type = 26;
97pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_MULTI: duckdb_statement_type = 27;
98pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_COPY_DATABASE: duckdb_statement_type = 28;
99pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_UPDATE_EXTENSIONS: duckdb_statement_type = 29;
100pub const duckdb_statement_type_DUCKDB_STATEMENT_TYPE_MERGE_INTO: duckdb_statement_type = 30;
101#[doc = "! An enum over DuckDB's different statement types."]
102pub type duckdb_statement_type = ::std::os::raw::c_uint;
103pub const duckdb_error_type_DUCKDB_ERROR_INVALID: duckdb_error_type = 0;
104pub const duckdb_error_type_DUCKDB_ERROR_OUT_OF_RANGE: duckdb_error_type = 1;
105pub const duckdb_error_type_DUCKDB_ERROR_CONVERSION: duckdb_error_type = 2;
106pub const duckdb_error_type_DUCKDB_ERROR_UNKNOWN_TYPE: duckdb_error_type = 3;
107pub const duckdb_error_type_DUCKDB_ERROR_DECIMAL: duckdb_error_type = 4;
108pub const duckdb_error_type_DUCKDB_ERROR_MISMATCH_TYPE: duckdb_error_type = 5;
109pub const duckdb_error_type_DUCKDB_ERROR_DIVIDE_BY_ZERO: duckdb_error_type = 6;
110pub const duckdb_error_type_DUCKDB_ERROR_OBJECT_SIZE: duckdb_error_type = 7;
111pub const duckdb_error_type_DUCKDB_ERROR_INVALID_TYPE: duckdb_error_type = 8;
112pub const duckdb_error_type_DUCKDB_ERROR_SERIALIZATION: duckdb_error_type = 9;
113pub const duckdb_error_type_DUCKDB_ERROR_TRANSACTION: duckdb_error_type = 10;
114pub const duckdb_error_type_DUCKDB_ERROR_NOT_IMPLEMENTED: duckdb_error_type = 11;
115pub const duckdb_error_type_DUCKDB_ERROR_EXPRESSION: duckdb_error_type = 12;
116pub const duckdb_error_type_DUCKDB_ERROR_CATALOG: duckdb_error_type = 13;
117pub const duckdb_error_type_DUCKDB_ERROR_PARSER: duckdb_error_type = 14;
118pub const duckdb_error_type_DUCKDB_ERROR_PLANNER: duckdb_error_type = 15;
119pub const duckdb_error_type_DUCKDB_ERROR_SCHEDULER: duckdb_error_type = 16;
120pub const duckdb_error_type_DUCKDB_ERROR_EXECUTOR: duckdb_error_type = 17;
121pub const duckdb_error_type_DUCKDB_ERROR_CONSTRAINT: duckdb_error_type = 18;
122pub const duckdb_error_type_DUCKDB_ERROR_INDEX: duckdb_error_type = 19;
123pub const duckdb_error_type_DUCKDB_ERROR_STAT: duckdb_error_type = 20;
124pub const duckdb_error_type_DUCKDB_ERROR_CONNECTION: duckdb_error_type = 21;
125pub const duckdb_error_type_DUCKDB_ERROR_SYNTAX: duckdb_error_type = 22;
126pub const duckdb_error_type_DUCKDB_ERROR_SETTINGS: duckdb_error_type = 23;
127pub const duckdb_error_type_DUCKDB_ERROR_BINDER: duckdb_error_type = 24;
128pub const duckdb_error_type_DUCKDB_ERROR_NETWORK: duckdb_error_type = 25;
129pub const duckdb_error_type_DUCKDB_ERROR_OPTIMIZER: duckdb_error_type = 26;
130pub const duckdb_error_type_DUCKDB_ERROR_NULL_POINTER: duckdb_error_type = 27;
131pub const duckdb_error_type_DUCKDB_ERROR_IO: duckdb_error_type = 28;
132pub const duckdb_error_type_DUCKDB_ERROR_INTERRUPT: duckdb_error_type = 29;
133pub const duckdb_error_type_DUCKDB_ERROR_FATAL: duckdb_error_type = 30;
134pub const duckdb_error_type_DUCKDB_ERROR_INTERNAL: duckdb_error_type = 31;
135pub const duckdb_error_type_DUCKDB_ERROR_INVALID_INPUT: duckdb_error_type = 32;
136pub const duckdb_error_type_DUCKDB_ERROR_OUT_OF_MEMORY: duckdb_error_type = 33;
137pub const duckdb_error_type_DUCKDB_ERROR_PERMISSION: duckdb_error_type = 34;
138pub const duckdb_error_type_DUCKDB_ERROR_PARAMETER_NOT_RESOLVED: duckdb_error_type = 35;
139pub const duckdb_error_type_DUCKDB_ERROR_PARAMETER_NOT_ALLOWED: duckdb_error_type = 36;
140pub const duckdb_error_type_DUCKDB_ERROR_DEPENDENCY: duckdb_error_type = 37;
141pub const duckdb_error_type_DUCKDB_ERROR_HTTP: duckdb_error_type = 38;
142pub const duckdb_error_type_DUCKDB_ERROR_MISSING_EXTENSION: duckdb_error_type = 39;
143pub const duckdb_error_type_DUCKDB_ERROR_AUTOLOAD: duckdb_error_type = 40;
144pub const duckdb_error_type_DUCKDB_ERROR_SEQUENCE: duckdb_error_type = 41;
145pub const duckdb_error_type_DUCKDB_INVALID_CONFIGURATION: duckdb_error_type = 42;
146#[doc = "! An enum over DuckDB's different error types."]
147pub type duckdb_error_type = ::std::os::raw::c_uint;
148pub const duckdb_cast_mode_DUCKDB_CAST_NORMAL: duckdb_cast_mode = 0;
149pub const duckdb_cast_mode_DUCKDB_CAST_TRY: duckdb_cast_mode = 1;
150#[doc = "! An enum over DuckDB's different cast modes."]
151pub type duckdb_cast_mode = ::std::os::raw::c_uint;
152pub const duckdb_file_flag_DUCKDB_FILE_FLAG_INVALID: duckdb_file_flag = 0;
153pub const duckdb_file_flag_DUCKDB_FILE_FLAG_READ: duckdb_file_flag = 1;
154pub const duckdb_file_flag_DUCKDB_FILE_FLAG_WRITE: duckdb_file_flag = 2;
155pub const duckdb_file_flag_DUCKDB_FILE_FLAG_CREATE: duckdb_file_flag = 3;
156pub const duckdb_file_flag_DUCKDB_FILE_FLAG_CREATE_NEW: duckdb_file_flag = 4;
157pub const duckdb_file_flag_DUCKDB_FILE_FLAG_APPEND: duckdb_file_flag = 5;
158pub type duckdb_file_flag = ::std::os::raw::c_uint;
159pub const duckdb_config_option_scope_DUCKDB_CONFIG_OPTION_SCOPE_INVALID:
160 duckdb_config_option_scope = 0;
161pub const duckdb_config_option_scope_DUCKDB_CONFIG_OPTION_SCOPE_LOCAL: duckdb_config_option_scope =
162 1;
163pub const duckdb_config_option_scope_DUCKDB_CONFIG_OPTION_SCOPE_SESSION:
164 duckdb_config_option_scope = 2;
165pub const duckdb_config_option_scope_DUCKDB_CONFIG_OPTION_SCOPE_GLOBAL: duckdb_config_option_scope =
166 3;
167#[doc = "! An enum over DuckDB's configuration option scopes.\n! This enum can be used to specify the default scope when creating a custom configuration option,\n! but it is also be used to determine the scope in which a configuration option is set when it is\n! changed or retrieved."]
168pub type duckdb_config_option_scope = ::std::os::raw::c_uint;
169pub const duckdb_catalog_entry_type_DUCKDB_CATALOG_ENTRY_TYPE_INVALID: duckdb_catalog_entry_type =
170 0;
171pub const duckdb_catalog_entry_type_DUCKDB_CATALOG_ENTRY_TYPE_TABLE: duckdb_catalog_entry_type = 1;
172pub const duckdb_catalog_entry_type_DUCKDB_CATALOG_ENTRY_TYPE_SCHEMA: duckdb_catalog_entry_type = 2;
173pub const duckdb_catalog_entry_type_DUCKDB_CATALOG_ENTRY_TYPE_VIEW: duckdb_catalog_entry_type = 3;
174pub const duckdb_catalog_entry_type_DUCKDB_CATALOG_ENTRY_TYPE_INDEX: duckdb_catalog_entry_type = 4;
175pub const duckdb_catalog_entry_type_DUCKDB_CATALOG_ENTRY_TYPE_PREPARED_STATEMENT:
176 duckdb_catalog_entry_type = 5;
177pub const duckdb_catalog_entry_type_DUCKDB_CATALOG_ENTRY_TYPE_SEQUENCE: duckdb_catalog_entry_type =
178 6;
179pub const duckdb_catalog_entry_type_DUCKDB_CATALOG_ENTRY_TYPE_COLLATION: duckdb_catalog_entry_type =
180 7;
181pub const duckdb_catalog_entry_type_DUCKDB_CATALOG_ENTRY_TYPE_TYPE: duckdb_catalog_entry_type = 8;
182pub const duckdb_catalog_entry_type_DUCKDB_CATALOG_ENTRY_TYPE_DATABASE: duckdb_catalog_entry_type =
183 9;
184#[doc = "! An enum over DuckDB's catalog entry types."]
185pub type duckdb_catalog_entry_type = ::std::os::raw::c_uint;
186#[doc = "! DuckDB's index type."]
187pub type idx_t = u64;
188#[doc = "! Type definition for the data pointers of selection vectors."]
189pub type sel_t = u32;
190#[doc = "! The callback to destroy data, e.g.,\n! bind data (if any), init data (if any), extra data for replacement scans (if any), etc."]
191pub type duckdb_delete_callback_t =
192 ::std::option::Option<unsafe extern "C" fn(data: *mut ::std::os::raw::c_void)>;
193#[doc = "! The callback to copy data, e.g., bind data (if any)."]
194pub type duckdb_copy_callback_t = ::std::option::Option<
195 unsafe extern "C" fn(data: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void,
196>;
197#[doc = "! Used for threading, contains a task state.\n! Must be destroyed with `duckdb_destroy_task_state`."]
198pub type duckdb_task_state = *mut ::std::os::raw::c_void;
199#[doc = "! DATE is stored as days since 1970-01-01.\n! Use the `duckdb_from_date` and `duckdb_to_date` functions to extract individual information."]
200#[repr(C)]
201#[derive(Debug, Copy, Clone)]
202pub struct duckdb_date {
203 pub days: i32,
204}
205#[allow(clippy::unnecessary_operation, clippy::identity_op)]
206const _: () = {
207 ["Size of duckdb_date"][::std::mem::size_of::<duckdb_date>() - 4usize];
208 ["Alignment of duckdb_date"][::std::mem::align_of::<duckdb_date>() - 4usize];
209 ["Offset of field: duckdb_date::days"][::std::mem::offset_of!(duckdb_date, days) - 0usize];
210};
211#[repr(C)]
212#[derive(Debug, Copy, Clone)]
213pub struct duckdb_date_struct {
214 pub year: i32,
215 pub month: i8,
216 pub day: i8,
217}
218#[allow(clippy::unnecessary_operation, clippy::identity_op)]
219const _: () = {
220 ["Size of duckdb_date_struct"][::std::mem::size_of::<duckdb_date_struct>() - 8usize];
221 ["Alignment of duckdb_date_struct"][::std::mem::align_of::<duckdb_date_struct>() - 4usize];
222 ["Offset of field: duckdb_date_struct::year"]
223 [::std::mem::offset_of!(duckdb_date_struct, year) - 0usize];
224 ["Offset of field: duckdb_date_struct::month"]
225 [::std::mem::offset_of!(duckdb_date_struct, month) - 4usize];
226 ["Offset of field: duckdb_date_struct::day"]
227 [::std::mem::offset_of!(duckdb_date_struct, day) - 5usize];
228};
229#[doc = "! TIME is stored as microseconds since 00:00:00.\n! Use the `duckdb_from_time` and `duckdb_to_time` functions to extract individual information."]
230#[repr(C)]
231#[derive(Debug, Copy, Clone)]
232pub struct duckdb_time {
233 pub micros: i64,
234}
235#[allow(clippy::unnecessary_operation, clippy::identity_op)]
236const _: () = {
237 ["Size of duckdb_time"][::std::mem::size_of::<duckdb_time>() - 8usize];
238 ["Alignment of duckdb_time"][::std::mem::align_of::<duckdb_time>() - 8usize];
239 ["Offset of field: duckdb_time::micros"][::std::mem::offset_of!(duckdb_time, micros) - 0usize];
240};
241#[repr(C)]
242#[derive(Debug, Copy, Clone)]
243pub struct duckdb_time_struct {
244 pub hour: i8,
245 pub min: i8,
246 pub sec: i8,
247 pub micros: i32,
248}
249#[allow(clippy::unnecessary_operation, clippy::identity_op)]
250const _: () = {
251 ["Size of duckdb_time_struct"][::std::mem::size_of::<duckdb_time_struct>() - 8usize];
252 ["Alignment of duckdb_time_struct"][::std::mem::align_of::<duckdb_time_struct>() - 4usize];
253 ["Offset of field: duckdb_time_struct::hour"]
254 [::std::mem::offset_of!(duckdb_time_struct, hour) - 0usize];
255 ["Offset of field: duckdb_time_struct::min"]
256 [::std::mem::offset_of!(duckdb_time_struct, min) - 1usize];
257 ["Offset of field: duckdb_time_struct::sec"]
258 [::std::mem::offset_of!(duckdb_time_struct, sec) - 2usize];
259 ["Offset of field: duckdb_time_struct::micros"]
260 [::std::mem::offset_of!(duckdb_time_struct, micros) - 4usize];
261};
262#[doc = "! TIME_NS is stored as nanoseconds since 00:00:00."]
263#[repr(C)]
264#[derive(Debug, Copy, Clone)]
265pub struct duckdb_time_ns {
266 pub nanos: i64,
267}
268#[allow(clippy::unnecessary_operation, clippy::identity_op)]
269const _: () = {
270 ["Size of duckdb_time_ns"][::std::mem::size_of::<duckdb_time_ns>() - 8usize];
271 ["Alignment of duckdb_time_ns"][::std::mem::align_of::<duckdb_time_ns>() - 8usize];
272 ["Offset of field: duckdb_time_ns::nanos"]
273 [::std::mem::offset_of!(duckdb_time_ns, nanos) - 0usize];
274};
275#[doc = "! TIME_TZ is stored as 40 bits for the int64_t microseconds, and 24 bits for the int32_t offset.\n! Use the `duckdb_from_time_tz` function to extract individual information."]
276#[repr(C)]
277#[derive(Debug, Copy, Clone)]
278pub struct duckdb_time_tz {
279 pub bits: u64,
280}
281#[allow(clippy::unnecessary_operation, clippy::identity_op)]
282const _: () = {
283 ["Size of duckdb_time_tz"][::std::mem::size_of::<duckdb_time_tz>() - 8usize];
284 ["Alignment of duckdb_time_tz"][::std::mem::align_of::<duckdb_time_tz>() - 8usize];
285 ["Offset of field: duckdb_time_tz::bits"]
286 [::std::mem::offset_of!(duckdb_time_tz, bits) - 0usize];
287};
288#[repr(C)]
289#[derive(Debug, Copy, Clone)]
290pub struct duckdb_time_tz_struct {
291 pub time: duckdb_time_struct,
292 pub offset: i32,
293}
294#[allow(clippy::unnecessary_operation, clippy::identity_op)]
295const _: () = {
296 ["Size of duckdb_time_tz_struct"][::std::mem::size_of::<duckdb_time_tz_struct>() - 12usize];
297 ["Alignment of duckdb_time_tz_struct"]
298 [::std::mem::align_of::<duckdb_time_tz_struct>() - 4usize];
299 ["Offset of field: duckdb_time_tz_struct::time"]
300 [::std::mem::offset_of!(duckdb_time_tz_struct, time) - 0usize];
301 ["Offset of field: duckdb_time_tz_struct::offset"]
302 [::std::mem::offset_of!(duckdb_time_tz_struct, offset) - 8usize];
303};
304#[doc = "! TIMESTAMP is stored as microseconds since 1970-01-01.\n! Use the `duckdb_from_timestamp` and `duckdb_to_timestamp` functions to extract individual information."]
305#[repr(C)]
306#[derive(Debug, Copy, Clone)]
307pub struct duckdb_timestamp {
308 pub micros: i64,
309}
310#[allow(clippy::unnecessary_operation, clippy::identity_op)]
311const _: () = {
312 ["Size of duckdb_timestamp"][::std::mem::size_of::<duckdb_timestamp>() - 8usize];
313 ["Alignment of duckdb_timestamp"][::std::mem::align_of::<duckdb_timestamp>() - 8usize];
314 ["Offset of field: duckdb_timestamp::micros"]
315 [::std::mem::offset_of!(duckdb_timestamp, micros) - 0usize];
316};
317#[repr(C)]
318#[derive(Debug, Copy, Clone)]
319pub struct duckdb_timestamp_struct {
320 pub date: duckdb_date_struct,
321 pub time: duckdb_time_struct,
322}
323#[allow(clippy::unnecessary_operation, clippy::identity_op)]
324const _: () = {
325 ["Size of duckdb_timestamp_struct"][::std::mem::size_of::<duckdb_timestamp_struct>() - 16usize];
326 ["Alignment of duckdb_timestamp_struct"]
327 [::std::mem::align_of::<duckdb_timestamp_struct>() - 4usize];
328 ["Offset of field: duckdb_timestamp_struct::date"]
329 [::std::mem::offset_of!(duckdb_timestamp_struct, date) - 0usize];
330 ["Offset of field: duckdb_timestamp_struct::time"]
331 [::std::mem::offset_of!(duckdb_timestamp_struct, time) - 8usize];
332};
333#[doc = "! TIMESTAMP_S is stored as seconds since 1970-01-01."]
334#[repr(C)]
335#[derive(Debug, Copy, Clone)]
336pub struct duckdb_timestamp_s {
337 pub seconds: i64,
338}
339#[allow(clippy::unnecessary_operation, clippy::identity_op)]
340const _: () = {
341 ["Size of duckdb_timestamp_s"][::std::mem::size_of::<duckdb_timestamp_s>() - 8usize];
342 ["Alignment of duckdb_timestamp_s"][::std::mem::align_of::<duckdb_timestamp_s>() - 8usize];
343 ["Offset of field: duckdb_timestamp_s::seconds"]
344 [::std::mem::offset_of!(duckdb_timestamp_s, seconds) - 0usize];
345};
346#[doc = "! TIMESTAMP_MS is stored as milliseconds since 1970-01-01."]
347#[repr(C)]
348#[derive(Debug, Copy, Clone)]
349pub struct duckdb_timestamp_ms {
350 pub millis: i64,
351}
352#[allow(clippy::unnecessary_operation, clippy::identity_op)]
353const _: () = {
354 ["Size of duckdb_timestamp_ms"][::std::mem::size_of::<duckdb_timestamp_ms>() - 8usize];
355 ["Alignment of duckdb_timestamp_ms"][::std::mem::align_of::<duckdb_timestamp_ms>() - 8usize];
356 ["Offset of field: duckdb_timestamp_ms::millis"]
357 [::std::mem::offset_of!(duckdb_timestamp_ms, millis) - 0usize];
358};
359#[doc = "! TIMESTAMP_NS is stored as nanoseconds since 1970-01-01."]
360#[repr(C)]
361#[derive(Debug, Copy, Clone)]
362pub struct duckdb_timestamp_ns {
363 pub nanos: i64,
364}
365#[allow(clippy::unnecessary_operation, clippy::identity_op)]
366const _: () = {
367 ["Size of duckdb_timestamp_ns"][::std::mem::size_of::<duckdb_timestamp_ns>() - 8usize];
368 ["Alignment of duckdb_timestamp_ns"][::std::mem::align_of::<duckdb_timestamp_ns>() - 8usize];
369 ["Offset of field: duckdb_timestamp_ns::nanos"]
370 [::std::mem::offset_of!(duckdb_timestamp_ns, nanos) - 0usize];
371};
372#[doc = "! INTERVAL is stored in months, days, and micros."]
373#[repr(C)]
374#[derive(Debug, Copy, Clone)]
375pub struct duckdb_interval {
376 pub months: i32,
377 pub days: i32,
378 pub micros: i64,
379}
380#[allow(clippy::unnecessary_operation, clippy::identity_op)]
381const _: () = {
382 ["Size of duckdb_interval"][::std::mem::size_of::<duckdb_interval>() - 16usize];
383 ["Alignment of duckdb_interval"][::std::mem::align_of::<duckdb_interval>() - 8usize];
384 ["Offset of field: duckdb_interval::months"]
385 [::std::mem::offset_of!(duckdb_interval, months) - 0usize];
386 ["Offset of field: duckdb_interval::days"]
387 [::std::mem::offset_of!(duckdb_interval, days) - 4usize];
388 ["Offset of field: duckdb_interval::micros"]
389 [::std::mem::offset_of!(duckdb_interval, micros) - 8usize];
390};
391#[doc = "! HUGEINT is composed of a lower and upper component.\n! Its value is upper * 2^64 + lower.\n! For simplified usage, use `duckdb_hugeint_to_double` and `duckdb_double_to_hugeint`."]
392#[repr(C)]
393#[derive(Debug, Copy, Clone)]
394pub struct duckdb_hugeint {
395 pub lower: u64,
396 pub upper: i64,
397}
398#[allow(clippy::unnecessary_operation, clippy::identity_op)]
399const _: () = {
400 ["Size of duckdb_hugeint"][::std::mem::size_of::<duckdb_hugeint>() - 16usize];
401 ["Alignment of duckdb_hugeint"][::std::mem::align_of::<duckdb_hugeint>() - 8usize];
402 ["Offset of field: duckdb_hugeint::lower"]
403 [::std::mem::offset_of!(duckdb_hugeint, lower) - 0usize];
404 ["Offset of field: duckdb_hugeint::upper"]
405 [::std::mem::offset_of!(duckdb_hugeint, upper) - 8usize];
406};
407#[doc = "! UHUGEINT is composed of a lower and upper component.\n! Its value is upper * 2^64 + lower.\n! For simplified usage, use `duckdb_uhugeint_to_double` and `duckdb_double_to_uhugeint`."]
408#[repr(C)]
409#[derive(Debug, Copy, Clone)]
410pub struct duckdb_uhugeint {
411 pub lower: u64,
412 pub upper: u64,
413}
414#[allow(clippy::unnecessary_operation, clippy::identity_op)]
415const _: () = {
416 ["Size of duckdb_uhugeint"][::std::mem::size_of::<duckdb_uhugeint>() - 16usize];
417 ["Alignment of duckdb_uhugeint"][::std::mem::align_of::<duckdb_uhugeint>() - 8usize];
418 ["Offset of field: duckdb_uhugeint::lower"]
419 [::std::mem::offset_of!(duckdb_uhugeint, lower) - 0usize];
420 ["Offset of field: duckdb_uhugeint::upper"]
421 [::std::mem::offset_of!(duckdb_uhugeint, upper) - 8usize];
422};
423#[doc = "! DECIMAL is composed of a width and a scale.\n! Their value is stored in a HUGEINT."]
424#[repr(C)]
425#[derive(Debug, Copy, Clone)]
426pub struct duckdb_decimal {
427 pub width: u8,
428 pub scale: u8,
429 pub value: duckdb_hugeint,
430}
431#[allow(clippy::unnecessary_operation, clippy::identity_op)]
432const _: () = {
433 ["Size of duckdb_decimal"][::std::mem::size_of::<duckdb_decimal>() - 24usize];
434 ["Alignment of duckdb_decimal"][::std::mem::align_of::<duckdb_decimal>() - 8usize];
435 ["Offset of field: duckdb_decimal::width"]
436 [::std::mem::offset_of!(duckdb_decimal, width) - 0usize];
437 ["Offset of field: duckdb_decimal::scale"]
438 [::std::mem::offset_of!(duckdb_decimal, scale) - 1usize];
439 ["Offset of field: duckdb_decimal::value"]
440 [::std::mem::offset_of!(duckdb_decimal, value) - 8usize];
441};
442#[doc = "! A type holding information about the query execution progress."]
443#[repr(C)]
444#[derive(Debug, Copy, Clone)]
445pub struct duckdb_query_progress_type {
446 pub percentage: f64,
447 pub rows_processed: u64,
448 pub total_rows_to_process: u64,
449}
450#[allow(clippy::unnecessary_operation, clippy::identity_op)]
451const _: () = {
452 ["Size of duckdb_query_progress_type"]
453 [::std::mem::size_of::<duckdb_query_progress_type>() - 24usize];
454 ["Alignment of duckdb_query_progress_type"]
455 [::std::mem::align_of::<duckdb_query_progress_type>() - 8usize];
456 ["Offset of field: duckdb_query_progress_type::percentage"]
457 [::std::mem::offset_of!(duckdb_query_progress_type, percentage) - 0usize];
458 ["Offset of field: duckdb_query_progress_type::rows_processed"]
459 [::std::mem::offset_of!(duckdb_query_progress_type, rows_processed) - 8usize];
460 ["Offset of field: duckdb_query_progress_type::total_rows_to_process"]
461 [::std::mem::offset_of!(duckdb_query_progress_type, total_rows_to_process) - 16usize];
462};
463#[doc = "! The internal representation of a VARCHAR (string_t). If the VARCHAR does not\n! exceed 12 characters, then we inline it. Otherwise, we inline a four-byte prefix for faster\n! string comparisons and store a pointer to the remaining characters. This is a non-\n! owning structure, i.e., it does not have to be freed."]
464#[repr(C)]
465#[derive(Copy, Clone)]
466pub struct duckdb_string_t {
467 pub value: duckdb_string_t__bindgen_ty_1,
468}
469#[repr(C)]
470#[derive(Copy, Clone)]
471pub union duckdb_string_t__bindgen_ty_1 {
472 pub pointer: duckdb_string_t__bindgen_ty_1__bindgen_ty_1,
473 pub inlined: duckdb_string_t__bindgen_ty_1__bindgen_ty_2,
474}
475#[repr(C)]
476#[derive(Debug, Copy, Clone)]
477pub struct duckdb_string_t__bindgen_ty_1__bindgen_ty_1 {
478 pub length: u32,
479 pub prefix: [::std::os::raw::c_char; 4usize],
480 pub ptr: *mut ::std::os::raw::c_char,
481}
482#[allow(clippy::unnecessary_operation, clippy::identity_op)]
483const _: () = {
484 ["Size of duckdb_string_t__bindgen_ty_1__bindgen_ty_1"]
485 [::std::mem::size_of::<duckdb_string_t__bindgen_ty_1__bindgen_ty_1>() - 16usize];
486 ["Alignment of duckdb_string_t__bindgen_ty_1__bindgen_ty_1"]
487 [::std::mem::align_of::<duckdb_string_t__bindgen_ty_1__bindgen_ty_1>() - 8usize];
488 ["Offset of field: duckdb_string_t__bindgen_ty_1__bindgen_ty_1::length"]
489 [::std::mem::offset_of!(duckdb_string_t__bindgen_ty_1__bindgen_ty_1, length) - 0usize];
490 ["Offset of field: duckdb_string_t__bindgen_ty_1__bindgen_ty_1::prefix"]
491 [::std::mem::offset_of!(duckdb_string_t__bindgen_ty_1__bindgen_ty_1, prefix) - 4usize];
492 ["Offset of field: duckdb_string_t__bindgen_ty_1__bindgen_ty_1::ptr"]
493 [::std::mem::offset_of!(duckdb_string_t__bindgen_ty_1__bindgen_ty_1, ptr) - 8usize];
494};
495#[repr(C)]
496#[derive(Debug, Copy, Clone)]
497pub struct duckdb_string_t__bindgen_ty_1__bindgen_ty_2 {
498 pub length: u32,
499 pub inlined: [::std::os::raw::c_char; 12usize],
500}
501#[allow(clippy::unnecessary_operation, clippy::identity_op)]
502const _: () = {
503 ["Size of duckdb_string_t__bindgen_ty_1__bindgen_ty_2"]
504 [::std::mem::size_of::<duckdb_string_t__bindgen_ty_1__bindgen_ty_2>() - 16usize];
505 ["Alignment of duckdb_string_t__bindgen_ty_1__bindgen_ty_2"]
506 [::std::mem::align_of::<duckdb_string_t__bindgen_ty_1__bindgen_ty_2>() - 4usize];
507 ["Offset of field: duckdb_string_t__bindgen_ty_1__bindgen_ty_2::length"]
508 [::std::mem::offset_of!(duckdb_string_t__bindgen_ty_1__bindgen_ty_2, length) - 0usize];
509 ["Offset of field: duckdb_string_t__bindgen_ty_1__bindgen_ty_2::inlined"]
510 [::std::mem::offset_of!(duckdb_string_t__bindgen_ty_1__bindgen_ty_2, inlined) - 4usize];
511};
512#[allow(clippy::unnecessary_operation, clippy::identity_op)]
513const _: () = {
514 ["Size of duckdb_string_t__bindgen_ty_1"]
515 [::std::mem::size_of::<duckdb_string_t__bindgen_ty_1>() - 16usize];
516 ["Alignment of duckdb_string_t__bindgen_ty_1"]
517 [::std::mem::align_of::<duckdb_string_t__bindgen_ty_1>() - 8usize];
518 ["Offset of field: duckdb_string_t__bindgen_ty_1::pointer"]
519 [::std::mem::offset_of!(duckdb_string_t__bindgen_ty_1, pointer) - 0usize];
520 ["Offset of field: duckdb_string_t__bindgen_ty_1::inlined"]
521 [::std::mem::offset_of!(duckdb_string_t__bindgen_ty_1, inlined) - 0usize];
522};
523#[allow(clippy::unnecessary_operation, clippy::identity_op)]
524const _: () = {
525 ["Size of duckdb_string_t"][::std::mem::size_of::<duckdb_string_t>() - 16usize];
526 ["Alignment of duckdb_string_t"][::std::mem::align_of::<duckdb_string_t>() - 8usize];
527 ["Offset of field: duckdb_string_t::value"]
528 [::std::mem::offset_of!(duckdb_string_t, value) - 0usize];
529};
530#[doc = "! DuckDB's LISTs are composed of a 'parent' vector holding metadata of each list,\n! and a child vector holding the entries of the lists.\n! The `duckdb_list_entry` struct contains the internal representation of a LIST metadata entry.\n! A metadata entry contains the length of the list, and its offset in the child vector."]
531#[repr(C)]
532#[derive(Debug, Copy, Clone)]
533pub struct duckdb_list_entry {
534 pub offset: u64,
535 pub length: u64,
536}
537#[allow(clippy::unnecessary_operation, clippy::identity_op)]
538const _: () = {
539 ["Size of duckdb_list_entry"][::std::mem::size_of::<duckdb_list_entry>() - 16usize];
540 ["Alignment of duckdb_list_entry"][::std::mem::align_of::<duckdb_list_entry>() - 8usize];
541 ["Offset of field: duckdb_list_entry::offset"]
542 [::std::mem::offset_of!(duckdb_list_entry, offset) - 0usize];
543 ["Offset of field: duckdb_list_entry::length"]
544 [::std::mem::offset_of!(duckdb_list_entry, length) - 8usize];
545};
546#[doc = "! A column consists of a pointer to its internal data. Don't operate on this type directly.\n! Instead, use functions such as `duckdb_column_data`, `duckdb_nullmask_data`,\n! `duckdb_column_type`, and `duckdb_column_name`."]
547#[repr(C)]
548#[derive(Debug, Copy, Clone)]
549pub struct duckdb_column {
550 pub deprecated_data: *mut ::std::os::raw::c_void,
551 pub deprecated_nullmask: *mut bool,
552 pub deprecated_type: duckdb_type,
553 pub deprecated_name: *mut ::std::os::raw::c_char,
554 pub internal_data: *mut ::std::os::raw::c_void,
555}
556#[allow(clippy::unnecessary_operation, clippy::identity_op)]
557const _: () = {
558 ["Size of duckdb_column"][::std::mem::size_of::<duckdb_column>() - 40usize];
559 ["Alignment of duckdb_column"][::std::mem::align_of::<duckdb_column>() - 8usize];
560 ["Offset of field: duckdb_column::deprecated_data"]
561 [::std::mem::offset_of!(duckdb_column, deprecated_data) - 0usize];
562 ["Offset of field: duckdb_column::deprecated_nullmask"]
563 [::std::mem::offset_of!(duckdb_column, deprecated_nullmask) - 8usize];
564 ["Offset of field: duckdb_column::deprecated_type"]
565 [::std::mem::offset_of!(duckdb_column, deprecated_type) - 16usize];
566 ["Offset of field: duckdb_column::deprecated_name"]
567 [::std::mem::offset_of!(duckdb_column, deprecated_name) - 24usize];
568 ["Offset of field: duckdb_column::internal_data"]
569 [::std::mem::offset_of!(duckdb_column, internal_data) - 32usize];
570};
571#[doc = "! 1. A standalone vector that must be destroyed, or\n! 2. A vector to a column in a data chunk that lives as long as the data chunk lives."]
572#[repr(C)]
573#[derive(Debug, Copy, Clone)]
574pub struct _duckdb_vector {
575 pub internal_ptr: *mut ::std::os::raw::c_void,
576}
577#[allow(clippy::unnecessary_operation, clippy::identity_op)]
578const _: () = {
579 ["Size of _duckdb_vector"][::std::mem::size_of::<_duckdb_vector>() - 8usize];
580 ["Alignment of _duckdb_vector"][::std::mem::align_of::<_duckdb_vector>() - 8usize];
581 ["Offset of field: _duckdb_vector::internal_ptr"]
582 [::std::mem::offset_of!(_duckdb_vector, internal_ptr) - 0usize];
583};
584#[doc = "! 1. A standalone vector that must be destroyed, or\n! 2. A vector to a column in a data chunk that lives as long as the data chunk lives."]
585pub type duckdb_vector = *mut _duckdb_vector;
586#[doc = "! A selection vector is a vector of indices, which usually refer to values in a vector.\n! Can be used to slice vectors, changing their length and the order of their entries.\n! Standalone selection vectors must be destroyed."]
587#[repr(C)]
588#[derive(Debug, Copy, Clone)]
589pub struct _duckdb_selection_vector {
590 pub internal_ptr: *mut ::std::os::raw::c_void,
591}
592#[allow(clippy::unnecessary_operation, clippy::identity_op)]
593const _: () = {
594 ["Size of _duckdb_selection_vector"]
595 [::std::mem::size_of::<_duckdb_selection_vector>() - 8usize];
596 ["Alignment of _duckdb_selection_vector"]
597 [::std::mem::align_of::<_duckdb_selection_vector>() - 8usize];
598 ["Offset of field: _duckdb_selection_vector::internal_ptr"]
599 [::std::mem::offset_of!(_duckdb_selection_vector, internal_ptr) - 0usize];
600};
601#[doc = "! A selection vector is a vector of indices, which usually refer to values in a vector.\n! Can be used to slice vectors, changing their length and the order of their entries.\n! Standalone selection vectors must be destroyed."]
602pub type duckdb_selection_vector = *mut _duckdb_selection_vector;
603#[doc = "! Strings are composed of a `char` pointer and a size.\n! You must free `string.data` with `duckdb_free`."]
604#[repr(C)]
605#[derive(Debug, Copy, Clone)]
606pub struct duckdb_string {
607 pub data: *mut ::std::os::raw::c_char,
608 pub size: idx_t,
609}
610#[allow(clippy::unnecessary_operation, clippy::identity_op)]
611const _: () = {
612 ["Size of duckdb_string"][::std::mem::size_of::<duckdb_string>() - 16usize];
613 ["Alignment of duckdb_string"][::std::mem::align_of::<duckdb_string>() - 8usize];
614 ["Offset of field: duckdb_string::data"][::std::mem::offset_of!(duckdb_string, data) - 0usize];
615 ["Offset of field: duckdb_string::size"][::std::mem::offset_of!(duckdb_string, size) - 8usize];
616};
617#[doc = "! BLOBs are composed of a byte pointer and a size.\n! You must free `blob.data` with `duckdb_free`."]
618#[repr(C)]
619#[derive(Debug, Copy, Clone)]
620pub struct duckdb_blob {
621 pub data: *mut ::std::os::raw::c_void,
622 pub size: idx_t,
623}
624#[allow(clippy::unnecessary_operation, clippy::identity_op)]
625const _: () = {
626 ["Size of duckdb_blob"][::std::mem::size_of::<duckdb_blob>() - 16usize];
627 ["Alignment of duckdb_blob"][::std::mem::align_of::<duckdb_blob>() - 8usize];
628 ["Offset of field: duckdb_blob::data"][::std::mem::offset_of!(duckdb_blob, data) - 0usize];
629 ["Offset of field: duckdb_blob::size"][::std::mem::offset_of!(duckdb_blob, size) - 8usize];
630};
631#[doc = "! BITs are composed of a byte pointer and a size.\n! BIT byte data has 0 to 7 bits of padding.\n! The first byte contains the number of padding bits.\n! The padding bits of the second byte are set to 1, starting from the MSB.\n! You must free `data` with `duckdb_free`."]
632#[repr(C)]
633#[derive(Debug, Copy, Clone)]
634pub struct duckdb_bit {
635 pub data: *mut u8,
636 pub size: idx_t,
637}
638#[allow(clippy::unnecessary_operation, clippy::identity_op)]
639const _: () = {
640 ["Size of duckdb_bit"][::std::mem::size_of::<duckdb_bit>() - 16usize];
641 ["Alignment of duckdb_bit"][::std::mem::align_of::<duckdb_bit>() - 8usize];
642 ["Offset of field: duckdb_bit::data"][::std::mem::offset_of!(duckdb_bit, data) - 0usize];
643 ["Offset of field: duckdb_bit::size"][::std::mem::offset_of!(duckdb_bit, size) - 8usize];
644};
645#[doc = "! BIGNUMs are composed of a byte pointer, a size, and an `is_negative` bool.\n! The absolute value of the number is stored in `data` in big endian format.\n! You must free `data` with `duckdb_free`."]
646#[repr(C)]
647#[derive(Debug, Copy, Clone)]
648pub struct duckdb_bignum {
649 pub data: *mut u8,
650 pub size: idx_t,
651 pub is_negative: bool,
652}
653#[allow(clippy::unnecessary_operation, clippy::identity_op)]
654const _: () = {
655 ["Size of duckdb_bignum"][::std::mem::size_of::<duckdb_bignum>() - 24usize];
656 ["Alignment of duckdb_bignum"][::std::mem::align_of::<duckdb_bignum>() - 8usize];
657 ["Offset of field: duckdb_bignum::data"][::std::mem::offset_of!(duckdb_bignum, data) - 0usize];
658 ["Offset of field: duckdb_bignum::size"][::std::mem::offset_of!(duckdb_bignum, size) - 8usize];
659 ["Offset of field: duckdb_bignum::is_negative"]
660 [::std::mem::offset_of!(duckdb_bignum, is_negative) - 16usize];
661};
662#[doc = "! A query result consists of a pointer to its internal data.\n! Must be freed with 'duckdb_destroy_result'."]
663#[repr(C)]
664#[derive(Debug, Copy, Clone)]
665pub struct duckdb_result {
666 pub deprecated_column_count: idx_t,
667 pub deprecated_row_count: idx_t,
668 pub deprecated_rows_changed: idx_t,
669 pub deprecated_columns: *mut duckdb_column,
670 pub deprecated_error_message: *mut ::std::os::raw::c_char,
671 pub internal_data: *mut ::std::os::raw::c_void,
672}
673#[allow(clippy::unnecessary_operation, clippy::identity_op)]
674const _: () = {
675 ["Size of duckdb_result"][::std::mem::size_of::<duckdb_result>() - 48usize];
676 ["Alignment of duckdb_result"][::std::mem::align_of::<duckdb_result>() - 8usize];
677 ["Offset of field: duckdb_result::deprecated_column_count"]
678 [::std::mem::offset_of!(duckdb_result, deprecated_column_count) - 0usize];
679 ["Offset of field: duckdb_result::deprecated_row_count"]
680 [::std::mem::offset_of!(duckdb_result, deprecated_row_count) - 8usize];
681 ["Offset of field: duckdb_result::deprecated_rows_changed"]
682 [::std::mem::offset_of!(duckdb_result, deprecated_rows_changed) - 16usize];
683 ["Offset of field: duckdb_result::deprecated_columns"]
684 [::std::mem::offset_of!(duckdb_result, deprecated_columns) - 24usize];
685 ["Offset of field: duckdb_result::deprecated_error_message"]
686 [::std::mem::offset_of!(duckdb_result, deprecated_error_message) - 32usize];
687 ["Offset of field: duckdb_result::internal_data"]
688 [::std::mem::offset_of!(duckdb_result, internal_data) - 40usize];
689};
690#[doc = "! A database instance cache object. Must be destroyed with `duckdb_destroy_instance_cache`."]
691#[repr(C)]
692#[derive(Debug, Copy, Clone)]
693pub struct _duckdb_instance_cache {
694 pub internal_ptr: *mut ::std::os::raw::c_void,
695}
696#[allow(clippy::unnecessary_operation, clippy::identity_op)]
697const _: () = {
698 ["Size of _duckdb_instance_cache"][::std::mem::size_of::<_duckdb_instance_cache>() - 8usize];
699 ["Alignment of _duckdb_instance_cache"]
700 [::std::mem::align_of::<_duckdb_instance_cache>() - 8usize];
701 ["Offset of field: _duckdb_instance_cache::internal_ptr"]
702 [::std::mem::offset_of!(_duckdb_instance_cache, internal_ptr) - 0usize];
703};
704#[doc = "! A database instance cache object. Must be destroyed with `duckdb_destroy_instance_cache`."]
705pub type duckdb_instance_cache = *mut _duckdb_instance_cache;
706#[doc = "! A database object. Must be closed with `duckdb_close`."]
707#[repr(C)]
708#[derive(Debug, Copy, Clone)]
709pub struct _duckdb_database {
710 pub internal_ptr: *mut ::std::os::raw::c_void,
711}
712#[allow(clippy::unnecessary_operation, clippy::identity_op)]
713const _: () = {
714 ["Size of _duckdb_database"][::std::mem::size_of::<_duckdb_database>() - 8usize];
715 ["Alignment of _duckdb_database"][::std::mem::align_of::<_duckdb_database>() - 8usize];
716 ["Offset of field: _duckdb_database::internal_ptr"]
717 [::std::mem::offset_of!(_duckdb_database, internal_ptr) - 0usize];
718};
719#[doc = "! A database object. Must be closed with `duckdb_close`."]
720pub type duckdb_database = *mut _duckdb_database;
721#[doc = "! A connection to a duckdb database. Must be closed with `duckdb_disconnect`."]
722#[repr(C)]
723#[derive(Debug, Copy, Clone)]
724pub struct _duckdb_connection {
725 pub internal_ptr: *mut ::std::os::raw::c_void,
726}
727#[allow(clippy::unnecessary_operation, clippy::identity_op)]
728const _: () = {
729 ["Size of _duckdb_connection"][::std::mem::size_of::<_duckdb_connection>() - 8usize];
730 ["Alignment of _duckdb_connection"][::std::mem::align_of::<_duckdb_connection>() - 8usize];
731 ["Offset of field: _duckdb_connection::internal_ptr"]
732 [::std::mem::offset_of!(_duckdb_connection, internal_ptr) - 0usize];
733};
734#[doc = "! A connection to a duckdb database. Must be closed with `duckdb_disconnect`."]
735pub type duckdb_connection = *mut _duckdb_connection;
736#[doc = "! A client context of a duckdb connection. Must be destroyed with `duckdb_destroy_context`."]
737#[repr(C)]
738#[derive(Debug, Copy, Clone)]
739pub struct _duckdb_client_context {
740 pub internal_ptr: *mut ::std::os::raw::c_void,
741}
742#[allow(clippy::unnecessary_operation, clippy::identity_op)]
743const _: () = {
744 ["Size of _duckdb_client_context"][::std::mem::size_of::<_duckdb_client_context>() - 8usize];
745 ["Alignment of _duckdb_client_context"]
746 [::std::mem::align_of::<_duckdb_client_context>() - 8usize];
747 ["Offset of field: _duckdb_client_context::internal_ptr"]
748 [::std::mem::offset_of!(_duckdb_client_context, internal_ptr) - 0usize];
749};
750#[doc = "! A client context of a duckdb connection. Must be destroyed with `duckdb_destroy_context`."]
751pub type duckdb_client_context = *mut _duckdb_client_context;
752#[doc = "! A prepared statement is a parameterized query that allows you to bind parameters to it.\n! Must be destroyed with `duckdb_destroy_prepare`."]
753#[repr(C)]
754#[derive(Debug, Copy, Clone)]
755pub struct _duckdb_prepared_statement {
756 pub internal_ptr: *mut ::std::os::raw::c_void,
757}
758#[allow(clippy::unnecessary_operation, clippy::identity_op)]
759const _: () = {
760 ["Size of _duckdb_prepared_statement"]
761 [::std::mem::size_of::<_duckdb_prepared_statement>() - 8usize];
762 ["Alignment of _duckdb_prepared_statement"]
763 [::std::mem::align_of::<_duckdb_prepared_statement>() - 8usize];
764 ["Offset of field: _duckdb_prepared_statement::internal_ptr"]
765 [::std::mem::offset_of!(_duckdb_prepared_statement, internal_ptr) - 0usize];
766};
767#[doc = "! A prepared statement is a parameterized query that allows you to bind parameters to it.\n! Must be destroyed with `duckdb_destroy_prepare`."]
768pub type duckdb_prepared_statement = *mut _duckdb_prepared_statement;
769#[doc = "! Extracted statements. Must be destroyed with `duckdb_destroy_extracted`."]
770#[repr(C)]
771#[derive(Debug, Copy, Clone)]
772pub struct _duckdb_extracted_statements {
773 pub internal_ptr: *mut ::std::os::raw::c_void,
774}
775#[allow(clippy::unnecessary_operation, clippy::identity_op)]
776const _: () = {
777 ["Size of _duckdb_extracted_statements"]
778 [::std::mem::size_of::<_duckdb_extracted_statements>() - 8usize];
779 ["Alignment of _duckdb_extracted_statements"]
780 [::std::mem::align_of::<_duckdb_extracted_statements>() - 8usize];
781 ["Offset of field: _duckdb_extracted_statements::internal_ptr"]
782 [::std::mem::offset_of!(_duckdb_extracted_statements, internal_ptr) - 0usize];
783};
784#[doc = "! Extracted statements. Must be destroyed with `duckdb_destroy_extracted`."]
785pub type duckdb_extracted_statements = *mut _duckdb_extracted_statements;
786#[doc = "! The pending result represents an intermediate structure for a query that is not yet fully executed.\n! Must be destroyed with `duckdb_destroy_pending`."]
787#[repr(C)]
788#[derive(Debug, Copy, Clone)]
789pub struct _duckdb_pending_result {
790 pub internal_ptr: *mut ::std::os::raw::c_void,
791}
792#[allow(clippy::unnecessary_operation, clippy::identity_op)]
793const _: () = {
794 ["Size of _duckdb_pending_result"][::std::mem::size_of::<_duckdb_pending_result>() - 8usize];
795 ["Alignment of _duckdb_pending_result"]
796 [::std::mem::align_of::<_duckdb_pending_result>() - 8usize];
797 ["Offset of field: _duckdb_pending_result::internal_ptr"]
798 [::std::mem::offset_of!(_duckdb_pending_result, internal_ptr) - 0usize];
799};
800#[doc = "! The pending result represents an intermediate structure for a query that is not yet fully executed.\n! Must be destroyed with `duckdb_destroy_pending`."]
801pub type duckdb_pending_result = *mut _duckdb_pending_result;
802#[doc = "! The appender enables fast data loading into DuckDB.\n! Must be destroyed with `duckdb_appender_destroy`."]
803#[repr(C)]
804#[derive(Debug, Copy, Clone)]
805pub struct _duckdb_appender {
806 pub internal_ptr: *mut ::std::os::raw::c_void,
807}
808#[allow(clippy::unnecessary_operation, clippy::identity_op)]
809const _: () = {
810 ["Size of _duckdb_appender"][::std::mem::size_of::<_duckdb_appender>() - 8usize];
811 ["Alignment of _duckdb_appender"][::std::mem::align_of::<_duckdb_appender>() - 8usize];
812 ["Offset of field: _duckdb_appender::internal_ptr"]
813 [::std::mem::offset_of!(_duckdb_appender, internal_ptr) - 0usize];
814};
815#[doc = "! The appender enables fast data loading into DuckDB.\n! Must be destroyed with `duckdb_appender_destroy`."]
816pub type duckdb_appender = *mut _duckdb_appender;
817#[doc = "! The table description allows querying information about the table.\n! Must be destroyed with `duckdb_table_description_destroy`."]
818#[repr(C)]
819#[derive(Debug, Copy, Clone)]
820pub struct _duckdb_table_description {
821 pub internal_ptr: *mut ::std::os::raw::c_void,
822}
823#[allow(clippy::unnecessary_operation, clippy::identity_op)]
824const _: () = {
825 ["Size of _duckdb_table_description"]
826 [::std::mem::size_of::<_duckdb_table_description>() - 8usize];
827 ["Alignment of _duckdb_table_description"]
828 [::std::mem::align_of::<_duckdb_table_description>() - 8usize];
829 ["Offset of field: _duckdb_table_description::internal_ptr"]
830 [::std::mem::offset_of!(_duckdb_table_description, internal_ptr) - 0usize];
831};
832#[doc = "! The table description allows querying information about the table.\n! Must be destroyed with `duckdb_table_description_destroy`."]
833pub type duckdb_table_description = *mut _duckdb_table_description;
834#[doc = "! The configuration can be used to provide start-up options for a database.\n! Must be destroyed with `duckdb_destroy_config`."]
835#[repr(C)]
836#[derive(Debug, Copy, Clone)]
837pub struct _duckdb_config {
838 pub internal_ptr: *mut ::std::os::raw::c_void,
839}
840#[allow(clippy::unnecessary_operation, clippy::identity_op)]
841const _: () = {
842 ["Size of _duckdb_config"][::std::mem::size_of::<_duckdb_config>() - 8usize];
843 ["Alignment of _duckdb_config"][::std::mem::align_of::<_duckdb_config>() - 8usize];
844 ["Offset of field: _duckdb_config::internal_ptr"]
845 [::std::mem::offset_of!(_duckdb_config, internal_ptr) - 0usize];
846};
847#[doc = "! The configuration can be used to provide start-up options for a database.\n! Must be destroyed with `duckdb_destroy_config`."]
848pub type duckdb_config = *mut _duckdb_config;
849#[doc = "! A custom configuration option instance. Used to register custom options that can be set on a duckdb_config.\n! or by the user in SQL using `SET <option_name> = <value>`."]
850#[repr(C)]
851#[derive(Debug, Copy, Clone)]
852pub struct _duckdb_config_option {
853 pub internal_ptr: *mut ::std::os::raw::c_void,
854}
855#[allow(clippy::unnecessary_operation, clippy::identity_op)]
856const _: () = {
857 ["Size of _duckdb_config_option"][::std::mem::size_of::<_duckdb_config_option>() - 8usize];
858 ["Alignment of _duckdb_config_option"]
859 [::std::mem::align_of::<_duckdb_config_option>() - 8usize];
860 ["Offset of field: _duckdb_config_option::internal_ptr"]
861 [::std::mem::offset_of!(_duckdb_config_option, internal_ptr) - 0usize];
862};
863#[doc = "! A custom configuration option instance. Used to register custom options that can be set on a duckdb_config.\n! or by the user in SQL using `SET <option_name> = <value>`."]
864pub type duckdb_config_option = *mut _duckdb_config_option;
865#[doc = "! A logical type.\n! Must be destroyed with `duckdb_destroy_logical_type`."]
866#[repr(C)]
867#[derive(Debug, Copy, Clone)]
868pub struct _duckdb_logical_type {
869 pub internal_ptr: *mut ::std::os::raw::c_void,
870}
871#[allow(clippy::unnecessary_operation, clippy::identity_op)]
872const _: () = {
873 ["Size of _duckdb_logical_type"][::std::mem::size_of::<_duckdb_logical_type>() - 8usize];
874 ["Alignment of _duckdb_logical_type"][::std::mem::align_of::<_duckdb_logical_type>() - 8usize];
875 ["Offset of field: _duckdb_logical_type::internal_ptr"]
876 [::std::mem::offset_of!(_duckdb_logical_type, internal_ptr) - 0usize];
877};
878#[doc = "! A logical type.\n! Must be destroyed with `duckdb_destroy_logical_type`."]
879pub type duckdb_logical_type = *mut _duckdb_logical_type;
880#[doc = "! Holds extra information to register a custom logical type.\n! Reserved for future use."]
881#[repr(C)]
882#[derive(Debug, Copy, Clone)]
883pub struct _duckdb_create_type_info {
884 pub internal_ptr: *mut ::std::os::raw::c_void,
885}
886#[allow(clippy::unnecessary_operation, clippy::identity_op)]
887const _: () = {
888 ["Size of _duckdb_create_type_info"]
889 [::std::mem::size_of::<_duckdb_create_type_info>() - 8usize];
890 ["Alignment of _duckdb_create_type_info"]
891 [::std::mem::align_of::<_duckdb_create_type_info>() - 8usize];
892 ["Offset of field: _duckdb_create_type_info::internal_ptr"]
893 [::std::mem::offset_of!(_duckdb_create_type_info, internal_ptr) - 0usize];
894};
895#[doc = "! Holds extra information to register a custom logical type.\n! Reserved for future use."]
896pub type duckdb_create_type_info = *mut _duckdb_create_type_info;
897#[doc = "! Contains a data chunk of a duckdb_result.\n! Must be destroyed with `duckdb_destroy_data_chunk`."]
898#[repr(C)]
899#[derive(Debug, Copy, Clone)]
900pub struct _duckdb_data_chunk {
901 pub internal_ptr: *mut ::std::os::raw::c_void,
902}
903#[allow(clippy::unnecessary_operation, clippy::identity_op)]
904const _: () = {
905 ["Size of _duckdb_data_chunk"][::std::mem::size_of::<_duckdb_data_chunk>() - 8usize];
906 ["Alignment of _duckdb_data_chunk"][::std::mem::align_of::<_duckdb_data_chunk>() - 8usize];
907 ["Offset of field: _duckdb_data_chunk::internal_ptr"]
908 [::std::mem::offset_of!(_duckdb_data_chunk, internal_ptr) - 0usize];
909};
910#[doc = "! Contains a data chunk of a duckdb_result.\n! Must be destroyed with `duckdb_destroy_data_chunk`."]
911pub type duckdb_data_chunk = *mut _duckdb_data_chunk;
912#[doc = "! A value of a logical type.\n! Must be destroyed with `duckdb_destroy_value`."]
913#[repr(C)]
914#[derive(Debug, Copy, Clone)]
915pub struct _duckdb_value {
916 pub internal_ptr: *mut ::std::os::raw::c_void,
917}
918#[allow(clippy::unnecessary_operation, clippy::identity_op)]
919const _: () = {
920 ["Size of _duckdb_value"][::std::mem::size_of::<_duckdb_value>() - 8usize];
921 ["Alignment of _duckdb_value"][::std::mem::align_of::<_duckdb_value>() - 8usize];
922 ["Offset of field: _duckdb_value::internal_ptr"]
923 [::std::mem::offset_of!(_duckdb_value, internal_ptr) - 0usize];
924};
925#[doc = "! A value of a logical type.\n! Must be destroyed with `duckdb_destroy_value`."]
926pub type duckdb_value = *mut _duckdb_value;
927#[doc = "! Holds a recursive tree containing profiling metrics.\n! The tree matches the query plan, and has a top-level node."]
928#[repr(C)]
929#[derive(Debug, Copy, Clone)]
930pub struct _duckdb_profiling_info {
931 pub internal_ptr: *mut ::std::os::raw::c_void,
932}
933#[allow(clippy::unnecessary_operation, clippy::identity_op)]
934const _: () = {
935 ["Size of _duckdb_profiling_info"][::std::mem::size_of::<_duckdb_profiling_info>() - 8usize];
936 ["Alignment of _duckdb_profiling_info"]
937 [::std::mem::align_of::<_duckdb_profiling_info>() - 8usize];
938 ["Offset of field: _duckdb_profiling_info::internal_ptr"]
939 [::std::mem::offset_of!(_duckdb_profiling_info, internal_ptr) - 0usize];
940};
941#[doc = "! Holds a recursive tree containing profiling metrics.\n! The tree matches the query plan, and has a top-level node."]
942pub type duckdb_profiling_info = *mut _duckdb_profiling_info;
943#[doc = "! Holds error data.\n! Must be destroyed with `duckdb_destroy_error_data`."]
944#[repr(C)]
945#[derive(Debug, Copy, Clone)]
946pub struct _duckdb_error_data {
947 pub internal_ptr: *mut ::std::os::raw::c_void,
948}
949#[allow(clippy::unnecessary_operation, clippy::identity_op)]
950const _: () = {
951 ["Size of _duckdb_error_data"][::std::mem::size_of::<_duckdb_error_data>() - 8usize];
952 ["Alignment of _duckdb_error_data"][::std::mem::align_of::<_duckdb_error_data>() - 8usize];
953 ["Offset of field: _duckdb_error_data::internal_ptr"]
954 [::std::mem::offset_of!(_duckdb_error_data, internal_ptr) - 0usize];
955};
956#[doc = "! Holds error data.\n! Must be destroyed with `duckdb_destroy_error_data`."]
957pub type duckdb_error_data = *mut _duckdb_error_data;
958#[doc = "! Holds a bound expression.\n! Must be destroyed with `duckdb_destroy_expression`."]
959#[repr(C)]
960#[derive(Debug, Copy, Clone)]
961pub struct _duckdb_expression {
962 pub internal_ptr: *mut ::std::os::raw::c_void,
963}
964#[allow(clippy::unnecessary_operation, clippy::identity_op)]
965const _: () = {
966 ["Size of _duckdb_expression"][::std::mem::size_of::<_duckdb_expression>() - 8usize];
967 ["Alignment of _duckdb_expression"][::std::mem::align_of::<_duckdb_expression>() - 8usize];
968 ["Offset of field: _duckdb_expression::internal_ptr"]
969 [::std::mem::offset_of!(_duckdb_expression, internal_ptr) - 0usize];
970};
971#[doc = "! Holds a bound expression.\n! Must be destroyed with `duckdb_destroy_expression`."]
972pub type duckdb_expression = *mut _duckdb_expression;
973#[doc = "! Holds the state of the C API extension initialization process."]
974#[repr(C)]
975#[derive(Debug, Copy, Clone)]
976pub struct _duckdb_extension_info {
977 pub internal_ptr: *mut ::std::os::raw::c_void,
978}
979#[allow(clippy::unnecessary_operation, clippy::identity_op)]
980const _: () = {
981 ["Size of _duckdb_extension_info"][::std::mem::size_of::<_duckdb_extension_info>() - 8usize];
982 ["Alignment of _duckdb_extension_info"]
983 [::std::mem::align_of::<_duckdb_extension_info>() - 8usize];
984 ["Offset of field: _duckdb_extension_info::internal_ptr"]
985 [::std::mem::offset_of!(_duckdb_extension_info, internal_ptr) - 0usize];
986};
987#[doc = "! Holds the state of the C API extension initialization process."]
988pub type duckdb_extension_info = *mut _duckdb_extension_info;
989#[doc = "! Additional function info.\n! When setting this info, it is necessary to pass a destroy-callback function."]
990#[repr(C)]
991#[derive(Debug, Copy, Clone)]
992pub struct _duckdb_function_info {
993 pub internal_ptr: *mut ::std::os::raw::c_void,
994}
995#[allow(clippy::unnecessary_operation, clippy::identity_op)]
996const _: () = {
997 ["Size of _duckdb_function_info"][::std::mem::size_of::<_duckdb_function_info>() - 8usize];
998 ["Alignment of _duckdb_function_info"]
999 [::std::mem::align_of::<_duckdb_function_info>() - 8usize];
1000 ["Offset of field: _duckdb_function_info::internal_ptr"]
1001 [::std::mem::offset_of!(_duckdb_function_info, internal_ptr) - 0usize];
1002};
1003#[doc = "! Additional function info.\n! When setting this info, it is necessary to pass a destroy-callback function."]
1004pub type duckdb_function_info = *mut _duckdb_function_info;
1005#[doc = "! The bind info of a function.\n! When setting this info, it is necessary to pass a destroy-callback function."]
1006#[repr(C)]
1007#[derive(Debug, Copy, Clone)]
1008pub struct _duckdb_bind_info {
1009 pub internal_ptr: *mut ::std::os::raw::c_void,
1010}
1011#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1012const _: () = {
1013 ["Size of _duckdb_bind_info"][::std::mem::size_of::<_duckdb_bind_info>() - 8usize];
1014 ["Alignment of _duckdb_bind_info"][::std::mem::align_of::<_duckdb_bind_info>() - 8usize];
1015 ["Offset of field: _duckdb_bind_info::internal_ptr"]
1016 [::std::mem::offset_of!(_duckdb_bind_info, internal_ptr) - 0usize];
1017};
1018#[doc = "! The bind info of a function.\n! When setting this info, it is necessary to pass a destroy-callback function."]
1019pub type duckdb_bind_info = *mut _duckdb_bind_info;
1020#[doc = "! Additional function initialization info.\n! When setting this info, it is necessary to pass a destroy-callback function."]
1021#[repr(C)]
1022#[derive(Debug, Copy, Clone)]
1023pub struct _duckdb_init_info {
1024 pub internal_ptr: *mut ::std::os::raw::c_void,
1025}
1026#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1027const _: () = {
1028 ["Size of _duckdb_init_info"][::std::mem::size_of::<_duckdb_init_info>() - 8usize];
1029 ["Alignment of _duckdb_init_info"][::std::mem::align_of::<_duckdb_init_info>() - 8usize];
1030 ["Offset of field: _duckdb_init_info::internal_ptr"]
1031 [::std::mem::offset_of!(_duckdb_init_info, internal_ptr) - 0usize];
1032};
1033#[doc = "! Additional function initialization info.\n! When setting this info, it is necessary to pass a destroy-callback function."]
1034pub type duckdb_init_info = *mut _duckdb_init_info;
1035#[doc = "! A scalar function. Must be destroyed with `duckdb_destroy_scalar_function`."]
1036#[repr(C)]
1037#[derive(Debug, Copy, Clone)]
1038pub struct _duckdb_scalar_function {
1039 pub internal_ptr: *mut ::std::os::raw::c_void,
1040}
1041#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1042const _: () = {
1043 ["Size of _duckdb_scalar_function"][::std::mem::size_of::<_duckdb_scalar_function>() - 8usize];
1044 ["Alignment of _duckdb_scalar_function"]
1045 [::std::mem::align_of::<_duckdb_scalar_function>() - 8usize];
1046 ["Offset of field: _duckdb_scalar_function::internal_ptr"]
1047 [::std::mem::offset_of!(_duckdb_scalar_function, internal_ptr) - 0usize];
1048};
1049#[doc = "! A scalar function. Must be destroyed with `duckdb_destroy_scalar_function`."]
1050pub type duckdb_scalar_function = *mut _duckdb_scalar_function;
1051#[doc = "! A scalar function set. Must be destroyed with `duckdb_destroy_scalar_function_set`."]
1052#[repr(C)]
1053#[derive(Debug, Copy, Clone)]
1054pub struct _duckdb_scalar_function_set {
1055 pub internal_ptr: *mut ::std::os::raw::c_void,
1056}
1057#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1058const _: () = {
1059 ["Size of _duckdb_scalar_function_set"]
1060 [::std::mem::size_of::<_duckdb_scalar_function_set>() - 8usize];
1061 ["Alignment of _duckdb_scalar_function_set"]
1062 [::std::mem::align_of::<_duckdb_scalar_function_set>() - 8usize];
1063 ["Offset of field: _duckdb_scalar_function_set::internal_ptr"]
1064 [::std::mem::offset_of!(_duckdb_scalar_function_set, internal_ptr) - 0usize];
1065};
1066#[doc = "! A scalar function set. Must be destroyed with `duckdb_destroy_scalar_function_set`."]
1067pub type duckdb_scalar_function_set = *mut _duckdb_scalar_function_set;
1068#[doc = "! The bind function callback of the scalar function."]
1069pub type duckdb_scalar_function_bind_t =
1070 ::std::option::Option<unsafe extern "C" fn(info: duckdb_bind_info)>;
1071#[doc = "! The thread-local initialization function of the scalar function."]
1072pub type duckdb_scalar_function_init_t =
1073 ::std::option::Option<unsafe extern "C" fn(info: duckdb_init_info)>;
1074#[doc = "! The function to execute the scalar function on an input chunk."]
1075pub type duckdb_scalar_function_t = ::std::option::Option<
1076 unsafe extern "C" fn(
1077 info: duckdb_function_info,
1078 input: duckdb_data_chunk,
1079 output: duckdb_vector,
1080 ),
1081>;
1082#[doc = "! An aggregate function. Must be destroyed with `duckdb_destroy_aggregate_function`."]
1083#[repr(C)]
1084#[derive(Debug, Copy, Clone)]
1085pub struct _duckdb_aggregate_function {
1086 pub internal_ptr: *mut ::std::os::raw::c_void,
1087}
1088#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1089const _: () = {
1090 ["Size of _duckdb_aggregate_function"]
1091 [::std::mem::size_of::<_duckdb_aggregate_function>() - 8usize];
1092 ["Alignment of _duckdb_aggregate_function"]
1093 [::std::mem::align_of::<_duckdb_aggregate_function>() - 8usize];
1094 ["Offset of field: _duckdb_aggregate_function::internal_ptr"]
1095 [::std::mem::offset_of!(_duckdb_aggregate_function, internal_ptr) - 0usize];
1096};
1097#[doc = "! An aggregate function. Must be destroyed with `duckdb_destroy_aggregate_function`."]
1098pub type duckdb_aggregate_function = *mut _duckdb_aggregate_function;
1099#[doc = "! A aggregate function set. Must be destroyed with `duckdb_destroy_aggregate_function_set`."]
1100#[repr(C)]
1101#[derive(Debug, Copy, Clone)]
1102pub struct _duckdb_aggregate_function_set {
1103 pub internal_ptr: *mut ::std::os::raw::c_void,
1104}
1105#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1106const _: () = {
1107 ["Size of _duckdb_aggregate_function_set"]
1108 [::std::mem::size_of::<_duckdb_aggregate_function_set>() - 8usize];
1109 ["Alignment of _duckdb_aggregate_function_set"]
1110 [::std::mem::align_of::<_duckdb_aggregate_function_set>() - 8usize];
1111 ["Offset of field: _duckdb_aggregate_function_set::internal_ptr"]
1112 [::std::mem::offset_of!(_duckdb_aggregate_function_set, internal_ptr) - 0usize];
1113};
1114#[doc = "! A aggregate function set. Must be destroyed with `duckdb_destroy_aggregate_function_set`."]
1115pub type duckdb_aggregate_function_set = *mut _duckdb_aggregate_function_set;
1116#[doc = "! The state of an aggregate function."]
1117#[repr(C)]
1118#[derive(Debug, Copy, Clone)]
1119pub struct _duckdb_aggregate_state {
1120 pub internal_ptr: *mut ::std::os::raw::c_void,
1121}
1122#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1123const _: () = {
1124 ["Size of _duckdb_aggregate_state"][::std::mem::size_of::<_duckdb_aggregate_state>() - 8usize];
1125 ["Alignment of _duckdb_aggregate_state"]
1126 [::std::mem::align_of::<_duckdb_aggregate_state>() - 8usize];
1127 ["Offset of field: _duckdb_aggregate_state::internal_ptr"]
1128 [::std::mem::offset_of!(_duckdb_aggregate_state, internal_ptr) - 0usize];
1129};
1130#[doc = "! The state of an aggregate function."]
1131pub type duckdb_aggregate_state = *mut _duckdb_aggregate_state;
1132#[doc = "! A function to return the aggregate state's size."]
1133pub type duckdb_aggregate_state_size =
1134 ::std::option::Option<unsafe extern "C" fn(info: duckdb_function_info) -> idx_t>;
1135#[doc = "! A function to initialize an aggregate state."]
1136pub type duckdb_aggregate_init_t = ::std::option::Option<
1137 unsafe extern "C" fn(info: duckdb_function_info, state: duckdb_aggregate_state),
1138>;
1139#[doc = "! An optional function to destroy an aggregate state."]
1140pub type duckdb_aggregate_destroy_t =
1141 ::std::option::Option<unsafe extern "C" fn(states: *mut duckdb_aggregate_state, count: idx_t)>;
1142#[doc = "! A function to update a set of aggregate states with new values."]
1143pub type duckdb_aggregate_update_t = ::std::option::Option<
1144 unsafe extern "C" fn(
1145 info: duckdb_function_info,
1146 input: duckdb_data_chunk,
1147 states: *mut duckdb_aggregate_state,
1148 ),
1149>;
1150#[doc = "! A function to combine aggregate states."]
1151pub type duckdb_aggregate_combine_t = ::std::option::Option<
1152 unsafe extern "C" fn(
1153 info: duckdb_function_info,
1154 source: *mut duckdb_aggregate_state,
1155 target: *mut duckdb_aggregate_state,
1156 count: idx_t,
1157 ),
1158>;
1159#[doc = "! A function to finalize aggregate states into a result vector."]
1160pub type duckdb_aggregate_finalize_t = ::std::option::Option<
1161 unsafe extern "C" fn(
1162 info: duckdb_function_info,
1163 source: *mut duckdb_aggregate_state,
1164 result: duckdb_vector,
1165 count: idx_t,
1166 offset: idx_t,
1167 ),
1168>;
1169#[doc = "! A table function. Must be destroyed with `duckdb_destroy_table_function`."]
1170#[repr(C)]
1171#[derive(Debug, Copy, Clone)]
1172pub struct _duckdb_table_function {
1173 pub internal_ptr: *mut ::std::os::raw::c_void,
1174}
1175#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1176const _: () = {
1177 ["Size of _duckdb_table_function"][::std::mem::size_of::<_duckdb_table_function>() - 8usize];
1178 ["Alignment of _duckdb_table_function"]
1179 [::std::mem::align_of::<_duckdb_table_function>() - 8usize];
1180 ["Offset of field: _duckdb_table_function::internal_ptr"]
1181 [::std::mem::offset_of!(_duckdb_table_function, internal_ptr) - 0usize];
1182};
1183#[doc = "! A table function. Must be destroyed with `duckdb_destroy_table_function`."]
1184pub type duckdb_table_function = *mut _duckdb_table_function;
1185#[doc = "! The bind function of the table function."]
1186pub type duckdb_table_function_bind_t =
1187 ::std::option::Option<unsafe extern "C" fn(info: duckdb_bind_info)>;
1188#[doc = "! The possibly thread-local initialization function of the table function."]
1189pub type duckdb_table_function_init_t =
1190 ::std::option::Option<unsafe extern "C" fn(info: duckdb_init_info)>;
1191#[doc = "! The function to generate an output chunk during table function execution."]
1192pub type duckdb_table_function_t = ::std::option::Option<
1193 unsafe extern "C" fn(info: duckdb_function_info, output: duckdb_data_chunk),
1194>;
1195#[doc = "! A COPY function. Must be destroyed with `duckdb_destroy_copy_function`."]
1196#[repr(C)]
1197#[derive(Debug, Copy, Clone)]
1198pub struct _duckdb_copy_function {
1199 pub internal_ptr: *mut ::std::os::raw::c_void,
1200}
1201#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1202const _: () = {
1203 ["Size of _duckdb_copy_function"][::std::mem::size_of::<_duckdb_copy_function>() - 8usize];
1204 ["Alignment of _duckdb_copy_function"]
1205 [::std::mem::align_of::<_duckdb_copy_function>() - 8usize];
1206 ["Offset of field: _duckdb_copy_function::internal_ptr"]
1207 [::std::mem::offset_of!(_duckdb_copy_function, internal_ptr) - 0usize];
1208};
1209#[doc = "! A COPY function. Must be destroyed with `duckdb_destroy_copy_function`."]
1210pub type duckdb_copy_function = *mut _duckdb_copy_function;
1211#[doc = "! Info for the bind function of a COPY function."]
1212#[repr(C)]
1213#[derive(Debug, Copy, Clone)]
1214pub struct _duckdb_copy_function_bind_info {
1215 pub internal_ptr: *mut ::std::os::raw::c_void,
1216}
1217#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1218const _: () = {
1219 ["Size of _duckdb_copy_function_bind_info"]
1220 [::std::mem::size_of::<_duckdb_copy_function_bind_info>() - 8usize];
1221 ["Alignment of _duckdb_copy_function_bind_info"]
1222 [::std::mem::align_of::<_duckdb_copy_function_bind_info>() - 8usize];
1223 ["Offset of field: _duckdb_copy_function_bind_info::internal_ptr"]
1224 [::std::mem::offset_of!(_duckdb_copy_function_bind_info, internal_ptr) - 0usize];
1225};
1226#[doc = "! Info for the bind function of a COPY function."]
1227pub type duckdb_copy_function_bind_info = *mut _duckdb_copy_function_bind_info;
1228#[doc = "! Info for the global initialization function of a COPY function."]
1229#[repr(C)]
1230#[derive(Debug, Copy, Clone)]
1231pub struct _duckdb_copy_function_global_init_info {
1232 pub internal_ptr: *mut ::std::os::raw::c_void,
1233}
1234#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1235const _: () = {
1236 ["Size of _duckdb_copy_function_global_init_info"]
1237 [::std::mem::size_of::<_duckdb_copy_function_global_init_info>() - 8usize];
1238 ["Alignment of _duckdb_copy_function_global_init_info"]
1239 [::std::mem::align_of::<_duckdb_copy_function_global_init_info>() - 8usize];
1240 ["Offset of field: _duckdb_copy_function_global_init_info::internal_ptr"]
1241 [::std::mem::offset_of!(_duckdb_copy_function_global_init_info, internal_ptr) - 0usize];
1242};
1243#[doc = "! Info for the global initialization function of a COPY function."]
1244pub type duckdb_copy_function_global_init_info = *mut _duckdb_copy_function_global_init_info;
1245#[doc = "! Info for the sink function of a COPY function."]
1246#[repr(C)]
1247#[derive(Debug, Copy, Clone)]
1248pub struct _duckdb_copy_function_sink_info {
1249 pub internal_ptr: *mut ::std::os::raw::c_void,
1250}
1251#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1252const _: () = {
1253 ["Size of _duckdb_copy_function_sink_info"]
1254 [::std::mem::size_of::<_duckdb_copy_function_sink_info>() - 8usize];
1255 ["Alignment of _duckdb_copy_function_sink_info"]
1256 [::std::mem::align_of::<_duckdb_copy_function_sink_info>() - 8usize];
1257 ["Offset of field: _duckdb_copy_function_sink_info::internal_ptr"]
1258 [::std::mem::offset_of!(_duckdb_copy_function_sink_info, internal_ptr) - 0usize];
1259};
1260#[doc = "! Info for the sink function of a COPY function."]
1261pub type duckdb_copy_function_sink_info = *mut _duckdb_copy_function_sink_info;
1262#[doc = "! Info for the finalize function of a COPY function."]
1263#[repr(C)]
1264#[derive(Debug, Copy, Clone)]
1265pub struct _duckdb_copy_function_finalize_info {
1266 pub internal_ptr: *mut ::std::os::raw::c_void,
1267}
1268#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1269const _: () = {
1270 ["Size of _duckdb_copy_function_finalize_info"]
1271 [::std::mem::size_of::<_duckdb_copy_function_finalize_info>() - 8usize];
1272 ["Alignment of _duckdb_copy_function_finalize_info"]
1273 [::std::mem::align_of::<_duckdb_copy_function_finalize_info>() - 8usize];
1274 ["Offset of field: _duckdb_copy_function_finalize_info::internal_ptr"]
1275 [::std::mem::offset_of!(_duckdb_copy_function_finalize_info, internal_ptr) - 0usize];
1276};
1277#[doc = "! Info for the finalize function of a COPY function."]
1278pub type duckdb_copy_function_finalize_info = *mut _duckdb_copy_function_finalize_info;
1279#[doc = "! The bind function to use when binding a COPY ... TO function."]
1280pub type duckdb_copy_function_bind_t =
1281 ::std::option::Option<unsafe extern "C" fn(info: duckdb_copy_function_bind_info)>;
1282#[doc = "! The initialization function to use when initializing a COPY ... TO function."]
1283pub type duckdb_copy_function_global_init_t =
1284 ::std::option::Option<unsafe extern "C" fn(info: duckdb_copy_function_global_init_info)>;
1285#[doc = "! The function to sink an input chunk into during execution of a COPY ... TO function."]
1286pub type duckdb_copy_function_sink_t = ::std::option::Option<
1287 unsafe extern "C" fn(info: duckdb_copy_function_sink_info, input: duckdb_data_chunk),
1288>;
1289#[doc = "! The function to finalize the COPY ... TO function execution."]
1290pub type duckdb_copy_function_finalize_t =
1291 ::std::option::Option<unsafe extern "C" fn(info: duckdb_copy_function_finalize_info)>;
1292#[doc = "! A cast function. Must be destroyed with `duckdb_destroy_cast_function`."]
1293#[repr(C)]
1294#[derive(Debug, Copy, Clone)]
1295pub struct _duckdb_cast_function {
1296 pub internal_ptr: *mut ::std::os::raw::c_void,
1297}
1298#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1299const _: () = {
1300 ["Size of _duckdb_cast_function"][::std::mem::size_of::<_duckdb_cast_function>() - 8usize];
1301 ["Alignment of _duckdb_cast_function"]
1302 [::std::mem::align_of::<_duckdb_cast_function>() - 8usize];
1303 ["Offset of field: _duckdb_cast_function::internal_ptr"]
1304 [::std::mem::offset_of!(_duckdb_cast_function, internal_ptr) - 0usize];
1305};
1306#[doc = "! A cast function. Must be destroyed with `duckdb_destroy_cast_function`."]
1307pub type duckdb_cast_function = *mut _duckdb_cast_function;
1308#[doc = "! The function to cast from an input vector to an output vector."]
1309pub type duckdb_cast_function_t = ::std::option::Option<
1310 unsafe extern "C" fn(
1311 info: duckdb_function_info,
1312 count: idx_t,
1313 input: duckdb_vector,
1314 output: duckdb_vector,
1315 ) -> bool,
1316>;
1317#[doc = "! Additional replacement scan info. When setting this info, it is necessary to pass a destroy-callback function."]
1318#[repr(C)]
1319#[derive(Debug, Copy, Clone)]
1320pub struct _duckdb_replacement_scan_info {
1321 pub internal_ptr: *mut ::std::os::raw::c_void,
1322}
1323#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1324const _: () = {
1325 ["Size of _duckdb_replacement_scan_info"]
1326 [::std::mem::size_of::<_duckdb_replacement_scan_info>() - 8usize];
1327 ["Alignment of _duckdb_replacement_scan_info"]
1328 [::std::mem::align_of::<_duckdb_replacement_scan_info>() - 8usize];
1329 ["Offset of field: _duckdb_replacement_scan_info::internal_ptr"]
1330 [::std::mem::offset_of!(_duckdb_replacement_scan_info, internal_ptr) - 0usize];
1331};
1332#[doc = "! Additional replacement scan info. When setting this info, it is necessary to pass a destroy-callback function."]
1333pub type duckdb_replacement_scan_info = *mut _duckdb_replacement_scan_info;
1334#[doc = "! A replacement scan function."]
1335pub type duckdb_replacement_callback_t = ::std::option::Option<
1336 unsafe extern "C" fn(
1337 info: duckdb_replacement_scan_info,
1338 table_name: *const ::std::os::raw::c_char,
1339 data: *mut ::std::os::raw::c_void,
1340 ),
1341>;
1342#[doc = "! Forward declare Arrow structs\n! It is important to notice that these structs are not defined by DuckDB but are actually Arrow external objects.\n! They're defined by the C Data Interface Arrow spec: https://arrow.apache.org/docs/format/CDataInterface.html"]
1343#[repr(C)]
1344#[derive(Debug, Copy, Clone)]
1345pub struct ArrowArray {
1346 _unused: [u8; 0],
1347}
1348#[repr(C)]
1349#[derive(Debug, Copy, Clone)]
1350pub struct ArrowSchema {
1351 _unused: [u8; 0],
1352}
1353#[doc = "! Holds an arrow query result. Must be destroyed with `duckdb_destroy_arrow`."]
1354#[repr(C)]
1355#[derive(Debug, Copy, Clone)]
1356pub struct _duckdb_arrow {
1357 pub internal_ptr: *mut ::std::os::raw::c_void,
1358}
1359#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1360const _: () = {
1361 ["Size of _duckdb_arrow"][::std::mem::size_of::<_duckdb_arrow>() - 8usize];
1362 ["Alignment of _duckdb_arrow"][::std::mem::align_of::<_duckdb_arrow>() - 8usize];
1363 ["Offset of field: _duckdb_arrow::internal_ptr"]
1364 [::std::mem::offset_of!(_duckdb_arrow, internal_ptr) - 0usize];
1365};
1366#[doc = "! Holds an arrow query result. Must be destroyed with `duckdb_destroy_arrow`."]
1367pub type duckdb_arrow = *mut _duckdb_arrow;
1368#[doc = "! Holds an arrow array stream. Must be destroyed with `duckdb_destroy_arrow_stream`."]
1369#[repr(C)]
1370#[derive(Debug, Copy, Clone)]
1371pub struct _duckdb_arrow_stream {
1372 pub internal_ptr: *mut ::std::os::raw::c_void,
1373}
1374#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1375const _: () = {
1376 ["Size of _duckdb_arrow_stream"][::std::mem::size_of::<_duckdb_arrow_stream>() - 8usize];
1377 ["Alignment of _duckdb_arrow_stream"][::std::mem::align_of::<_duckdb_arrow_stream>() - 8usize];
1378 ["Offset of field: _duckdb_arrow_stream::internal_ptr"]
1379 [::std::mem::offset_of!(_duckdb_arrow_stream, internal_ptr) - 0usize];
1380};
1381#[doc = "! Holds an arrow array stream. Must be destroyed with `duckdb_destroy_arrow_stream`."]
1382pub type duckdb_arrow_stream = *mut _duckdb_arrow_stream;
1383#[doc = "! Holds an arrow schema. Remember to release the respective ArrowSchema object."]
1384#[repr(C)]
1385#[derive(Debug, Copy, Clone)]
1386pub struct _duckdb_arrow_schema {
1387 pub internal_ptr: *mut ::std::os::raw::c_void,
1388}
1389#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1390const _: () = {
1391 ["Size of _duckdb_arrow_schema"][::std::mem::size_of::<_duckdb_arrow_schema>() - 8usize];
1392 ["Alignment of _duckdb_arrow_schema"][::std::mem::align_of::<_duckdb_arrow_schema>() - 8usize];
1393 ["Offset of field: _duckdb_arrow_schema::internal_ptr"]
1394 [::std::mem::offset_of!(_duckdb_arrow_schema, internal_ptr) - 0usize];
1395};
1396#[doc = "! Holds an arrow schema. Remember to release the respective ArrowSchema object."]
1397pub type duckdb_arrow_schema = *mut _duckdb_arrow_schema;
1398#[doc = "! Holds an arrow converted schema (i.e., duckdb::ArrowTableSchema).\n! In practice, this object holds the information necessary to do proper conversion between Arrow Types and DuckDB\n! Types. Check duckdb/function/table/arrow/arrow_duck_schema.hpp for more details! Must be destroyed with\n! `duckdb_destroy_arrow_converted_schema`"]
1399#[repr(C)]
1400#[derive(Debug, Copy, Clone)]
1401pub struct _duckdb_arrow_converted_schema {
1402 pub internal_ptr: *mut ::std::os::raw::c_void,
1403}
1404#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1405const _: () = {
1406 ["Size of _duckdb_arrow_converted_schema"]
1407 [::std::mem::size_of::<_duckdb_arrow_converted_schema>() - 8usize];
1408 ["Alignment of _duckdb_arrow_converted_schema"]
1409 [::std::mem::align_of::<_duckdb_arrow_converted_schema>() - 8usize];
1410 ["Offset of field: _duckdb_arrow_converted_schema::internal_ptr"]
1411 [::std::mem::offset_of!(_duckdb_arrow_converted_schema, internal_ptr) - 0usize];
1412};
1413#[doc = "! Holds an arrow converted schema (i.e., duckdb::ArrowTableSchema).\n! In practice, this object holds the information necessary to do proper conversion between Arrow Types and DuckDB\n! Types. Check duckdb/function/table/arrow/arrow_duck_schema.hpp for more details! Must be destroyed with\n! `duckdb_destroy_arrow_converted_schema`"]
1414pub type duckdb_arrow_converted_schema = *mut _duckdb_arrow_converted_schema;
1415#[doc = "! Holds an arrow array. Remember to release the respective ArrowSchema object."]
1416#[repr(C)]
1417#[derive(Debug, Copy, Clone)]
1418pub struct _duckdb_arrow_array {
1419 pub internal_ptr: *mut ::std::os::raw::c_void,
1420}
1421#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1422const _: () = {
1423 ["Size of _duckdb_arrow_array"][::std::mem::size_of::<_duckdb_arrow_array>() - 8usize];
1424 ["Alignment of _duckdb_arrow_array"][::std::mem::align_of::<_duckdb_arrow_array>() - 8usize];
1425 ["Offset of field: _duckdb_arrow_array::internal_ptr"]
1426 [::std::mem::offset_of!(_duckdb_arrow_array, internal_ptr) - 0usize];
1427};
1428#[doc = "! Holds an arrow array. Remember to release the respective ArrowSchema object."]
1429pub type duckdb_arrow_array = *mut _duckdb_arrow_array;
1430#[doc = "! The arrow options used when transforming the DuckDB schema and datachunks into Arrow schema and arrays.\n! Used in `duckdb_to_arrow_schema` and `duckdb_data_chunk_to_arrow`"]
1431#[repr(C)]
1432#[derive(Debug, Copy, Clone)]
1433pub struct _duckdb_arrow_options {
1434 pub internal_ptr: *mut ::std::os::raw::c_void,
1435}
1436#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1437const _: () = {
1438 ["Size of _duckdb_arrow_options"][::std::mem::size_of::<_duckdb_arrow_options>() - 8usize];
1439 ["Alignment of _duckdb_arrow_options"]
1440 [::std::mem::align_of::<_duckdb_arrow_options>() - 8usize];
1441 ["Offset of field: _duckdb_arrow_options::internal_ptr"]
1442 [::std::mem::offset_of!(_duckdb_arrow_options, internal_ptr) - 0usize];
1443};
1444#[doc = "! The arrow options used when transforming the DuckDB schema and datachunks into Arrow schema and arrays.\n! Used in `duckdb_to_arrow_schema` and `duckdb_data_chunk_to_arrow`"]
1445pub type duckdb_arrow_options = *mut _duckdb_arrow_options;
1446#[repr(C)]
1447#[derive(Debug, Copy, Clone)]
1448pub struct _duckdb_file_open_options {
1449 pub internal_ptr: *mut ::std::os::raw::c_void,
1450}
1451#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1452const _: () = {
1453 ["Size of _duckdb_file_open_options"]
1454 [::std::mem::size_of::<_duckdb_file_open_options>() - 8usize];
1455 ["Alignment of _duckdb_file_open_options"]
1456 [::std::mem::align_of::<_duckdb_file_open_options>() - 8usize];
1457 ["Offset of field: _duckdb_file_open_options::internal_ptr"]
1458 [::std::mem::offset_of!(_duckdb_file_open_options, internal_ptr) - 0usize];
1459};
1460pub type duckdb_file_open_options = *mut _duckdb_file_open_options;
1461#[repr(C)]
1462#[derive(Debug, Copy, Clone)]
1463pub struct _duckdb_file_system {
1464 pub internal_ptr: *mut ::std::os::raw::c_void,
1465}
1466#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1467const _: () = {
1468 ["Size of _duckdb_file_system"][::std::mem::size_of::<_duckdb_file_system>() - 8usize];
1469 ["Alignment of _duckdb_file_system"][::std::mem::align_of::<_duckdb_file_system>() - 8usize];
1470 ["Offset of field: _duckdb_file_system::internal_ptr"]
1471 [::std::mem::offset_of!(_duckdb_file_system, internal_ptr) - 0usize];
1472};
1473pub type duckdb_file_system = *mut _duckdb_file_system;
1474#[repr(C)]
1475#[derive(Debug, Copy, Clone)]
1476pub struct _duckdb_file_handle {
1477 pub internal_ptr: *mut ::std::os::raw::c_void,
1478}
1479#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1480const _: () = {
1481 ["Size of _duckdb_file_handle"][::std::mem::size_of::<_duckdb_file_handle>() - 8usize];
1482 ["Alignment of _duckdb_file_handle"][::std::mem::align_of::<_duckdb_file_handle>() - 8usize];
1483 ["Offset of field: _duckdb_file_handle::internal_ptr"]
1484 [::std::mem::offset_of!(_duckdb_file_handle, internal_ptr) - 0usize];
1485};
1486pub type duckdb_file_handle = *mut _duckdb_file_handle;
1487#[doc = "! A handle to a database catalog.\n! Must be destroyed with `duckdb_destroy_catalog`."]
1488#[repr(C)]
1489#[derive(Debug, Copy, Clone)]
1490pub struct _duckdb_catalog {
1491 pub internal_ptr: *mut ::std::os::raw::c_void,
1492}
1493#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1494const _: () = {
1495 ["Size of _duckdb_catalog"][::std::mem::size_of::<_duckdb_catalog>() - 8usize];
1496 ["Alignment of _duckdb_catalog"][::std::mem::align_of::<_duckdb_catalog>() - 8usize];
1497 ["Offset of field: _duckdb_catalog::internal_ptr"]
1498 [::std::mem::offset_of!(_duckdb_catalog, internal_ptr) - 0usize];
1499};
1500#[doc = "! A handle to a database catalog.\n! Must be destroyed with `duckdb_destroy_catalog`."]
1501pub type duckdb_catalog = *mut _duckdb_catalog;
1502#[doc = "! A handle to a catalog entry (e.g., table, view, index, etc.).\n! Must be destroyed with `duckdb_destroy_catalog_entry`."]
1503#[repr(C)]
1504#[derive(Debug, Copy, Clone)]
1505pub struct _duckdb_catalog_entry {
1506 pub internal_ptr: *mut ::std::os::raw::c_void,
1507}
1508#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1509const _: () = {
1510 ["Size of _duckdb_catalog_entry"][::std::mem::size_of::<_duckdb_catalog_entry>() - 8usize];
1511 ["Alignment of _duckdb_catalog_entry"]
1512 [::std::mem::align_of::<_duckdb_catalog_entry>() - 8usize];
1513 ["Offset of field: _duckdb_catalog_entry::internal_ptr"]
1514 [::std::mem::offset_of!(_duckdb_catalog_entry, internal_ptr) - 0usize];
1515};
1516#[doc = "! A handle to a catalog entry (e.g., table, view, index, etc.).\n! Must be destroyed with `duckdb_destroy_catalog_entry`."]
1517pub type duckdb_catalog_entry = *mut _duckdb_catalog_entry;
1518#[doc = "! Holds a log storage object."]
1519#[repr(C)]
1520#[derive(Debug, Copy, Clone)]
1521pub struct _duckdb_log_storage {
1522 pub internal_ptr: *mut ::std::os::raw::c_void,
1523}
1524#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1525const _: () = {
1526 ["Size of _duckdb_log_storage"][::std::mem::size_of::<_duckdb_log_storage>() - 8usize];
1527 ["Alignment of _duckdb_log_storage"][::std::mem::align_of::<_duckdb_log_storage>() - 8usize];
1528 ["Offset of field: _duckdb_log_storage::internal_ptr"]
1529 [::std::mem::offset_of!(_duckdb_log_storage, internal_ptr) - 0usize];
1530};
1531#[doc = "! Holds a log storage object."]
1532pub type duckdb_log_storage = *mut _duckdb_log_storage;
1533#[doc = "! This function is missing the logging context, which will be added later."]
1534pub type duckdb_logger_write_log_entry_t = ::std::option::Option<
1535 unsafe extern "C" fn(
1536 extra_data: *mut ::std::os::raw::c_void,
1537 timestamp: *mut duckdb_timestamp,
1538 level: *const ::std::os::raw::c_char,
1539 log_type: *const ::std::os::raw::c_char,
1540 log_message: *const ::std::os::raw::c_char,
1541 ),
1542>;
1543#[doc = "! Passed to C API extension as a parameter to the entrypoint."]
1544#[repr(C)]
1545#[derive(Debug, Copy, Clone)]
1546pub struct duckdb_extension_access {
1547 #[doc = "! Indicate that an error has occurred."]
1548 pub set_error: ::std::option::Option<
1549 unsafe extern "C" fn(info: duckdb_extension_info, error: *const ::std::os::raw::c_char),
1550 >,
1551 #[doc = "! Fetch the database on which to register the extension."]
1552 pub get_database: ::std::option::Option<
1553 unsafe extern "C" fn(info: duckdb_extension_info) -> *mut duckdb_database,
1554 >,
1555 #[doc = "! Fetch the API struct pointer."]
1556 pub get_api: ::std::option::Option<
1557 unsafe extern "C" fn(
1558 info: duckdb_extension_info,
1559 version: *const ::std::os::raw::c_char,
1560 ) -> *const ::std::os::raw::c_void,
1561 >,
1562}
1563#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1564const _: () = {
1565 ["Size of duckdb_extension_access"][::std::mem::size_of::<duckdb_extension_access>() - 24usize];
1566 ["Alignment of duckdb_extension_access"]
1567 [::std::mem::align_of::<duckdb_extension_access>() - 8usize];
1568 ["Offset of field: duckdb_extension_access::set_error"]
1569 [::std::mem::offset_of!(duckdb_extension_access, set_error) - 0usize];
1570 ["Offset of field: duckdb_extension_access::get_database"]
1571 [::std::mem::offset_of!(duckdb_extension_access, get_database) - 8usize];
1572 ["Offset of field: duckdb_extension_access::get_api"]
1573 [::std::mem::offset_of!(duckdb_extension_access, get_api) - 16usize];
1574};
1575unsafe extern "C" {
1576 #[doc = "Creates a new database instance cache.\nThe instance cache is necessary if a client/program (re)opens multiple databases to the same file within the same\nprocess. Must be destroyed with 'duckdb_destroy_instance_cache'.\n\n @return The database instance cache."]
1577 pub fn duckdb_create_instance_cache() -> duckdb_instance_cache;
1578}
1579unsafe extern "C" {
1580 #[doc = "Creates a new database instance in the instance cache, or retrieves an existing database instance.\nMust be closed with 'duckdb_close'.\n\n @param instance_cache The instance cache in which to create the database, or from which to take the database.\n @param path Path to the database file on disk. Both `nullptr` and `:memory:` open or retrieve an in-memory database.\n @param out_database The resulting cached database.\n @param config (Optional) configuration used to create the database.\n @param out_error If set and the function returns `DuckDBError`, this contains the error message.\nNote that the error message must be freed using `duckdb_free`.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
1581 pub fn duckdb_get_or_create_from_cache(
1582 instance_cache: duckdb_instance_cache,
1583 path: *const ::std::os::raw::c_char,
1584 out_database: *mut duckdb_database,
1585 config: duckdb_config,
1586 out_error: *mut *mut ::std::os::raw::c_char,
1587 ) -> duckdb_state;
1588}
1589unsafe extern "C" {
1590 #[doc = "Destroys an existing database instance cache and de-allocates its memory.\n\n @param instance_cache The instance cache to destroy."]
1591 pub fn duckdb_destroy_instance_cache(instance_cache: *mut duckdb_instance_cache);
1592}
1593unsafe extern "C" {
1594 #[doc = "Creates a new database or opens an existing database file stored at the given path.\nIf no path is given a new in-memory database is created instead.\nThe database must be closed with 'duckdb_close'.\n\n @param path Path to the database file on disk. Both `nullptr` and `:memory:` open an in-memory database.\n @param out_database The result database object.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
1595 pub fn duckdb_open(
1596 path: *const ::std::os::raw::c_char,
1597 out_database: *mut duckdb_database,
1598 ) -> duckdb_state;
1599}
1600unsafe extern "C" {
1601 #[doc = "Extended version of duckdb_open. Creates a new database or opens an existing database file stored at the given path.\nThe database must be closed with 'duckdb_close'.\n\n @param path Path to the database file on disk. Both `nullptr` and `:memory:` open an in-memory database.\n @param out_database The result database object.\n @param config (Optional) configuration used to start up the database.\n @param out_error If set and the function returns `DuckDBError`, this contains the error message.\nNote that the error message must be freed using `duckdb_free`.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
1602 pub fn duckdb_open_ext(
1603 path: *const ::std::os::raw::c_char,
1604 out_database: *mut duckdb_database,
1605 config: duckdb_config,
1606 out_error: *mut *mut ::std::os::raw::c_char,
1607 ) -> duckdb_state;
1608}
1609unsafe extern "C" {
1610 #[doc = "Closes the specified database and de-allocates all memory allocated for that database.\nThis should be called after you are done with any database allocated through `duckdb_open` or `duckdb_open_ext`.\nNote that failing to call `duckdb_close` (in case of e.g. a program crash) will not cause data corruption.\nStill, it is recommended to always correctly close a database object after you are done with it.\n\n @param database The database object to shut down."]
1611 pub fn duckdb_close(database: *mut duckdb_database);
1612}
1613unsafe extern "C" {
1614 #[doc = "Opens a connection to a database. Connections are required to query the database, and store transactional state\nassociated with the connection.\nThe instantiated connection should be closed using 'duckdb_disconnect'.\n\n @param database The database file to connect to.\n @param out_connection The result connection object.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
1615 pub fn duckdb_connect(
1616 database: duckdb_database,
1617 out_connection: *mut duckdb_connection,
1618 ) -> duckdb_state;
1619}
1620unsafe extern "C" {
1621 #[doc = "Interrupt running query\n\n @param connection The connection to interrupt"]
1622 pub fn duckdb_interrupt(connection: duckdb_connection);
1623}
1624unsafe extern "C" {
1625 #[doc = "Get the progress of the running query.\n\n @param connection The connection running the query.\n @return The query progress type containing progress information."]
1626 pub fn duckdb_query_progress(connection: duckdb_connection) -> duckdb_query_progress_type;
1627}
1628unsafe extern "C" {
1629 #[doc = "Closes the specified connection and de-allocates all memory allocated for that connection.\n\n @param connection The connection to close."]
1630 pub fn duckdb_disconnect(connection: *mut duckdb_connection);
1631}
1632unsafe extern "C" {
1633 #[doc = "Retrieves the client context of the connection.\n\n @param connection The connection.\n @param out_context The client context of the connection. Must be destroyed with `duckdb_destroy_client_context`."]
1634 pub fn duckdb_connection_get_client_context(
1635 connection: duckdb_connection,
1636 out_context: *mut duckdb_client_context,
1637 );
1638}
1639unsafe extern "C" {
1640 #[doc = "Retrieves the arrow options of the connection.\n\n @param connection The connection."]
1641 pub fn duckdb_connection_get_arrow_options(
1642 connection: duckdb_connection,
1643 out_arrow_options: *mut duckdb_arrow_options,
1644 );
1645}
1646unsafe extern "C" {
1647 #[doc = "Returns the connection id of the client context.\n\n @param context The client context.\n @return The connection id of the client context."]
1648 pub fn duckdb_client_context_get_connection_id(context: duckdb_client_context) -> idx_t;
1649}
1650unsafe extern "C" {
1651 #[doc = "Destroys the client context and deallocates its memory.\n\n @param context The client context to destroy."]
1652 pub fn duckdb_destroy_client_context(context: *mut duckdb_client_context);
1653}
1654unsafe extern "C" {
1655 #[doc = "Destroys the arrow options and deallocates its memory.\n\n @param arrow_options The arrow options to destroy."]
1656 pub fn duckdb_destroy_arrow_options(arrow_options: *mut duckdb_arrow_options);
1657}
1658unsafe extern "C" {
1659 #[doc = "Returns the version of the linked DuckDB, with a version postfix for dev versions\n\nUsually used for developing C extensions that must return this for a compatibility check."]
1660 pub fn duckdb_library_version() -> *const ::std::os::raw::c_char;
1661}
1662unsafe extern "C" {
1663 #[doc = "Get the list of (fully qualified) table names of the query.\n\n @param connection The connection for which to get the table names.\n @param query The query for which to get the table names.\n @param qualified Returns fully qualified table names (catalog.schema.table), if set to true, else only the (not\nescaped) table names.\n @return A duckdb_value of type VARCHAR[] containing the (fully qualified) table names of the query. Must be destroyed\nwith duckdb_destroy_value."]
1664 pub fn duckdb_get_table_names(
1665 connection: duckdb_connection,
1666 query: *const ::std::os::raw::c_char,
1667 qualified: bool,
1668 ) -> duckdb_value;
1669}
1670unsafe extern "C" {
1671 #[doc = "Initializes an empty configuration object that can be used to provide start-up options for the DuckDB instance\nthrough `duckdb_open_ext`.\nThe duckdb_config must be destroyed using 'duckdb_destroy_config'\n\nThis will always succeed unless there is a malloc failure.\n\nNote that `duckdb_destroy_config` should always be called on the resulting config, even if the function returns\n`DuckDBError`.\n\n @param out_config The result configuration object.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
1672 pub fn duckdb_create_config(out_config: *mut duckdb_config) -> duckdb_state;
1673}
1674unsafe extern "C" {
1675 #[doc = "This returns the total amount of configuration options available for usage with `duckdb_get_config_flag`.\n\nThis should not be called in a loop as it internally loops over all the options.\n\n @return The amount of config options available."]
1676 pub fn duckdb_config_count() -> usize;
1677}
1678unsafe extern "C" {
1679 #[doc = "Obtains a human-readable name and description of a specific configuration option. This can be used to e.g.\ndisplay configuration options. This will succeed unless `index` is out of range (i.e. `>= duckdb_config_count`).\n\nThe result name or description MUST NOT be freed.\n\n @param index The index of the configuration option (between 0 and `duckdb_config_count`)\n @param out_name A name of the configuration flag.\n @param out_description A description of the configuration flag.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
1680 pub fn duckdb_get_config_flag(
1681 index: usize,
1682 out_name: *mut *const ::std::os::raw::c_char,
1683 out_description: *mut *const ::std::os::raw::c_char,
1684 ) -> duckdb_state;
1685}
1686unsafe extern "C" {
1687 #[doc = "Sets the specified option for the specified configuration. The configuration option is indicated by name.\nTo obtain a list of config options, see `duckdb_get_config_flag`.\n\nIn the source code, configuration options are defined in `config.cpp`.\n\nThis can fail if either the name is invalid, or if the value provided for the option is invalid.\n\n @param config The configuration object to set the option on.\n @param name The name of the configuration flag to set.\n @param option The value to set the configuration flag to.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
1688 pub fn duckdb_set_config(
1689 config: duckdb_config,
1690 name: *const ::std::os::raw::c_char,
1691 option: *const ::std::os::raw::c_char,
1692 ) -> duckdb_state;
1693}
1694unsafe extern "C" {
1695 #[doc = "Destroys the specified configuration object and de-allocates all memory allocated for the object.\n\n @param config The configuration object to destroy."]
1696 pub fn duckdb_destroy_config(config: *mut duckdb_config);
1697}
1698unsafe extern "C" {
1699 #[doc = "Creates duckdb_error_data.\nMust be destroyed with `duckdb_destroy_error_data`.\n\n @param type The error type.\n @param message The error message.\n @return The error data."]
1700 pub fn duckdb_create_error_data(
1701 type_: duckdb_error_type,
1702 message: *const ::std::os::raw::c_char,
1703 ) -> duckdb_error_data;
1704}
1705unsafe extern "C" {
1706 #[doc = "Destroys the error data and deallocates its memory.\n\n @param error_data The error data to destroy."]
1707 pub fn duckdb_destroy_error_data(error_data: *mut duckdb_error_data);
1708}
1709unsafe extern "C" {
1710 #[doc = "Returns the duckdb_error_type of the error data.\n\n @param error_data The error data.\n @return The error type."]
1711 pub fn duckdb_error_data_error_type(error_data: duckdb_error_data) -> duckdb_error_type;
1712}
1713unsafe extern "C" {
1714 #[doc = "Returns the error message of the error data. Must not be freed.\n\n @param error_data The error data.\n @return The error message."]
1715 pub fn duckdb_error_data_message(
1716 error_data: duckdb_error_data
1717 ) -> *const ::std::os::raw::c_char;
1718}
1719unsafe extern "C" {
1720 #[doc = "Returns whether the error data contains an error or not.\n\n @param error_data The error data.\n @return True, if the error data contains an exception, else false."]
1721 pub fn duckdb_error_data_has_error(error_data: duckdb_error_data) -> bool;
1722}
1723unsafe extern "C" {
1724 #[doc = "Executes a SQL query within a connection and stores the full (materialized) result in the out_result pointer.\nIf the query fails to execute, DuckDBError is returned and the error message can be retrieved by calling\n`duckdb_result_error`.\n\nNote that after running `duckdb_query`, `duckdb_destroy_result` must be called on the result object even if the\nquery fails, otherwise the error stored within the result will not be freed correctly.\n\n @param connection The connection to perform the query in.\n @param query The SQL query to run.\n @param out_result The query result.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
1725 pub fn duckdb_query(
1726 connection: duckdb_connection,
1727 query: *const ::std::os::raw::c_char,
1728 out_result: *mut duckdb_result,
1729 ) -> duckdb_state;
1730}
1731unsafe extern "C" {
1732 #[doc = "Closes the result and de-allocates all memory allocated for that result.\n\n @param result The result to destroy."]
1733 pub fn duckdb_destroy_result(result: *mut duckdb_result);
1734}
1735unsafe extern "C" {
1736 #[doc = "Returns the column name of the specified column. The result should not need to be freed; the column names will\nautomatically be destroyed when the result is destroyed.\n\nReturns `NULL` if the column is out of range.\n\n @param result The result object to fetch the column name from.\n @param col The column index.\n @return The column name of the specified column."]
1737 pub fn duckdb_column_name(
1738 result: *mut duckdb_result,
1739 col: idx_t,
1740 ) -> *const ::std::os::raw::c_char;
1741}
1742unsafe extern "C" {
1743 #[doc = "Returns the column type of the specified column.\n\nReturns `DUCKDB_TYPE_INVALID` if the column is out of range.\n\n @param result The result object to fetch the column type from.\n @param col The column index.\n @return The column type of the specified column."]
1744 pub fn duckdb_column_type(
1745 result: *mut duckdb_result,
1746 col: idx_t,
1747 ) -> duckdb_type;
1748}
1749unsafe extern "C" {
1750 #[doc = "Returns the statement type of the statement that was executed\n\n @param result The result object to fetch the statement type from.\n @return duckdb_statement_type value or DUCKDB_STATEMENT_TYPE_INVALID"]
1751 pub fn duckdb_result_statement_type(result: duckdb_result) -> duckdb_statement_type;
1752}
1753unsafe extern "C" {
1754 #[doc = "Returns the logical column type of the specified column.\n\nThe return type of this call should be destroyed with `duckdb_destroy_logical_type`.\n\nReturns `NULL` if the column is out of range.\n\n @param result The result object to fetch the column type from.\n @param col The column index.\n @return The logical column type of the specified column."]
1755 pub fn duckdb_column_logical_type(
1756 result: *mut duckdb_result,
1757 col: idx_t,
1758 ) -> duckdb_logical_type;
1759}
1760unsafe extern "C" {
1761 #[doc = "Returns the arrow options associated with the given result. These options are definitions of how the arrow arrays/schema\nshould be produced.\n @param result The result object to fetch arrow options from.\n @return The arrow options associated with the given result. This must be destroyed with\n`duckdb_destroy_arrow_options`."]
1762 pub fn duckdb_result_get_arrow_options(result: *mut duckdb_result) -> duckdb_arrow_options;
1763}
1764unsafe extern "C" {
1765 #[doc = "Returns the number of columns present in a the result object.\n\n @param result The result object.\n @return The number of columns present in the result object."]
1766 pub fn duckdb_column_count(result: *mut duckdb_result) -> idx_t;
1767}
1768unsafe extern "C" {
1769 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nReturns the number of rows present in the result object.\n\n @param result The result object.\n @return The number of rows present in the result object."]
1770 pub fn duckdb_row_count(result: *mut duckdb_result) -> idx_t;
1771}
1772unsafe extern "C" {
1773 #[doc = "Returns the number of rows changed by the query stored in the result. This is relevant only for INSERT/UPDATE/DELETE\nqueries. For other queries the rows_changed will be 0.\n\n @param result The result object.\n @return The number of rows changed."]
1774 pub fn duckdb_rows_changed(result: *mut duckdb_result) -> idx_t;
1775}
1776unsafe extern "C" {
1777 #[doc = "DEPRECATED**: Prefer using `duckdb_result_get_chunk` instead.\n\nReturns the data of a specific column of a result in columnar format.\n\nThe function returns a dense array which contains the result data. The exact type stored in the array depends on the\ncorresponding duckdb_type (as provided by `duckdb_column_type`). For the exact type by which the data should be\naccessed, see the comments in [the types section](types) or the `DUCKDB_TYPE` enum.\n\nFor example, for a column of type `DUCKDB_TYPE_INTEGER`, rows can be accessed in the following manner:\n```c\nint32_t *data = (int32_t *) duckdb_column_data(&result, 0);\nprintf(\"Data for row %d: %d\\n\", row, data[row]);\n```\n\n @param result The result object to fetch the column data from.\n @param col The column index.\n @return The column data of the specified column."]
1778 pub fn duckdb_column_data(
1779 result: *mut duckdb_result,
1780 col: idx_t,
1781 ) -> *mut ::std::os::raw::c_void;
1782}
1783unsafe extern "C" {
1784 #[doc = "DEPRECATED**: Prefer using `duckdb_result_get_chunk` instead.\n\nReturns the nullmask of a specific column of a result in columnar format. The nullmask indicates for every row\nwhether or not the corresponding row is `NULL`. If a row is `NULL`, the values present in the array provided\nby `duckdb_column_data` are undefined.\n\n```c\nint32_t *data = (int32_t *) duckdb_column_data(&result, 0);\nbool *nullmask = duckdb_nullmask_data(&result, 0);\nif (nullmask[row]) {\nprintf(\"Data for row %d: NULL\\n\", row);\n} else {\nprintf(\"Data for row %d: %d\\n\", row, data[row]);\n}\n```\n\n @param result The result object to fetch the nullmask from.\n @param col The column index.\n @return The nullmask of the specified column."]
1785 pub fn duckdb_nullmask_data(
1786 result: *mut duckdb_result,
1787 col: idx_t,
1788 ) -> *mut bool;
1789}
1790unsafe extern "C" {
1791 #[doc = "Returns the error message contained within the result. The error is only set if `duckdb_query` returns `DuckDBError`.\n\nThe result of this function must not be freed. It will be cleaned up when `duckdb_destroy_result` is called.\n\n @param result The result object to fetch the error from.\n @return The error of the result."]
1792 pub fn duckdb_result_error(result: *mut duckdb_result) -> *const ::std::os::raw::c_char;
1793}
1794unsafe extern "C" {
1795 #[doc = "Returns the result error type contained within the result. The error is only set if `duckdb_query` returns\n`DuckDBError`.\n\n @param result The result object to fetch the error from.\n @return The error type of the result."]
1796 pub fn duckdb_result_error_type(result: *mut duckdb_result) -> duckdb_error_type;
1797}
1798unsafe extern "C" {
1799 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nFetches a data chunk from the duckdb_result. This function should be called repeatedly until the result is exhausted.\n\nThe result must be destroyed with `duckdb_destroy_data_chunk`.\n\nThis function supersedes all `duckdb_value` functions, as well as the `duckdb_column_data` and `duckdb_nullmask_data`\nfunctions. It results in significantly better performance, and should be preferred in newer code-bases.\n\nIf this function is used, none of the other result functions can be used and vice versa (i.e. this function cannot be\nmixed with the legacy result functions).\n\nUse `duckdb_result_chunk_count` to figure out how many chunks there are in the result.\n\n @param result The result object to fetch the data chunk from.\n @param chunk_index The chunk index to fetch from.\n @return The resulting data chunk. Returns `NULL` if the chunk index is out of bounds."]
1800 pub fn duckdb_result_get_chunk(
1801 result: duckdb_result,
1802 chunk_index: idx_t,
1803 ) -> duckdb_data_chunk;
1804}
1805unsafe extern "C" {
1806 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nChecks if the type of the internal result is StreamQueryResult.\n\n @param result The result object to check.\n @return Whether or not the result object is of the type StreamQueryResult"]
1807 pub fn duckdb_result_is_streaming(result: duckdb_result) -> bool;
1808}
1809unsafe extern "C" {
1810 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nReturns the number of data chunks present in the result.\n\n @param result The result object\n @return Number of data chunks present in the result."]
1811 pub fn duckdb_result_chunk_count(result: duckdb_result) -> idx_t;
1812}
1813unsafe extern "C" {
1814 #[doc = "Returns the return_type of the given result, or DUCKDB_RETURN_TYPE_INVALID on error\n\n @param result The result object\n @return The return_type"]
1815 pub fn duckdb_result_return_type(result: duckdb_result) -> duckdb_result_type;
1816}
1817unsafe extern "C" {
1818 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The boolean value at the specified location, or false if the value cannot be converted."]
1819 pub fn duckdb_value_boolean(
1820 result: *mut duckdb_result,
1821 col: idx_t,
1822 row: idx_t,
1823 ) -> bool;
1824}
1825unsafe extern "C" {
1826 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The int8_t value at the specified location, or 0 if the value cannot be converted."]
1827 pub fn duckdb_value_int8(
1828 result: *mut duckdb_result,
1829 col: idx_t,
1830 row: idx_t,
1831 ) -> i8;
1832}
1833unsafe extern "C" {
1834 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The int16_t value at the specified location, or 0 if the value cannot be converted."]
1835 pub fn duckdb_value_int16(
1836 result: *mut duckdb_result,
1837 col: idx_t,
1838 row: idx_t,
1839 ) -> i16;
1840}
1841unsafe extern "C" {
1842 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The int32_t value at the specified location, or 0 if the value cannot be converted."]
1843 pub fn duckdb_value_int32(
1844 result: *mut duckdb_result,
1845 col: idx_t,
1846 row: idx_t,
1847 ) -> i32;
1848}
1849unsafe extern "C" {
1850 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The int64_t value at the specified location, or 0 if the value cannot be converted."]
1851 pub fn duckdb_value_int64(
1852 result: *mut duckdb_result,
1853 col: idx_t,
1854 row: idx_t,
1855 ) -> i64;
1856}
1857unsafe extern "C" {
1858 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The duckdb_hugeint value at the specified location, or 0 if the value cannot be converted."]
1859 pub fn duckdb_value_hugeint(
1860 result: *mut duckdb_result,
1861 col: idx_t,
1862 row: idx_t,
1863 ) -> duckdb_hugeint;
1864}
1865unsafe extern "C" {
1866 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The duckdb_uhugeint value at the specified location, or 0 if the value cannot be converted."]
1867 pub fn duckdb_value_uhugeint(
1868 result: *mut duckdb_result,
1869 col: idx_t,
1870 row: idx_t,
1871 ) -> duckdb_uhugeint;
1872}
1873unsafe extern "C" {
1874 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The duckdb_decimal value at the specified location, or 0 if the value cannot be converted."]
1875 pub fn duckdb_value_decimal(
1876 result: *mut duckdb_result,
1877 col: idx_t,
1878 row: idx_t,
1879 ) -> duckdb_decimal;
1880}
1881unsafe extern "C" {
1882 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The uint8_t value at the specified location, or 0 if the value cannot be converted."]
1883 pub fn duckdb_value_uint8(
1884 result: *mut duckdb_result,
1885 col: idx_t,
1886 row: idx_t,
1887 ) -> u8;
1888}
1889unsafe extern "C" {
1890 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The uint16_t value at the specified location, or 0 if the value cannot be converted."]
1891 pub fn duckdb_value_uint16(
1892 result: *mut duckdb_result,
1893 col: idx_t,
1894 row: idx_t,
1895 ) -> u16;
1896}
1897unsafe extern "C" {
1898 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The uint32_t value at the specified location, or 0 if the value cannot be converted."]
1899 pub fn duckdb_value_uint32(
1900 result: *mut duckdb_result,
1901 col: idx_t,
1902 row: idx_t,
1903 ) -> u32;
1904}
1905unsafe extern "C" {
1906 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The uint64_t value at the specified location, or 0 if the value cannot be converted."]
1907 pub fn duckdb_value_uint64(
1908 result: *mut duckdb_result,
1909 col: idx_t,
1910 row: idx_t,
1911 ) -> u64;
1912}
1913unsafe extern "C" {
1914 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The float value at the specified location, or 0 if the value cannot be converted."]
1915 pub fn duckdb_value_float(
1916 result: *mut duckdb_result,
1917 col: idx_t,
1918 row: idx_t,
1919 ) -> f32;
1920}
1921unsafe extern "C" {
1922 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The double value at the specified location, or 0 if the value cannot be converted."]
1923 pub fn duckdb_value_double(
1924 result: *mut duckdb_result,
1925 col: idx_t,
1926 row: idx_t,
1927 ) -> f64;
1928}
1929unsafe extern "C" {
1930 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The duckdb_date value at the specified location, or 0 if the value cannot be converted."]
1931 pub fn duckdb_value_date(
1932 result: *mut duckdb_result,
1933 col: idx_t,
1934 row: idx_t,
1935 ) -> duckdb_date;
1936}
1937unsafe extern "C" {
1938 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The duckdb_time value at the specified location, or 0 if the value cannot be converted."]
1939 pub fn duckdb_value_time(
1940 result: *mut duckdb_result,
1941 col: idx_t,
1942 row: idx_t,
1943 ) -> duckdb_time;
1944}
1945unsafe extern "C" {
1946 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The duckdb_timestamp value at the specified location, or 0 if the value cannot be converted."]
1947 pub fn duckdb_value_timestamp(
1948 result: *mut duckdb_result,
1949 col: idx_t,
1950 row: idx_t,
1951 ) -> duckdb_timestamp;
1952}
1953unsafe extern "C" {
1954 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The duckdb_interval value at the specified location, or 0 if the value cannot be converted."]
1955 pub fn duckdb_value_interval(
1956 result: *mut duckdb_result,
1957 col: idx_t,
1958 row: idx_t,
1959 ) -> duckdb_interval;
1960}
1961unsafe extern "C" {
1962 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The text value at the specified location as a null-terminated string, or nullptr if the value cannot be\nconverted. The result must be freed with `duckdb_free`."]
1963 pub fn duckdb_value_varchar(
1964 result: *mut duckdb_result,
1965 col: idx_t,
1966 row: idx_t,
1967 ) -> *mut ::std::os::raw::c_char;
1968}
1969unsafe extern "C" {
1970 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The string value at the specified location. Attempts to cast the result value to string."]
1971 pub fn duckdb_value_string(
1972 result: *mut duckdb_result,
1973 col: idx_t,
1974 row: idx_t,
1975 ) -> duckdb_string;
1976}
1977unsafe extern "C" {
1978 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The char* value at the specified location. ONLY works on VARCHAR columns and does not auto-cast.\nIf the column is NOT a VARCHAR column this function will return NULL.\n\nThe result must NOT be freed."]
1979 pub fn duckdb_value_varchar_internal(
1980 result: *mut duckdb_result,
1981 col: idx_t,
1982 row: idx_t,
1983 ) -> *mut ::std::os::raw::c_char;
1984}
1985unsafe extern "C" {
1986 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The char* value at the specified location. ONLY works on VARCHAR columns and does not auto-cast.\nIf the column is NOT a VARCHAR column this function will return NULL.\n\nThe result must NOT be freed."]
1987 pub fn duckdb_value_string_internal(
1988 result: *mut duckdb_result,
1989 col: idx_t,
1990 row: idx_t,
1991 ) -> duckdb_string;
1992}
1993unsafe extern "C" {
1994 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return The duckdb_blob value at the specified location. Returns a blob with blob.data set to nullptr if the\nvalue cannot be converted. The resulting field \"blob.data\" must be freed with `duckdb_free.`"]
1995 pub fn duckdb_value_blob(
1996 result: *mut duckdb_result,
1997 col: idx_t,
1998 row: idx_t,
1999 ) -> duckdb_blob;
2000}
2001unsafe extern "C" {
2002 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\n @return Returns true if the value at the specified index is NULL, and false otherwise."]
2003 pub fn duckdb_value_is_null(
2004 result: *mut duckdb_result,
2005 col: idx_t,
2006 row: idx_t,
2007 ) -> bool;
2008}
2009unsafe extern "C" {
2010 #[doc = "Allocate `size` bytes of memory using the duckdb internal malloc function. Any memory allocated in this manner\nshould be freed using `duckdb_free`.\n\n @param size The number of bytes to allocate.\n @return A pointer to the allocated memory region."]
2011 pub fn duckdb_malloc(size: usize) -> *mut ::std::os::raw::c_void;
2012}
2013unsafe extern "C" {
2014 #[doc = "Free a value returned from `duckdb_malloc`, `duckdb_value_varchar`, `duckdb_value_blob`, or\n`duckdb_value_string`.\n\n @param ptr The memory region to de-allocate."]
2015 pub fn duckdb_free(ptr: *mut ::std::os::raw::c_void);
2016}
2017unsafe extern "C" {
2018 #[doc = "The internal vector size used by DuckDB.\nThis is the amount of tuples that will fit into a data chunk created by `duckdb_create_data_chunk`.\n\n @return The vector size."]
2019 pub fn duckdb_vector_size() -> idx_t;
2020}
2021unsafe extern "C" {
2022 #[doc = "Whether or not the duckdb_string_t value is inlined.\nThis means that the data of the string does not have a separate allocation."]
2023 pub fn duckdb_string_is_inlined(string: duckdb_string_t) -> bool;
2024}
2025unsafe extern "C" {
2026 #[doc = "Get the string length of a string_t\n\n @param string The string to get the length of.\n @return The length."]
2027 pub fn duckdb_string_t_length(string: duckdb_string_t) -> u32;
2028}
2029unsafe extern "C" {
2030 #[doc = "Get a pointer to the string data of a string_t\n\n @param string The string to get the pointer to.\n @return The pointer."]
2031 pub fn duckdb_string_t_data(string: *mut duckdb_string_t) -> *const ::std::os::raw::c_char;
2032}
2033unsafe extern "C" {
2034 #[doc = "Checks if a string is valid UTF-8.\n\n @param str The string to check\n @param len The length of the string (in bytes)\n @return nullptr if the string is valid UTF-8. Otherwise, a duckdb_error_data containing error information. Must be\ndestroyed with `duckdb_destroy_error_data`."]
2035 pub fn duckdb_valid_utf8_check(
2036 str_: *const ::std::os::raw::c_char,
2037 len: idx_t,
2038 ) -> duckdb_error_data;
2039}
2040unsafe extern "C" {
2041 #[doc = "Decompose a `duckdb_date` object into year, month and date (stored as `duckdb_date_struct`).\n\n @param date The date object, as obtained from a `DUCKDB_TYPE_DATE` column.\n @return The `duckdb_date_struct` with the decomposed elements."]
2042 pub fn duckdb_from_date(date: duckdb_date) -> duckdb_date_struct;
2043}
2044unsafe extern "C" {
2045 #[doc = "Re-compose a `duckdb_date` from year, month and date (`duckdb_date_struct`).\n\n @param date The year, month and date stored in a `duckdb_date_struct`.\n @return The `duckdb_date` element."]
2046 pub fn duckdb_to_date(date: duckdb_date_struct) -> duckdb_date;
2047}
2048unsafe extern "C" {
2049 #[doc = "Test a `duckdb_date` to see if it is a finite value.\n\n @param date The date object, as obtained from a `DUCKDB_TYPE_DATE` column.\n @return True if the date is finite, false if it is ±infinity."]
2050 pub fn duckdb_is_finite_date(date: duckdb_date) -> bool;
2051}
2052unsafe extern "C" {
2053 #[doc = "Decompose a `duckdb_time` object into hour, minute, second and microsecond (stored as `duckdb_time_struct`).\n\n @param time The time object, as obtained from a `DUCKDB_TYPE_TIME` column.\n @return The `duckdb_time_struct` with the decomposed elements."]
2054 pub fn duckdb_from_time(time: duckdb_time) -> duckdb_time_struct;
2055}
2056unsafe extern "C" {
2057 #[doc = "Create a `duckdb_time_tz` object from micros and a timezone offset.\n\n @param micros The microsecond component of the time.\n @param offset The timezone offset component of the time.\n @return The `duckdb_time_tz` element."]
2058 pub fn duckdb_create_time_tz(
2059 micros: i64,
2060 offset: i32,
2061 ) -> duckdb_time_tz;
2062}
2063unsafe extern "C" {
2064 #[doc = "Decompose a TIME_TZ objects into micros and a timezone offset.\n\nUse `duckdb_from_time` to further decompose the micros into hour, minute, second and microsecond.\n\n @param micros The time object, as obtained from a `DUCKDB_TYPE_TIME_TZ` column."]
2065 pub fn duckdb_from_time_tz(micros: duckdb_time_tz) -> duckdb_time_tz_struct;
2066}
2067unsafe extern "C" {
2068 #[doc = "Re-compose a `duckdb_time` from hour, minute, second and microsecond (`duckdb_time_struct`).\n\n @param time The hour, minute, second and microsecond in a `duckdb_time_struct`.\n @return The `duckdb_time` element."]
2069 pub fn duckdb_to_time(time: duckdb_time_struct) -> duckdb_time;
2070}
2071unsafe extern "C" {
2072 #[doc = "Decompose a `duckdb_timestamp` object into a `duckdb_timestamp_struct`.\n\n @param ts The ts object, as obtained from a `DUCKDB_TYPE_TIMESTAMP` column.\n @return The `duckdb_timestamp_struct` with the decomposed elements."]
2073 pub fn duckdb_from_timestamp(ts: duckdb_timestamp) -> duckdb_timestamp_struct;
2074}
2075unsafe extern "C" {
2076 #[doc = "Re-compose a `duckdb_timestamp` from a duckdb_timestamp_struct.\n\n @param ts The de-composed elements in a `duckdb_timestamp_struct`.\n @return The `duckdb_timestamp` element."]
2077 pub fn duckdb_to_timestamp(ts: duckdb_timestamp_struct) -> duckdb_timestamp;
2078}
2079unsafe extern "C" {
2080 #[doc = "Test a `duckdb_timestamp` to see if it is a finite value.\n\n @param ts The duckdb_timestamp object, as obtained from a `DUCKDB_TYPE_TIMESTAMP` column.\n @return True if the timestamp is finite, false if it is ±infinity."]
2081 pub fn duckdb_is_finite_timestamp(ts: duckdb_timestamp) -> bool;
2082}
2083unsafe extern "C" {
2084 #[doc = "Test a `duckdb_timestamp_s` to see if it is a finite value.\n\n @param ts The duckdb_timestamp_s object, as obtained from a `DUCKDB_TYPE_TIMESTAMP_S` column.\n @return True if the timestamp is finite, false if it is ±infinity."]
2085 pub fn duckdb_is_finite_timestamp_s(ts: duckdb_timestamp_s) -> bool;
2086}
2087unsafe extern "C" {
2088 #[doc = "Test a `duckdb_timestamp_ms` to see if it is a finite value.\n\n @param ts The duckdb_timestamp_ms object, as obtained from a `DUCKDB_TYPE_TIMESTAMP_MS` column.\n @return True if the timestamp is finite, false if it is ±infinity."]
2089 pub fn duckdb_is_finite_timestamp_ms(ts: duckdb_timestamp_ms) -> bool;
2090}
2091unsafe extern "C" {
2092 #[doc = "Test a `duckdb_timestamp_ns` to see if it is a finite value.\n\n @param ts The duckdb_timestamp_ns object, as obtained from a `DUCKDB_TYPE_TIMESTAMP_NS` column.\n @return True if the timestamp is finite, false if it is ±infinity."]
2093 pub fn duckdb_is_finite_timestamp_ns(ts: duckdb_timestamp_ns) -> bool;
2094}
2095unsafe extern "C" {
2096 #[doc = "Converts a duckdb_hugeint object (as obtained from a `DUCKDB_TYPE_HUGEINT` column) into a double.\n\n @param val The hugeint value.\n @return The converted `double` element."]
2097 pub fn duckdb_hugeint_to_double(val: duckdb_hugeint) -> f64;
2098}
2099unsafe extern "C" {
2100 #[doc = "Converts a double value to a duckdb_hugeint object.\n\nIf the conversion fails because the double value is too big the result will be 0.\n\n @param val The double value.\n @return The converted `duckdb_hugeint` element."]
2101 pub fn duckdb_double_to_hugeint(val: f64) -> duckdb_hugeint;
2102}
2103unsafe extern "C" {
2104 #[doc = "Converts a duckdb_uhugeint object (as obtained from a `DUCKDB_TYPE_UHUGEINT` column) into a double.\n\n @param val The uhugeint value.\n @return The converted `double` element."]
2105 pub fn duckdb_uhugeint_to_double(val: duckdb_uhugeint) -> f64;
2106}
2107unsafe extern "C" {
2108 #[doc = "Converts a double value to a duckdb_uhugeint object.\n\nIf the conversion fails because the double value is too big the result will be 0.\n\n @param val The double value.\n @return The converted `duckdb_uhugeint` element."]
2109 pub fn duckdb_double_to_uhugeint(val: f64) -> duckdb_uhugeint;
2110}
2111unsafe extern "C" {
2112 #[doc = "Converts a double value to a duckdb_decimal object.\n\nIf the conversion fails because the double value is too big, or the width/scale are invalid the result will be 0.\n\n @param val The double value.\n @return The converted `duckdb_decimal` element."]
2113 pub fn duckdb_double_to_decimal(
2114 val: f64,
2115 width: u8,
2116 scale: u8,
2117 ) -> duckdb_decimal;
2118}
2119unsafe extern "C" {
2120 #[doc = "Converts a duckdb_decimal object (as obtained from a `DUCKDB_TYPE_DECIMAL` column) into a double.\n\n @param val The decimal value.\n @return The converted `double` element."]
2121 pub fn duckdb_decimal_to_double(val: duckdb_decimal) -> f64;
2122}
2123unsafe extern "C" {
2124 #[doc = "Create a prepared statement object from a query.\n\nNote that after calling `duckdb_prepare`, the prepared statement should always be destroyed using\n`duckdb_destroy_prepare`, even if the prepare fails.\n\nIf the prepare fails, `duckdb_prepare_error` can be called to obtain the reason why the prepare failed.\n\n @param connection The connection object\n @param query The SQL query to prepare\n @param out_prepared_statement The resulting prepared statement object\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
2125 pub fn duckdb_prepare(
2126 connection: duckdb_connection,
2127 query: *const ::std::os::raw::c_char,
2128 out_prepared_statement: *mut duckdb_prepared_statement,
2129 ) -> duckdb_state;
2130}
2131unsafe extern "C" {
2132 #[doc = "Closes the prepared statement and de-allocates all memory allocated for the statement.\n\n @param prepared_statement The prepared statement to destroy."]
2133 pub fn duckdb_destroy_prepare(prepared_statement: *mut duckdb_prepared_statement);
2134}
2135unsafe extern "C" {
2136 #[doc = "Returns the error message associated with the given prepared statement.\nIf the prepared statement has no error message, this returns `nullptr` instead.\n\nThe error message should not be freed. It will be de-allocated when `duckdb_destroy_prepare` is called.\n\n @param prepared_statement The prepared statement to obtain the error from.\n @return The error message, or `nullptr` if there is none."]
2137 pub fn duckdb_prepare_error(
2138 prepared_statement: duckdb_prepared_statement
2139 ) -> *const ::std::os::raw::c_char;
2140}
2141unsafe extern "C" {
2142 #[doc = "Returns the number of parameters that can be provided to the given prepared statement.\n\nReturns 0 if the query was not successfully prepared.\n\n @param prepared_statement The prepared statement to obtain the number of parameters for."]
2143 pub fn duckdb_nparams(prepared_statement: duckdb_prepared_statement) -> idx_t;
2144}
2145unsafe extern "C" {
2146 #[doc = "Returns the name used to identify the parameter\nThe returned string should be freed using `duckdb_free`.\n\nReturns NULL if the index is out of range for the provided prepared statement.\n\n @param prepared_statement The prepared statement for which to get the parameter name from."]
2147 pub fn duckdb_parameter_name(
2148 prepared_statement: duckdb_prepared_statement,
2149 index: idx_t,
2150 ) -> *const ::std::os::raw::c_char;
2151}
2152unsafe extern "C" {
2153 #[doc = "Returns the parameter type for the parameter at the given index.\n\nReturns `DUCKDB_TYPE_INVALID` if the parameter index is out of range or the statement was not successfully prepared.\n\n @param prepared_statement The prepared statement.\n @param param_idx The parameter index.\n @return The parameter type"]
2154 pub fn duckdb_param_type(
2155 prepared_statement: duckdb_prepared_statement,
2156 param_idx: idx_t,
2157 ) -> duckdb_type;
2158}
2159unsafe extern "C" {
2160 #[doc = "Returns the logical type for the parameter at the given index.\n\nReturns `nullptr` if the parameter index is out of range or the statement was not successfully prepared.\n\nThe return type of this call should be destroyed with `duckdb_destroy_logical_type`.\n\n @param prepared_statement The prepared statement.\n @param param_idx The parameter index.\n @return The logical type of the parameter"]
2161 pub fn duckdb_param_logical_type(
2162 prepared_statement: duckdb_prepared_statement,
2163 param_idx: idx_t,
2164 ) -> duckdb_logical_type;
2165}
2166unsafe extern "C" {
2167 #[doc = "Clear the params bind to the prepared statement."]
2168 pub fn duckdb_clear_bindings(prepared_statement: duckdb_prepared_statement) -> duckdb_state;
2169}
2170unsafe extern "C" {
2171 #[doc = "Returns the statement type of the statement to be executed\n\n @param statement The prepared statement.\n @return duckdb_statement_type value or DUCKDB_STATEMENT_TYPE_INVALID"]
2172 pub fn duckdb_prepared_statement_type(
2173 statement: duckdb_prepared_statement
2174 ) -> duckdb_statement_type;
2175}
2176unsafe extern "C" {
2177 #[doc = "Returns the number of columns present in a the result of the prepared statement. If any of the column types are invalid,\nthe result will be 1.\n\n @param prepared_statement The prepared statement.\n @return The number of columns present in the result of the prepared statement."]
2178 pub fn duckdb_prepared_statement_column_count(
2179 prepared_statement: duckdb_prepared_statement
2180 ) -> idx_t;
2181}
2182unsafe extern "C" {
2183 #[doc = "Returns the name of the specified column of the result of the prepared_statement.\nThe returned string should be freed using `duckdb_free`.\n\nReturns `nullptr` if the column is out of range.\n\n @param prepared_statement The prepared statement.\n @param col_idx The column index.\n @return The column name of the specified column."]
2184 pub fn duckdb_prepared_statement_column_name(
2185 prepared_statement: duckdb_prepared_statement,
2186 col_idx: idx_t,
2187 ) -> *const ::std::os::raw::c_char;
2188}
2189unsafe extern "C" {
2190 #[doc = "Returns the column type of the specified column of the result of the prepared_statement.\n\nReturns `DUCKDB_TYPE_INVALID` if the column is out of range.\nThe return type of this call should be destroyed with `duckdb_destroy_logical_type`.\n\n @param prepared_statement The prepared statement to fetch the column type from.\n @param col_idx The column index.\n @return The logical type of the specified column."]
2191 pub fn duckdb_prepared_statement_column_logical_type(
2192 prepared_statement: duckdb_prepared_statement,
2193 col_idx: idx_t,
2194 ) -> duckdb_logical_type;
2195}
2196unsafe extern "C" {
2197 #[doc = "Returns the column type of the specified column of the result of the prepared_statement.\n\nReturns `DUCKDB_TYPE_INVALID` if the column is out of range.\n\n @param prepared_statement The prepared statement to fetch the column type from.\n @param col_idx The column index.\n @return The type of the specified column."]
2198 pub fn duckdb_prepared_statement_column_type(
2199 prepared_statement: duckdb_prepared_statement,
2200 col_idx: idx_t,
2201 ) -> duckdb_type;
2202}
2203unsafe extern "C" {
2204 #[doc = "Binds a value to the prepared statement at the specified index.\n\nSupersedes all type-specific bind functions (e.g., `duckdb_bind_varchar`, `duckdb_bind_int64`, etc.)."]
2205 pub fn duckdb_bind_value(
2206 prepared_statement: duckdb_prepared_statement,
2207 param_idx: idx_t,
2208 val: duckdb_value,
2209 ) -> duckdb_state;
2210}
2211unsafe extern "C" {
2212 #[doc = "Retrieve the index of the parameter for the prepared statement, identified by name"]
2213 pub fn duckdb_bind_parameter_index(
2214 prepared_statement: duckdb_prepared_statement,
2215 param_idx_out: *mut idx_t,
2216 name: *const ::std::os::raw::c_char,
2217 ) -> duckdb_state;
2218}
2219unsafe extern "C" {
2220 #[doc = "Binds a bool value to the prepared statement at the specified index."]
2221 pub fn duckdb_bind_boolean(
2222 prepared_statement: duckdb_prepared_statement,
2223 param_idx: idx_t,
2224 val: bool,
2225 ) -> duckdb_state;
2226}
2227unsafe extern "C" {
2228 #[doc = "Binds an int8_t value to the prepared statement at the specified index."]
2229 pub fn duckdb_bind_int8(
2230 prepared_statement: duckdb_prepared_statement,
2231 param_idx: idx_t,
2232 val: i8,
2233 ) -> duckdb_state;
2234}
2235unsafe extern "C" {
2236 #[doc = "Binds an int16_t value to the prepared statement at the specified index."]
2237 pub fn duckdb_bind_int16(
2238 prepared_statement: duckdb_prepared_statement,
2239 param_idx: idx_t,
2240 val: i16,
2241 ) -> duckdb_state;
2242}
2243unsafe extern "C" {
2244 #[doc = "Binds an int32_t value to the prepared statement at the specified index."]
2245 pub fn duckdb_bind_int32(
2246 prepared_statement: duckdb_prepared_statement,
2247 param_idx: idx_t,
2248 val: i32,
2249 ) -> duckdb_state;
2250}
2251unsafe extern "C" {
2252 #[doc = "Binds an int64_t value to the prepared statement at the specified index."]
2253 pub fn duckdb_bind_int64(
2254 prepared_statement: duckdb_prepared_statement,
2255 param_idx: idx_t,
2256 val: i64,
2257 ) -> duckdb_state;
2258}
2259unsafe extern "C" {
2260 #[doc = "Binds a duckdb_hugeint value to the prepared statement at the specified index."]
2261 pub fn duckdb_bind_hugeint(
2262 prepared_statement: duckdb_prepared_statement,
2263 param_idx: idx_t,
2264 val: duckdb_hugeint,
2265 ) -> duckdb_state;
2266}
2267unsafe extern "C" {
2268 #[doc = "Binds a duckdb_uhugeint value to the prepared statement at the specified index."]
2269 pub fn duckdb_bind_uhugeint(
2270 prepared_statement: duckdb_prepared_statement,
2271 param_idx: idx_t,
2272 val: duckdb_uhugeint,
2273 ) -> duckdb_state;
2274}
2275unsafe extern "C" {
2276 #[doc = "Binds a duckdb_decimal value to the prepared statement at the specified index."]
2277 pub fn duckdb_bind_decimal(
2278 prepared_statement: duckdb_prepared_statement,
2279 param_idx: idx_t,
2280 val: duckdb_decimal,
2281 ) -> duckdb_state;
2282}
2283unsafe extern "C" {
2284 #[doc = "Binds a uint8_t value to the prepared statement at the specified index."]
2285 pub fn duckdb_bind_uint8(
2286 prepared_statement: duckdb_prepared_statement,
2287 param_idx: idx_t,
2288 val: u8,
2289 ) -> duckdb_state;
2290}
2291unsafe extern "C" {
2292 #[doc = "Binds a uint16_t value to the prepared statement at the specified index."]
2293 pub fn duckdb_bind_uint16(
2294 prepared_statement: duckdb_prepared_statement,
2295 param_idx: idx_t,
2296 val: u16,
2297 ) -> duckdb_state;
2298}
2299unsafe extern "C" {
2300 #[doc = "Binds a uint32_t value to the prepared statement at the specified index."]
2301 pub fn duckdb_bind_uint32(
2302 prepared_statement: duckdb_prepared_statement,
2303 param_idx: idx_t,
2304 val: u32,
2305 ) -> duckdb_state;
2306}
2307unsafe extern "C" {
2308 #[doc = "Binds a uint64_t value to the prepared statement at the specified index."]
2309 pub fn duckdb_bind_uint64(
2310 prepared_statement: duckdb_prepared_statement,
2311 param_idx: idx_t,
2312 val: u64,
2313 ) -> duckdb_state;
2314}
2315unsafe extern "C" {
2316 #[doc = "Binds a float value to the prepared statement at the specified index."]
2317 pub fn duckdb_bind_float(
2318 prepared_statement: duckdb_prepared_statement,
2319 param_idx: idx_t,
2320 val: f32,
2321 ) -> duckdb_state;
2322}
2323unsafe extern "C" {
2324 #[doc = "Binds a double value to the prepared statement at the specified index."]
2325 pub fn duckdb_bind_double(
2326 prepared_statement: duckdb_prepared_statement,
2327 param_idx: idx_t,
2328 val: f64,
2329 ) -> duckdb_state;
2330}
2331unsafe extern "C" {
2332 #[doc = "Binds a duckdb_date value to the prepared statement at the specified index."]
2333 pub fn duckdb_bind_date(
2334 prepared_statement: duckdb_prepared_statement,
2335 param_idx: idx_t,
2336 val: duckdb_date,
2337 ) -> duckdb_state;
2338}
2339unsafe extern "C" {
2340 #[doc = "Binds a duckdb_time value to the prepared statement at the specified index."]
2341 pub fn duckdb_bind_time(
2342 prepared_statement: duckdb_prepared_statement,
2343 param_idx: idx_t,
2344 val: duckdb_time,
2345 ) -> duckdb_state;
2346}
2347unsafe extern "C" {
2348 #[doc = "Binds a duckdb_timestamp value to the prepared statement at the specified index."]
2349 pub fn duckdb_bind_timestamp(
2350 prepared_statement: duckdb_prepared_statement,
2351 param_idx: idx_t,
2352 val: duckdb_timestamp,
2353 ) -> duckdb_state;
2354}
2355unsafe extern "C" {
2356 #[doc = "Binds a duckdb_timestamp value to the prepared statement at the specified index."]
2357 pub fn duckdb_bind_timestamp_tz(
2358 prepared_statement: duckdb_prepared_statement,
2359 param_idx: idx_t,
2360 val: duckdb_timestamp,
2361 ) -> duckdb_state;
2362}
2363unsafe extern "C" {
2364 #[doc = "Binds a duckdb_interval value to the prepared statement at the specified index."]
2365 pub fn duckdb_bind_interval(
2366 prepared_statement: duckdb_prepared_statement,
2367 param_idx: idx_t,
2368 val: duckdb_interval,
2369 ) -> duckdb_state;
2370}
2371unsafe extern "C" {
2372 #[doc = "Binds a null-terminated varchar value to the prepared statement at the specified index.\n\nSuperseded by `duckdb_bind_value`."]
2373 pub fn duckdb_bind_varchar(
2374 prepared_statement: duckdb_prepared_statement,
2375 param_idx: idx_t,
2376 val: *const ::std::os::raw::c_char,
2377 ) -> duckdb_state;
2378}
2379unsafe extern "C" {
2380 #[doc = "Binds a varchar value to the prepared statement at the specified index.\n\nSuperseded by `duckdb_bind_value`."]
2381 pub fn duckdb_bind_varchar_length(
2382 prepared_statement: duckdb_prepared_statement,
2383 param_idx: idx_t,
2384 val: *const ::std::os::raw::c_char,
2385 length: idx_t,
2386 ) -> duckdb_state;
2387}
2388unsafe extern "C" {
2389 #[doc = "Binds a blob value to the prepared statement at the specified index."]
2390 pub fn duckdb_bind_blob(
2391 prepared_statement: duckdb_prepared_statement,
2392 param_idx: idx_t,
2393 data: *const ::std::os::raw::c_void,
2394 length: idx_t,
2395 ) -> duckdb_state;
2396}
2397unsafe extern "C" {
2398 #[doc = "Binds a NULL value to the prepared statement at the specified index."]
2399 pub fn duckdb_bind_null(
2400 prepared_statement: duckdb_prepared_statement,
2401 param_idx: idx_t,
2402 ) -> duckdb_state;
2403}
2404unsafe extern "C" {
2405 #[doc = "Executes the prepared statement with the given bound parameters, and returns a materialized query result.\n\nThis method can be called multiple times for each prepared statement, and the parameters can be modified\nbetween calls to this function.\n\nNote that the result must be freed with `duckdb_destroy_result`.\n\n @param prepared_statement The prepared statement to execute.\n @param out_result The query result.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
2406 pub fn duckdb_execute_prepared(
2407 prepared_statement: duckdb_prepared_statement,
2408 out_result: *mut duckdb_result,
2409 ) -> duckdb_state;
2410}
2411unsafe extern "C" {
2412 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nExecutes the prepared statement with the given bound parameters, and returns an optionally-streaming query result.\nTo determine if the resulting query was in fact streamed, use `duckdb_result_is_streaming`\n\nThis method can be called multiple times for each prepared statement, and the parameters can be modified\nbetween calls to this function.\n\nNote that the result must be freed with `duckdb_destroy_result`.\n\n @param prepared_statement The prepared statement to execute.\n @param out_result The query result.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
2413 pub fn duckdb_execute_prepared_streaming(
2414 prepared_statement: duckdb_prepared_statement,
2415 out_result: *mut duckdb_result,
2416 ) -> duckdb_state;
2417}
2418unsafe extern "C" {
2419 #[doc = "Extract all statements from a query.\nNote that after calling `duckdb_extract_statements`, the extracted statements should always be destroyed using\n`duckdb_destroy_extracted`, even if no statements were extracted.\n\nIf the extract fails, `duckdb_extract_statements_error` can be called to obtain the reason why the extract failed.\n\n @param connection The connection object\n @param query The SQL query to extract\n @param out_extracted_statements The resulting extracted statements object\n @return The number of extracted statements or 0 on failure."]
2420 pub fn duckdb_extract_statements(
2421 connection: duckdb_connection,
2422 query: *const ::std::os::raw::c_char,
2423 out_extracted_statements: *mut duckdb_extracted_statements,
2424 ) -> idx_t;
2425}
2426unsafe extern "C" {
2427 #[doc = "Prepare an extracted statement.\nNote that after calling `duckdb_prepare_extracted_statement`, the prepared statement should always be destroyed using\n`duckdb_destroy_prepare`, even if the prepare fails.\n\nIf the prepare fails, `duckdb_prepare_error` can be called to obtain the reason why the prepare failed.\n\n @param connection The connection object\n @param extracted_statements The extracted statements object\n @param index The index of the extracted statement to prepare\n @param out_prepared_statement The resulting prepared statement object\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
2428 pub fn duckdb_prepare_extracted_statement(
2429 connection: duckdb_connection,
2430 extracted_statements: duckdb_extracted_statements,
2431 index: idx_t,
2432 out_prepared_statement: *mut duckdb_prepared_statement,
2433 ) -> duckdb_state;
2434}
2435unsafe extern "C" {
2436 #[doc = "Returns the error message contained within the extracted statements.\nThe result of this function must not be freed. It will be cleaned up when `duckdb_destroy_extracted` is called.\n\n @param extracted_statements The extracted statements to fetch the error from.\n @return The error of the extracted statements."]
2437 pub fn duckdb_extract_statements_error(
2438 extracted_statements: duckdb_extracted_statements
2439 ) -> *const ::std::os::raw::c_char;
2440}
2441unsafe extern "C" {
2442 #[doc = "De-allocates all memory allocated for the extracted statements.\n @param extracted_statements The extracted statements to destroy."]
2443 pub fn duckdb_destroy_extracted(extracted_statements: *mut duckdb_extracted_statements);
2444}
2445unsafe extern "C" {
2446 #[doc = "Executes the prepared statement with the given bound parameters, and returns a pending result.\nThe pending result represents an intermediate structure for a query that is not yet fully executed.\nThe pending result can be used to incrementally execute a query, returning control to the client between tasks.\n\nNote that after calling `duckdb_pending_prepared`, the pending result should always be destroyed using\n`duckdb_destroy_pending`, even if this function returns DuckDBError.\n\n @param prepared_statement The prepared statement to execute.\n @param out_result The pending query result.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
2447 pub fn duckdb_pending_prepared(
2448 prepared_statement: duckdb_prepared_statement,
2449 out_result: *mut duckdb_pending_result,
2450 ) -> duckdb_state;
2451}
2452unsafe extern "C" {
2453 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nExecutes the prepared statement with the given bound parameters, and returns a pending result.\nThis pending result will create a streaming duckdb_result when executed.\nThe pending result represents an intermediate structure for a query that is not yet fully executed.\n\nNote that after calling `duckdb_pending_prepared_streaming`, the pending result should always be destroyed using\n`duckdb_destroy_pending`, even if this function returns DuckDBError.\n\n @param prepared_statement The prepared statement to execute.\n @param out_result The pending query result.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
2454 pub fn duckdb_pending_prepared_streaming(
2455 prepared_statement: duckdb_prepared_statement,
2456 out_result: *mut duckdb_pending_result,
2457 ) -> duckdb_state;
2458}
2459unsafe extern "C" {
2460 #[doc = "Closes the pending result and de-allocates all memory allocated for the result.\n\n @param pending_result The pending result to destroy."]
2461 pub fn duckdb_destroy_pending(pending_result: *mut duckdb_pending_result);
2462}
2463unsafe extern "C" {
2464 #[doc = "Returns the error message contained within the pending result.\n\nThe result of this function must not be freed. It will be cleaned up when `duckdb_destroy_pending` is called.\n\n @param pending_result The pending result to fetch the error from.\n @return The error of the pending result."]
2465 pub fn duckdb_pending_error(
2466 pending_result: duckdb_pending_result
2467 ) -> *const ::std::os::raw::c_char;
2468}
2469unsafe extern "C" {
2470 #[doc = "Executes a single task within the query, returning whether or not the query is ready.\n\nIf this returns DUCKDB_PENDING_RESULT_READY, the duckdb_execute_pending function can be called to obtain the result.\nIf this returns DUCKDB_PENDING_RESULT_NOT_READY, the duckdb_pending_execute_task function should be called again.\nIf this returns DUCKDB_PENDING_ERROR, an error occurred during execution.\n\nThe error message can be obtained by calling duckdb_pending_error on the pending_result.\n\n @param pending_result The pending result to execute a task within.\n @return The state of the pending result after the execution."]
2471 pub fn duckdb_pending_execute_task(
2472 pending_result: duckdb_pending_result
2473 ) -> duckdb_pending_state;
2474}
2475unsafe extern "C" {
2476 #[doc = "If this returns DUCKDB_PENDING_RESULT_READY, the duckdb_execute_pending function can be called to obtain the result.\nIf this returns DUCKDB_PENDING_RESULT_NOT_READY, the duckdb_pending_execute_check_state function should be called again.\nIf this returns DUCKDB_PENDING_ERROR, an error occurred during execution.\n\nThe error message can be obtained by calling duckdb_pending_error on the pending_result.\n\n @param pending_result The pending result.\n @return The state of the pending result."]
2477 pub fn duckdb_pending_execute_check_state(
2478 pending_result: duckdb_pending_result
2479 ) -> duckdb_pending_state;
2480}
2481unsafe extern "C" {
2482 #[doc = "Fully execute a pending query result, returning the final query result.\n\nIf duckdb_pending_execute_task has been called until DUCKDB_PENDING_RESULT_READY was returned, this will return fast.\nOtherwise, all remaining tasks must be executed first.\n\nNote that the result must be freed with `duckdb_destroy_result`.\n\n @param pending_result The pending result to execute.\n @param out_result The result object.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
2483 pub fn duckdb_execute_pending(
2484 pending_result: duckdb_pending_result,
2485 out_result: *mut duckdb_result,
2486 ) -> duckdb_state;
2487}
2488unsafe extern "C" {
2489 #[doc = "Returns whether a duckdb_pending_state is finished executing. For example if `pending_state` is\nDUCKDB_PENDING_RESULT_READY, this function will return true.\n\n @param pending_state The pending state on which to decide whether to finish execution.\n @return Boolean indicating pending execution should be considered finished."]
2490 pub fn duckdb_pending_execution_is_finished(pending_state: duckdb_pending_state) -> bool;
2491}
2492unsafe extern "C" {
2493 #[doc = "Destroys the value and de-allocates all memory allocated for that type.\n\n @param value The value to destroy."]
2494 pub fn duckdb_destroy_value(value: *mut duckdb_value);
2495}
2496unsafe extern "C" {
2497 #[doc = "Creates a value from a null-terminated string. Returns nullptr if the string is not valid UTF-8 or other invalid input.\n\nSuperseded by `duckdb_create_varchar_length`.\n\n @param text The null-terminated string\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2498 pub fn duckdb_create_varchar(text: *const ::std::os::raw::c_char) -> duckdb_value;
2499}
2500unsafe extern "C" {
2501 #[doc = "Creates a value from a string. Returns nullptr if the string is not valid UTF-8 or other invalid input.\n\n @param text The text\n @param length The length of the text\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2502 pub fn duckdb_create_varchar_length(
2503 text: *const ::std::os::raw::c_char,
2504 length: idx_t,
2505 ) -> duckdb_value;
2506}
2507unsafe extern "C" {
2508 #[doc = "Creates a value from a boolean\n\n @param input The boolean value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2509 pub fn duckdb_create_bool(input: bool) -> duckdb_value;
2510}
2511unsafe extern "C" {
2512 #[doc = "Creates a value from an int8_t (a tinyint)\n\n @param input The tinyint value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2513 pub fn duckdb_create_int8(input: i8) -> duckdb_value;
2514}
2515unsafe extern "C" {
2516 #[doc = "Creates a value from a uint8_t (a utinyint)\n\n @param input The utinyint value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2517 pub fn duckdb_create_uint8(input: u8) -> duckdb_value;
2518}
2519unsafe extern "C" {
2520 #[doc = "Creates a value from an int16_t (a smallint)\n\n @param input The smallint value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2521 pub fn duckdb_create_int16(input: i16) -> duckdb_value;
2522}
2523unsafe extern "C" {
2524 #[doc = "Creates a value from a uint16_t (a usmallint)\n\n @param input The usmallint value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2525 pub fn duckdb_create_uint16(input: u16) -> duckdb_value;
2526}
2527unsafe extern "C" {
2528 #[doc = "Creates a value from an int32_t (an integer)\n\n @param input The integer value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2529 pub fn duckdb_create_int32(input: i32) -> duckdb_value;
2530}
2531unsafe extern "C" {
2532 #[doc = "Creates a value from a uint32_t (a uinteger)\n\n @param input The uinteger value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2533 pub fn duckdb_create_uint32(input: u32) -> duckdb_value;
2534}
2535unsafe extern "C" {
2536 #[doc = "Creates a value from a uint64_t (a ubigint)\n\n @param input The ubigint value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2537 pub fn duckdb_create_uint64(input: u64) -> duckdb_value;
2538}
2539unsafe extern "C" {
2540 #[doc = "Creates a value from an int64\n\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2541 pub fn duckdb_create_int64(val: i64) -> duckdb_value;
2542}
2543unsafe extern "C" {
2544 #[doc = "Creates a value from a hugeint\n\n @param input The hugeint value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2545 pub fn duckdb_create_hugeint(input: duckdb_hugeint) -> duckdb_value;
2546}
2547unsafe extern "C" {
2548 #[doc = "Creates a value from a uhugeint\n\n @param input The uhugeint value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2549 pub fn duckdb_create_uhugeint(input: duckdb_uhugeint) -> duckdb_value;
2550}
2551unsafe extern "C" {
2552 #[doc = "Creates a BIGNUM value from a duckdb_bignum\n\n @param input The duckdb_bignum value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2553 pub fn duckdb_create_bignum(input: duckdb_bignum) -> duckdb_value;
2554}
2555unsafe extern "C" {
2556 #[doc = "Creates a DECIMAL value from a duckdb_decimal\n\nThe width must be between 1 and 38, and the scale must not exceed the width.\n\n @param input The duckdb_decimal value\n @return The value, or `nullptr` if the width or scale are out of range. This must be destroyed with\n`duckdb_destroy_value`."]
2557 pub fn duckdb_create_decimal(input: duckdb_decimal) -> duckdb_value;
2558}
2559unsafe extern "C" {
2560 #[doc = "Creates a value from a float\n\n @param input The float value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2561 pub fn duckdb_create_float(input: f32) -> duckdb_value;
2562}
2563unsafe extern "C" {
2564 #[doc = "Creates a value from a double\n\n @param input The double value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2565 pub fn duckdb_create_double(input: f64) -> duckdb_value;
2566}
2567unsafe extern "C" {
2568 #[doc = "Creates a value from a date\n\n @param input The date value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2569 pub fn duckdb_create_date(input: duckdb_date) -> duckdb_value;
2570}
2571unsafe extern "C" {
2572 #[doc = "Creates a value from a time\n\n @param input The time value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2573 pub fn duckdb_create_time(input: duckdb_time) -> duckdb_value;
2574}
2575unsafe extern "C" {
2576 #[doc = "Creates a value from a time_ns\n\n @param input The time value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2577 pub fn duckdb_create_time_ns(input: duckdb_time_ns) -> duckdb_value;
2578}
2579unsafe extern "C" {
2580 #[doc = "Creates a value from a time_tz.\nNot to be confused with `duckdb_create_time_tz`, which creates a duckdb_time_tz_t.\n\n @param value The time_tz value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2581 pub fn duckdb_create_time_tz_value(value: duckdb_time_tz) -> duckdb_value;
2582}
2583unsafe extern "C" {
2584 #[doc = "Creates a TIMESTAMP value from a duckdb_timestamp\n\n @param input The duckdb_timestamp value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2585 pub fn duckdb_create_timestamp(input: duckdb_timestamp) -> duckdb_value;
2586}
2587unsafe extern "C" {
2588 #[doc = "Creates a TIMESTAMP_TZ value from a duckdb_timestamp\n\n @param input The duckdb_timestamp value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2589 pub fn duckdb_create_timestamp_tz(input: duckdb_timestamp) -> duckdb_value;
2590}
2591unsafe extern "C" {
2592 #[doc = "Creates a TIMESTAMP_S value from a duckdb_timestamp_s\n\n @param input The duckdb_timestamp_s value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2593 pub fn duckdb_create_timestamp_s(input: duckdb_timestamp_s) -> duckdb_value;
2594}
2595unsafe extern "C" {
2596 #[doc = "Creates a TIMESTAMP_MS value from a duckdb_timestamp_ms\n\n @param input The duckdb_timestamp_ms value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2597 pub fn duckdb_create_timestamp_ms(input: duckdb_timestamp_ms) -> duckdb_value;
2598}
2599unsafe extern "C" {
2600 #[doc = "Creates a TIMESTAMP_NS value from a duckdb_timestamp_ns\n\n @param input The duckdb_timestamp_ns value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2601 pub fn duckdb_create_timestamp_ns(input: duckdb_timestamp_ns) -> duckdb_value;
2602}
2603unsafe extern "C" {
2604 #[doc = "Creates a value from an interval\n\n @param input The interval value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2605 pub fn duckdb_create_interval(input: duckdb_interval) -> duckdb_value;
2606}
2607unsafe extern "C" {
2608 #[doc = "Creates a value from a blob\n\n @param data The blob data\n @param length The length of the blob data\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2609 pub fn duckdb_create_blob(
2610 data: *const u8,
2611 length: idx_t,
2612 ) -> duckdb_value;
2613}
2614unsafe extern "C" {
2615 #[doc = "Creates a BIT value from a duckdb_bit\n\n @param input The duckdb_bit value\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2616 pub fn duckdb_create_bit(input: duckdb_bit) -> duckdb_value;
2617}
2618unsafe extern "C" {
2619 #[doc = "Creates a UUID value from a uhugeint\n\n @param input The duckdb_uhugeint containing the UUID\n @return The value. This must be destroyed with `duckdb_destroy_value`."]
2620 pub fn duckdb_create_uuid(input: duckdb_uhugeint) -> duckdb_value;
2621}
2622unsafe extern "C" {
2623 #[doc = "Returns the boolean value of the given value.\n\n @param val A duckdb_value containing a boolean\n @return A boolean, or false if the value cannot be converted"]
2624 pub fn duckdb_get_bool(val: duckdb_value) -> bool;
2625}
2626unsafe extern "C" {
2627 #[doc = "Returns the int8_t value of the given value.\n\n @param val A duckdb_value containing a tinyint\n @return A int8_t, or MinValue<int8> if the value cannot be converted"]
2628 pub fn duckdb_get_int8(val: duckdb_value) -> i8;
2629}
2630unsafe extern "C" {
2631 #[doc = "Returns the uint8_t value of the given value.\n\n @param val A duckdb_value containing a utinyint\n @return A uint8_t, or MinValue<uint8> if the value cannot be converted"]
2632 pub fn duckdb_get_uint8(val: duckdb_value) -> u8;
2633}
2634unsafe extern "C" {
2635 #[doc = "Returns the int16_t value of the given value.\n\n @param val A duckdb_value containing a smallint\n @return A int16_t, or MinValue<int16> if the value cannot be converted"]
2636 pub fn duckdb_get_int16(val: duckdb_value) -> i16;
2637}
2638unsafe extern "C" {
2639 #[doc = "Returns the uint16_t value of the given value.\n\n @param val A duckdb_value containing a usmallint\n @return A uint16_t, or MinValue<uint16> if the value cannot be converted"]
2640 pub fn duckdb_get_uint16(val: duckdb_value) -> u16;
2641}
2642unsafe extern "C" {
2643 #[doc = "Returns the int32_t value of the given value.\n\n @param val A duckdb_value containing an integer\n @return A int32_t, or MinValue<int32> if the value cannot be converted"]
2644 pub fn duckdb_get_int32(val: duckdb_value) -> i32;
2645}
2646unsafe extern "C" {
2647 #[doc = "Returns the uint32_t value of the given value.\n\n @param val A duckdb_value containing a uinteger\n @return A uint32_t, or MinValue<uint32> if the value cannot be converted"]
2648 pub fn duckdb_get_uint32(val: duckdb_value) -> u32;
2649}
2650unsafe extern "C" {
2651 #[doc = "Returns the int64_t value of the given value.\n\n @param val A duckdb_value containing a bigint\n @return A int64_t, or MinValue<int64> if the value cannot be converted"]
2652 pub fn duckdb_get_int64(val: duckdb_value) -> i64;
2653}
2654unsafe extern "C" {
2655 #[doc = "Returns the uint64_t value of the given value.\n\n @param val A duckdb_value containing a ubigint\n @return A uint64_t, or MinValue<uint64> if the value cannot be converted"]
2656 pub fn duckdb_get_uint64(val: duckdb_value) -> u64;
2657}
2658unsafe extern "C" {
2659 #[doc = "Returns the hugeint value of the given value.\n\n @param val A duckdb_value containing a hugeint\n @return A duckdb_hugeint, or MinValue<hugeint> if the value cannot be converted"]
2660 pub fn duckdb_get_hugeint(val: duckdb_value) -> duckdb_hugeint;
2661}
2662unsafe extern "C" {
2663 #[doc = "Returns the uhugeint value of the given value.\n\n @param val A duckdb_value containing a uhugeint\n @return A duckdb_uhugeint, or MinValue<uhugeint> if the value cannot be converted"]
2664 pub fn duckdb_get_uhugeint(val: duckdb_value) -> duckdb_uhugeint;
2665}
2666unsafe extern "C" {
2667 #[doc = "Returns the duckdb_bignum value of the given value.\nThe `data` field must be destroyed with `duckdb_free`.\n\n @param val A duckdb_value containing a BIGNUM\n @return A duckdb_bignum. The `data` field must be destroyed with `duckdb_free`."]
2668 pub fn duckdb_get_bignum(val: duckdb_value) -> duckdb_bignum;
2669}
2670unsafe extern "C" {
2671 #[doc = "Returns the duckdb_decimal value of the given value.\n\n @param val A duckdb_value containing a DECIMAL\n @return A duckdb_decimal, or MinValue<decimal> if the value cannot be converted"]
2672 pub fn duckdb_get_decimal(val: duckdb_value) -> duckdb_decimal;
2673}
2674unsafe extern "C" {
2675 #[doc = "Returns the float value of the given value.\n\n @param val A duckdb_value containing a float\n @return A float, or NAN if the value cannot be converted"]
2676 pub fn duckdb_get_float(val: duckdb_value) -> f32;
2677}
2678unsafe extern "C" {
2679 #[doc = "Returns the double value of the given value.\n\n @param val A duckdb_value containing a double\n @return A double, or NAN if the value cannot be converted"]
2680 pub fn duckdb_get_double(val: duckdb_value) -> f64;
2681}
2682unsafe extern "C" {
2683 #[doc = "Returns the date value of the given value.\n\n @param val A duckdb_value containing a date\n @return A duckdb_date, or MinValue<date> if the value cannot be converted"]
2684 pub fn duckdb_get_date(val: duckdb_value) -> duckdb_date;
2685}
2686unsafe extern "C" {
2687 #[doc = "Returns the time value of the given value.\n\n @param val A duckdb_value containing a time\n @return A duckdb_time, or MinValue<time> if the value cannot be converted"]
2688 pub fn duckdb_get_time(val: duckdb_value) -> duckdb_time;
2689}
2690unsafe extern "C" {
2691 #[doc = "Returns the time_ns value of the given value.\n\n @param val A duckdb_value containing a time_ns\n @return A duckdb_time_ns, or MinValue<time_ns> if the value cannot be converted"]
2692 pub fn duckdb_get_time_ns(val: duckdb_value) -> duckdb_time_ns;
2693}
2694unsafe extern "C" {
2695 #[doc = "Returns the time_tz value of the given value.\n\n @param val A duckdb_value containing a time_tz\n @return A duckdb_time_tz, or MinValue<time_tz> if the value cannot be converted"]
2696 pub fn duckdb_get_time_tz(val: duckdb_value) -> duckdb_time_tz;
2697}
2698unsafe extern "C" {
2699 #[doc = "Returns the TIMESTAMP value of the given value.\n\n @param val A duckdb_value containing a TIMESTAMP\n @return A duckdb_timestamp, or MinValue<timestamp> if the value cannot be converted"]
2700 pub fn duckdb_get_timestamp(val: duckdb_value) -> duckdb_timestamp;
2701}
2702unsafe extern "C" {
2703 #[doc = "Returns the TIMESTAMP_TZ value of the given value.\n\n @param val A duckdb_value containing a TIMESTAMP_TZ\n @return A duckdb_timestamp, or MinValue<timestamp_tz> if the value cannot be converted"]
2704 pub fn duckdb_get_timestamp_tz(val: duckdb_value) -> duckdb_timestamp;
2705}
2706unsafe extern "C" {
2707 #[doc = "Returns the duckdb_timestamp_s value of the given value.\n\n @param val A duckdb_value containing a TIMESTAMP_S\n @return A duckdb_timestamp_s, or MinValue<timestamp_s> if the value cannot be converted"]
2708 pub fn duckdb_get_timestamp_s(val: duckdb_value) -> duckdb_timestamp_s;
2709}
2710unsafe extern "C" {
2711 #[doc = "Returns the duckdb_timestamp_ms value of the given value.\n\n @param val A duckdb_value containing a TIMESTAMP_MS\n @return A duckdb_timestamp_ms, or MinValue<timestamp_ms> if the value cannot be converted"]
2712 pub fn duckdb_get_timestamp_ms(val: duckdb_value) -> duckdb_timestamp_ms;
2713}
2714unsafe extern "C" {
2715 #[doc = "Returns the duckdb_timestamp_ns value of the given value.\n\n @param val A duckdb_value containing a TIMESTAMP_NS\n @return A duckdb_timestamp_ns, or MinValue<timestamp_ns> if the value cannot be converted"]
2716 pub fn duckdb_get_timestamp_ns(val: duckdb_value) -> duckdb_timestamp_ns;
2717}
2718unsafe extern "C" {
2719 #[doc = "Returns the interval value of the given value.\n\n @param val A duckdb_value containing a interval\n @return A duckdb_interval, or MinValue<interval> if the value cannot be converted"]
2720 pub fn duckdb_get_interval(val: duckdb_value) -> duckdb_interval;
2721}
2722unsafe extern "C" {
2723 #[doc = "Returns the type of the given value. The type is valid as long as the value is not destroyed.\nThe type itself must not be destroyed.\n\n @param val A duckdb_value\n @return A duckdb_logical_type."]
2724 pub fn duckdb_get_value_type(val: duckdb_value) -> duckdb_logical_type;
2725}
2726unsafe extern "C" {
2727 #[doc = "Returns the blob value of the given value.\n\n @param val A duckdb_value containing a blob\n @return A duckdb_blob"]
2728 pub fn duckdb_get_blob(val: duckdb_value) -> duckdb_blob;
2729}
2730unsafe extern "C" {
2731 #[doc = "Returns the duckdb_bit value of the given value.\nThe `data` field must be destroyed with `duckdb_free`.\n\n @param val A duckdb_value containing a BIT\n @return A duckdb_bit"]
2732 pub fn duckdb_get_bit(val: duckdb_value) -> duckdb_bit;
2733}
2734unsafe extern "C" {
2735 #[doc = "Returns a duckdb_uhugeint representing the UUID value of the given value.\n\n @param val A duckdb_value containing a UUID\n @return A duckdb_uhugeint representing the UUID value"]
2736 pub fn duckdb_get_uuid(val: duckdb_value) -> duckdb_uhugeint;
2737}
2738unsafe extern "C" {
2739 #[doc = "Obtains a string representation of the given value.\nThe result must be destroyed with `duckdb_free`.\n\n @param value The value\n @return The string value. This must be destroyed with `duckdb_free`."]
2740 pub fn duckdb_get_varchar(value: duckdb_value) -> *mut ::std::os::raw::c_char;
2741}
2742unsafe extern "C" {
2743 #[doc = "Creates a struct value from a type and an array of values. Must be destroyed with `duckdb_destroy_value`.\n\n @param type The type of the struct\n @param values The values for the struct fields\n @return The struct value, or nullptr, if any child type is `DUCKDB_TYPE_ANY` or `DUCKDB_TYPE_INVALID`."]
2744 pub fn duckdb_create_struct_value(
2745 type_: duckdb_logical_type,
2746 values: *mut duckdb_value,
2747 ) -> duckdb_value;
2748}
2749unsafe extern "C" {
2750 #[doc = "Creates a list value from a child (element) type and an array of values of length `value_count`.\nMust be destroyed with `duckdb_destroy_value`.\n\n @param type The type of the list\n @param values The values for the list\n @param value_count The number of values in the list\n @return The list value, or nullptr, if the child type is `DUCKDB_TYPE_ANY` or `DUCKDB_TYPE_INVALID`."]
2751 pub fn duckdb_create_list_value(
2752 type_: duckdb_logical_type,
2753 values: *mut duckdb_value,
2754 value_count: idx_t,
2755 ) -> duckdb_value;
2756}
2757unsafe extern "C" {
2758 #[doc = "Creates an array value from a child (element) type and an array of values of length `value_count`.\nMust be destroyed with `duckdb_destroy_value`.\n\n @param type The type of the array\n @param values The values for the array\n @param value_count The number of values in the array\n @return The array value, or nullptr, if the child type is `DUCKDB_TYPE_ANY` or `DUCKDB_TYPE_INVALID`."]
2759 pub fn duckdb_create_array_value(
2760 type_: duckdb_logical_type,
2761 values: *mut duckdb_value,
2762 value_count: idx_t,
2763 ) -> duckdb_value;
2764}
2765unsafe extern "C" {
2766 #[doc = "Creates a map value from a map type and two arrays, one for the keys and one for the values, each of length\n`entry_count`. Must be destroyed with `duckdb_destroy_value`.\n\n @param map_type The map type\n @param keys The keys of the map\n @param values The values of the map\n @param entry_count The number of entrys (key-value pairs) in the map\n @return The map value, or nullptr, if the parameters are invalid."]
2767 pub fn duckdb_create_map_value(
2768 map_type: duckdb_logical_type,
2769 keys: *mut duckdb_value,
2770 values: *mut duckdb_value,
2771 entry_count: idx_t,
2772 ) -> duckdb_value;
2773}
2774unsafe extern "C" {
2775 #[doc = "Creates a union value from a union type, a tag index, and a value.\nMust be destroyed with `duckdb_destroy_value`.\n\n @param union_type The union type\n @param tag_index The index of the tag of the union\n @param value The value of the union for that tag\n @return The union value, or nullptr, if the parameters are invalid."]
2776 pub fn duckdb_create_union_value(
2777 union_type: duckdb_logical_type,
2778 tag_index: idx_t,
2779 value: duckdb_value,
2780 ) -> duckdb_value;
2781}
2782unsafe extern "C" {
2783 #[doc = "Returns the number of elements in a MAP value.\n\n @param value The MAP value.\n @return The number of elements in the map."]
2784 pub fn duckdb_get_map_size(value: duckdb_value) -> idx_t;
2785}
2786unsafe extern "C" {
2787 #[doc = "Returns the MAP key at index as a duckdb_value.\n\n @param value The MAP value.\n @param index The index of the key.\n @return The key as a duckdb_value."]
2788 pub fn duckdb_get_map_key(
2789 value: duckdb_value,
2790 index: idx_t,
2791 ) -> duckdb_value;
2792}
2793unsafe extern "C" {
2794 #[doc = "Returns the MAP value at index as a duckdb_value.\n\n @param value The MAP value.\n @param index The index of the value.\n @return The value as a duckdb_value."]
2795 pub fn duckdb_get_map_value(
2796 value: duckdb_value,
2797 index: idx_t,
2798 ) -> duckdb_value;
2799}
2800unsafe extern "C" {
2801 #[doc = "Returns whether the value's type is SQLNULL or not.\n\n @param value The value to check.\n @return True, if the value's type is SQLNULL, otherwise false."]
2802 pub fn duckdb_is_null_value(value: duckdb_value) -> bool;
2803}
2804unsafe extern "C" {
2805 #[doc = "Creates a value of type SQLNULL.\n\n @return The duckdb_value representing SQLNULL. This must be destroyed with `duckdb_destroy_value`."]
2806 pub fn duckdb_create_null_value() -> duckdb_value;
2807}
2808unsafe extern "C" {
2809 #[doc = "Returns the number of elements in a LIST value.\n\n @param value The LIST value.\n @return The number of elements in the list."]
2810 pub fn duckdb_get_list_size(value: duckdb_value) -> idx_t;
2811}
2812unsafe extern "C" {
2813 #[doc = "Returns the LIST child at index as a duckdb_value.\n\n @param value The LIST value.\n @param index The index of the child.\n @return The child as a duckdb_value."]
2814 pub fn duckdb_get_list_child(
2815 value: duckdb_value,
2816 index: idx_t,
2817 ) -> duckdb_value;
2818}
2819unsafe extern "C" {
2820 #[doc = "Creates an enum value from a type and a value. Must be destroyed with `duckdb_destroy_value`.\n\n @param type The type of the enum\n @param value The value for the enum\n @return The enum value, or nullptr."]
2821 pub fn duckdb_create_enum_value(
2822 type_: duckdb_logical_type,
2823 value: u64,
2824 ) -> duckdb_value;
2825}
2826unsafe extern "C" {
2827 #[doc = "Returns the enum value of the given value.\n\n @param value A duckdb_value containing an enum\n @return A uint64_t, or MinValue<uint64> if the value cannot be converted"]
2828 pub fn duckdb_get_enum_value(value: duckdb_value) -> u64;
2829}
2830unsafe extern "C" {
2831 #[doc = "Returns the STRUCT child at index as a duckdb_value.\n\n @param value The STRUCT value.\n @param index The index of the child.\n @return The child as a duckdb_value."]
2832 pub fn duckdb_get_struct_child(
2833 value: duckdb_value,
2834 index: idx_t,
2835 ) -> duckdb_value;
2836}
2837unsafe extern "C" {
2838 #[doc = "Returns the SQL string representation of the given value.\n\n @param value A duckdb_value.\n @return The SQL string representation as a null-terminated string. The result must be freed with `duckdb_free`."]
2839 pub fn duckdb_value_to_string(value: duckdb_value) -> *mut ::std::os::raw::c_char;
2840}
2841unsafe extern "C" {
2842 #[doc = "Creates a `duckdb_logical_type` from a primitive type.\nThe resulting logical type must be destroyed with `duckdb_destroy_logical_type`.\n\nReturns an invalid logical type, if type is: `DUCKDB_TYPE_INVALID`, `DUCKDB_TYPE_DECIMAL`, `DUCKDB_TYPE_ENUM`,\n`DUCKDB_TYPE_LIST`, `DUCKDB_TYPE_STRUCT`, `DUCKDB_TYPE_MAP`, `DUCKDB_TYPE_ARRAY`, or `DUCKDB_TYPE_UNION`.\n\n @param type The primitive type to create.\n @return The logical type."]
2843 pub fn duckdb_create_logical_type(type_: duckdb_type) -> duckdb_logical_type;
2844}
2845unsafe extern "C" {
2846 #[doc = "Returns the alias of a duckdb_logical_type, if set, else `nullptr`.\nThe result must be destroyed with `duckdb_free`.\n\n @param type The logical type\n @return The alias or `nullptr`"]
2847 pub fn duckdb_logical_type_get_alias(type_: duckdb_logical_type)
2848 -> *mut ::std::os::raw::c_char;
2849}
2850unsafe extern "C" {
2851 #[doc = "Sets the alias of a duckdb_logical_type.\n\n @param type The logical type\n @param alias The alias to set"]
2852 pub fn duckdb_logical_type_set_alias(
2853 type_: duckdb_logical_type,
2854 alias: *const ::std::os::raw::c_char,
2855 );
2856}
2857unsafe extern "C" {
2858 #[doc = "Creates a LIST type from its child type.\nThe return type must be destroyed with `duckdb_destroy_logical_type`.\n\n @param type The child type of the list\n @return The logical type."]
2859 pub fn duckdb_create_list_type(type_: duckdb_logical_type) -> duckdb_logical_type;
2860}
2861unsafe extern "C" {
2862 #[doc = "Creates an ARRAY type from its child type.\nThe return type must be destroyed with `duckdb_destroy_logical_type`.\n\n @param type The child type of the array.\n @param array_size The number of elements in the array.\n @return The logical type."]
2863 pub fn duckdb_create_array_type(
2864 type_: duckdb_logical_type,
2865 array_size: idx_t,
2866 ) -> duckdb_logical_type;
2867}
2868unsafe extern "C" {
2869 #[doc = "Creates a MAP type from its key type and value type.\nThe return type must be destroyed with `duckdb_destroy_logical_type`.\n\n @param key_type The map's key type.\n @param value_type The map's value type.\n @return The logical type."]
2870 pub fn duckdb_create_map_type(
2871 key_type: duckdb_logical_type,
2872 value_type: duckdb_logical_type,
2873 ) -> duckdb_logical_type;
2874}
2875unsafe extern "C" {
2876 #[doc = "Creates a UNION type from the passed arrays.\nThe return type must be destroyed with `duckdb_destroy_logical_type`.\n\n @param member_types The array of union member types.\n @param member_names The union member names.\n @param member_count The number of union members.\n @return The logical type."]
2877 pub fn duckdb_create_union_type(
2878 member_types: *mut duckdb_logical_type,
2879 member_names: *mut *const ::std::os::raw::c_char,
2880 member_count: idx_t,
2881 ) -> duckdb_logical_type;
2882}
2883unsafe extern "C" {
2884 #[doc = "Creates a STRUCT type based on the member types and names.\nThe resulting type must be destroyed with `duckdb_destroy_logical_type`.\n\n @param member_types The array of types of the struct members.\n @param member_names The array of names of the struct members.\n @param member_count The number of members of the struct.\n @return The logical type."]
2885 pub fn duckdb_create_struct_type(
2886 member_types: *mut duckdb_logical_type,
2887 member_names: *mut *const ::std::os::raw::c_char,
2888 member_count: idx_t,
2889 ) -> duckdb_logical_type;
2890}
2891unsafe extern "C" {
2892 #[doc = "Creates an ENUM type from the passed member name array.\nThe resulting type should be destroyed with `duckdb_destroy_logical_type`.\n\n @param member_names The array of names that the enum should consist of.\n @param member_count The number of elements that were specified in the array.\n @return The logical type."]
2893 pub fn duckdb_create_enum_type(
2894 member_names: *mut *const ::std::os::raw::c_char,
2895 member_count: idx_t,
2896 ) -> duckdb_logical_type;
2897}
2898unsafe extern "C" {
2899 #[doc = "Creates a DECIMAL type with the specified width and scale.\nThe resulting type should be destroyed with `duckdb_destroy_logical_type`.\n\n @param width The width of the decimal type. Must be between 1 and 38.\n @param scale The scale of the decimal type. Must not exceed the width.\n @return The logical type, or `nullptr` if the width or scale are out of range."]
2900 pub fn duckdb_create_decimal_type(
2901 width: u8,
2902 scale: u8,
2903 ) -> duckdb_logical_type;
2904}
2905unsafe extern "C" {
2906 #[doc = "Retrieves the enum `duckdb_type` of a `duckdb_logical_type`.\n\n @param type The logical type.\n @return The `duckdb_type` id."]
2907 pub fn duckdb_get_type_id(type_: duckdb_logical_type) -> duckdb_type;
2908}
2909unsafe extern "C" {
2910 #[doc = "Retrieves the width of a decimal type.\n\n @param type The logical type object\n @return The width of the decimal type"]
2911 pub fn duckdb_decimal_width(type_: duckdb_logical_type) -> u8;
2912}
2913unsafe extern "C" {
2914 #[doc = "Retrieves the scale of a decimal type.\n\n @param type The logical type object\n @return The scale of the decimal type"]
2915 pub fn duckdb_decimal_scale(type_: duckdb_logical_type) -> u8;
2916}
2917unsafe extern "C" {
2918 #[doc = "Retrieves the internal storage type of a decimal type.\n\n @param type The logical type object\n @return The internal type of the decimal type"]
2919 pub fn duckdb_decimal_internal_type(type_: duckdb_logical_type) -> duckdb_type;
2920}
2921unsafe extern "C" {
2922 #[doc = "Retrieves the internal storage type of an enum type.\n\n @param type The logical type object\n @return The internal type of the enum type"]
2923 pub fn duckdb_enum_internal_type(type_: duckdb_logical_type) -> duckdb_type;
2924}
2925unsafe extern "C" {
2926 #[doc = "Retrieves the dictionary size of the enum type.\n\n @param type The logical type object\n @return The dictionary size of the enum type"]
2927 pub fn duckdb_enum_dictionary_size(type_: duckdb_logical_type) -> u32;
2928}
2929unsafe extern "C" {
2930 #[doc = "Retrieves the dictionary value at the specified position from the enum.\n\nThe result must be freed with `duckdb_free`.\n\n @param type The logical type object\n @param index The index in the dictionary\n @return The string value of the enum type. Must be freed with `duckdb_free`."]
2931 pub fn duckdb_enum_dictionary_value(
2932 type_: duckdb_logical_type,
2933 index: idx_t,
2934 ) -> *mut ::std::os::raw::c_char;
2935}
2936unsafe extern "C" {
2937 #[doc = "Retrieves the child type of the given LIST type. Also accepts MAP types.\nThe result must be freed with `duckdb_destroy_logical_type`.\n\n @param type The logical type, either LIST or MAP.\n @return The child type of the LIST or MAP type."]
2938 pub fn duckdb_list_type_child_type(type_: duckdb_logical_type) -> duckdb_logical_type;
2939}
2940unsafe extern "C" {
2941 #[doc = "Retrieves the child type of the given ARRAY type.\n\nThe result must be freed with `duckdb_destroy_logical_type`.\n\n @param type The logical type. Must be ARRAY.\n @return The child type of the ARRAY type."]
2942 pub fn duckdb_array_type_child_type(type_: duckdb_logical_type) -> duckdb_logical_type;
2943}
2944unsafe extern "C" {
2945 #[doc = "Retrieves the array size of the given array type.\n\n @param type The logical type object\n @return The fixed number of elements the values of this array type can store."]
2946 pub fn duckdb_array_type_array_size(type_: duckdb_logical_type) -> idx_t;
2947}
2948unsafe extern "C" {
2949 #[doc = "Retrieves the key type of the given map type.\n\nThe result must be freed with `duckdb_destroy_logical_type`.\n\n @param type The logical type object\n @return The key type of the map type. Must be destroyed with `duckdb_destroy_logical_type`."]
2950 pub fn duckdb_map_type_key_type(type_: duckdb_logical_type) -> duckdb_logical_type;
2951}
2952unsafe extern "C" {
2953 #[doc = "Retrieves the value type of the given map type.\n\nThe result must be freed with `duckdb_destroy_logical_type`.\n\n @param type The logical type object\n @return The value type of the map type. Must be destroyed with `duckdb_destroy_logical_type`."]
2954 pub fn duckdb_map_type_value_type(type_: duckdb_logical_type) -> duckdb_logical_type;
2955}
2956unsafe extern "C" {
2957 #[doc = "Returns the number of children of a struct type.\n\n @param type The logical type object\n @return The number of children of a struct type."]
2958 pub fn duckdb_struct_type_child_count(type_: duckdb_logical_type) -> idx_t;
2959}
2960unsafe extern "C" {
2961 #[doc = "Retrieves the name of the struct child.\n\nThe result must be freed with `duckdb_free`.\n\n @param type The logical type object\n @param index The child index\n @return The name of the struct type. Must be freed with `duckdb_free`."]
2962 pub fn duckdb_struct_type_child_name(
2963 type_: duckdb_logical_type,
2964 index: idx_t,
2965 ) -> *mut ::std::os::raw::c_char;
2966}
2967unsafe extern "C" {
2968 #[doc = "Retrieves the child type of the given struct type at the specified index.\n\nThe result must be freed with `duckdb_destroy_logical_type`.\n\n @param type The logical type object\n @param index The child index\n @return The child type of the struct type. Must be destroyed with `duckdb_destroy_logical_type`."]
2969 pub fn duckdb_struct_type_child_type(
2970 type_: duckdb_logical_type,
2971 index: idx_t,
2972 ) -> duckdb_logical_type;
2973}
2974unsafe extern "C" {
2975 #[doc = "Returns the number of members that the union type has.\n\n @param type The logical type (union) object\n @return The number of members of a union type."]
2976 pub fn duckdb_union_type_member_count(type_: duckdb_logical_type) -> idx_t;
2977}
2978unsafe extern "C" {
2979 #[doc = "Retrieves the name of the union member.\n\nThe result must be freed with `duckdb_free`.\n\n @param type The logical type object\n @param index The child index\n @return The name of the union member. Must be freed with `duckdb_free`."]
2980 pub fn duckdb_union_type_member_name(
2981 type_: duckdb_logical_type,
2982 index: idx_t,
2983 ) -> *mut ::std::os::raw::c_char;
2984}
2985unsafe extern "C" {
2986 #[doc = "Retrieves the child type of the given union member at the specified index.\n\nThe result must be freed with `duckdb_destroy_logical_type`.\n\n @param type The logical type object\n @param index The child index\n @return The child type of the union member. Must be destroyed with `duckdb_destroy_logical_type`."]
2987 pub fn duckdb_union_type_member_type(
2988 type_: duckdb_logical_type,
2989 index: idx_t,
2990 ) -> duckdb_logical_type;
2991}
2992unsafe extern "C" {
2993 #[doc = "Destroys the logical type and de-allocates all memory allocated for that type.\n\n @param type The logical type to destroy."]
2994 pub fn duckdb_destroy_logical_type(type_: *mut duckdb_logical_type);
2995}
2996unsafe extern "C" {
2997 #[doc = "Registers a custom type within the given connection.\nThe type must have an alias\n\n @param con The connection to use\n @param type The custom type to register\n @return Whether or not the registration was successful."]
2998 pub fn duckdb_register_logical_type(
2999 con: duckdb_connection,
3000 type_: duckdb_logical_type,
3001 info: duckdb_create_type_info,
3002 ) -> duckdb_state;
3003}
3004unsafe extern "C" {
3005 #[doc = "Creates an empty data chunk with the specified column types.\nThe result must be destroyed with `duckdb_destroy_data_chunk`.\n\n @param types An array of column types. Column types can not contain ANY and INVALID types.\n @param column_count The number of columns.\n @return The data chunk."]
3006 pub fn duckdb_create_data_chunk(
3007 types: *mut duckdb_logical_type,
3008 column_count: idx_t,
3009 ) -> duckdb_data_chunk;
3010}
3011unsafe extern "C" {
3012 #[doc = "Destroys the data chunk and de-allocates all memory allocated for that chunk.\n\n @param chunk The data chunk to destroy."]
3013 pub fn duckdb_destroy_data_chunk(chunk: *mut duckdb_data_chunk);
3014}
3015unsafe extern "C" {
3016 #[doc = "Resets a data chunk, clearing the validity masks and setting the cardinality of the data chunk to 0.\nAfter calling this method, you must call `duckdb_vector_get_validity` and `duckdb_vector_get_data` to obtain current\ndata and validity pointers\n\n @param chunk The data chunk to reset."]
3017 pub fn duckdb_data_chunk_reset(chunk: duckdb_data_chunk);
3018}
3019unsafe extern "C" {
3020 #[doc = "Retrieves the number of columns in a data chunk.\n\n @param chunk The data chunk to get the data from\n @return The number of columns in the data chunk"]
3021 pub fn duckdb_data_chunk_get_column_count(chunk: duckdb_data_chunk) -> idx_t;
3022}
3023unsafe extern "C" {
3024 #[doc = "Retrieves the vector at the specified column index in the data chunk.\n\nThe pointer to the vector is valid for as long as the chunk is alive.\nIt does NOT need to be destroyed.\n\n @param chunk The data chunk to get the data from\n @return The vector"]
3025 pub fn duckdb_data_chunk_get_vector(
3026 chunk: duckdb_data_chunk,
3027 col_idx: idx_t,
3028 ) -> duckdb_vector;
3029}
3030unsafe extern "C" {
3031 #[doc = "Retrieves the current number of tuples in a data chunk.\n\n @param chunk The data chunk to get the data from\n @return The number of tuples in the data chunk"]
3032 pub fn duckdb_data_chunk_get_size(chunk: duckdb_data_chunk) -> idx_t;
3033}
3034unsafe extern "C" {
3035 #[doc = "Sets the current number of tuples in a data chunk.\n\n @param chunk The data chunk to set the size in\n @param size The number of tuples in the data chunk"]
3036 pub fn duckdb_data_chunk_set_size(
3037 chunk: duckdb_data_chunk,
3038 size: idx_t,
3039 );
3040}
3041unsafe extern "C" {
3042 #[doc = "Creates a flat vector. Must be destroyed with `duckdb_destroy_vector`.\n\n @param type The logical type of the vector.\n @param capacity The capacity of the vector.\n @return The vector."]
3043 pub fn duckdb_create_vector(
3044 type_: duckdb_logical_type,
3045 capacity: idx_t,
3046 ) -> duckdb_vector;
3047}
3048unsafe extern "C" {
3049 #[doc = "Destroys the vector and de-allocates its memory.\n\n @param vector A pointer to the vector."]
3050 pub fn duckdb_destroy_vector(vector: *mut duckdb_vector);
3051}
3052unsafe extern "C" {
3053 #[doc = "Retrieves the column type of the specified vector.\n\nThe result must be destroyed with `duckdb_destroy_logical_type`.\n\n @param vector The vector get the data from\n @return The type of the vector"]
3054 pub fn duckdb_vector_get_column_type(vector: duckdb_vector) -> duckdb_logical_type;
3055}
3056unsafe extern "C" {
3057 #[doc = "Retrieves the data pointer of the vector.\n\nThe data pointer can be used to read or write values from the vector.\nHow to read or write values depends on the type of the vector.\n\n @param vector The vector to get the data from\n @return The data pointer"]
3058 pub fn duckdb_vector_get_data(vector: duckdb_vector) -> *mut ::std::os::raw::c_void;
3059}
3060unsafe extern "C" {
3061 #[doc = "Retrieves the validity mask pointer of the specified vector.\n\nIf all values are valid, this function MIGHT return NULL!\n\nThe validity mask is a bitset that signifies null-ness within the data chunk.\nIt is a series of uint64_t values, where each uint64_t value contains validity for 64 tuples.\nThe bit is set to 1 if the value is valid (i.e. not NULL) or 0 if the value is invalid (i.e. NULL).\n\nValidity of a specific value can be obtained like this:\n\nidx_t entry_idx = row_idx / 64;\nidx_t idx_in_entry = row_idx % 64;\nbool is_valid = validity_mask[entry_idx] & (1 << idx_in_entry);\n\nAlternatively, the (slower) duckdb_validity_row_is_valid function can be used.\n\n @param vector The vector to get the data from\n @return The pointer to the validity mask, or NULL if no validity mask is present"]
3062 pub fn duckdb_vector_get_validity(vector: duckdb_vector) -> *mut u64;
3063}
3064unsafe extern "C" {
3065 #[doc = "Ensures the validity mask is writable by allocating it.\n\nAfter this function is called, `duckdb_vector_get_validity` will ALWAYS return non-NULL.\nThis allows NULL values to be written to the vector, regardless of whether a validity mask was present before.\n\n @param vector The vector to alter"]
3066 pub fn duckdb_vector_ensure_validity_writable(vector: duckdb_vector);
3067}
3068unsafe extern "C" {
3069 #[doc = "Assigns a string element in the vector at the specified location. For VARCHAR vectors, the input is validated as UTF-8;\nif invalid, a NULL value is assigned at that index.\n\nSuperseded by `duckdb_unsafe_vector_assign_string_element_len`, optionally combined with `duckdb_valid_utf8_check`.\n\n @param vector The vector to alter\n @param index The row position in the vector to assign the string to\n @param str The null-terminated string"]
3070 pub fn duckdb_vector_assign_string_element(
3071 vector: duckdb_vector,
3072 index: idx_t,
3073 str_: *const ::std::os::raw::c_char,
3074 );
3075}
3076unsafe extern "C" {
3077 #[doc = "Assigns a string element in the vector at the specified location. For VARCHAR vectors, the input is validated as UTF-8;\nif invalid, a NULL value is assigned at that index. For BLOB vectors, no validation is performed.\n\nSuperseded by `duckdb_unsafe_vector_assign_string_element_len`, optionally combined with `duckdb_valid_utf8_check`.\n\n @param vector The vector to alter\n @param index The row position in the vector to assign the string to\n @param str The string\n @param str_len The length of the string (in bytes)"]
3078 pub fn duckdb_vector_assign_string_element_len(
3079 vector: duckdb_vector,
3080 index: idx_t,
3081 str_: *const ::std::os::raw::c_char,
3082 str_len: idx_t,
3083 );
3084}
3085unsafe extern "C" {
3086 #[doc = "Assigns a string element in the vector at the specified location without UTF-8 validation. The caller is responsible for\nensuring the input is valid UTF-8. Use `duckdb_valid_utf8_check` to validate strings before calling this function if\nneeded. If the input is known to be valid UTF-8, this function can be called directly for better performance, avoiding\nthe overhead of redundant validation.\n\n @param vector The vector to alter\n @param index The row position in the vector to assign the string to\n @param str The string\n @param str_len The length of the string (in bytes)"]
3087 pub fn duckdb_unsafe_vector_assign_string_element_len(
3088 vector: duckdb_vector,
3089 index: idx_t,
3090 str_: *const ::std::os::raw::c_char,
3091 str_len: idx_t,
3092 );
3093}
3094unsafe extern "C" {
3095 #[doc = "Retrieves the child vector of a list vector.\n\nThe resulting vector is valid as long as the parent vector is valid.\n\n @param vector The vector\n @return The child vector"]
3096 pub fn duckdb_list_vector_get_child(vector: duckdb_vector) -> duckdb_vector;
3097}
3098unsafe extern "C" {
3099 #[doc = "Returns the size of the child vector of the list.\n\n @param vector The vector\n @return The size of the child list"]
3100 pub fn duckdb_list_vector_get_size(vector: duckdb_vector) -> idx_t;
3101}
3102unsafe extern "C" {
3103 #[doc = "Sets the size of the underlying child-vector of a list vector.\nNote that this does NOT reserve the memory in the child buffer,\nand that it is possible to set a size exceeding the capacity.\nTo set the capacity, use `duckdb_list_vector_reserve`.\n\n @param vector The list vector.\n @param size The size of the child list.\n @return The duckdb state. Returns DuckDBError, if the vector is nullptr."]
3104 pub fn duckdb_list_vector_set_size(
3105 vector: duckdb_vector,
3106 size: idx_t,
3107 ) -> duckdb_state;
3108}
3109unsafe extern "C" {
3110 #[doc = "Sets the capacity of the underlying child-vector of a list vector.\nWe increment to the next power of two, based on the required capacity.\nThus, the capacity might not match the size of the list (capacity >= size),\nwhich is set via `duckdb_list_vector_set_size`.\n\n @param vector The list vector.\n @param required_capacity The child buffer capacity to reserve.\n @return The duckdb state. Returns DuckDBError, if the vector is nullptr."]
3111 pub fn duckdb_list_vector_reserve(
3112 vector: duckdb_vector,
3113 required_capacity: idx_t,
3114 ) -> duckdb_state;
3115}
3116unsafe extern "C" {
3117 #[doc = "Retrieves the child vector of a struct vector.\nThe resulting vector is valid as long as the parent vector is valid.\n\n @param vector The vector\n @param index The child index\n @return The child vector"]
3118 pub fn duckdb_struct_vector_get_child(
3119 vector: duckdb_vector,
3120 index: idx_t,
3121 ) -> duckdb_vector;
3122}
3123unsafe extern "C" {
3124 #[doc = "Retrieves the child vector of an array vector.\nThe resulting vector is valid as long as the parent vector is valid.\nThe resulting vector has the size of the parent vector multiplied by the array size.\n\n @param vector The vector\n @return The child vector"]
3125 pub fn duckdb_array_vector_get_child(vector: duckdb_vector) -> duckdb_vector;
3126}
3127unsafe extern "C" {
3128 #[doc = "Slice a vector with a selection vector.\nThe length of the selection vector must be less than or equal to the length of the vector.\nTurns the vector into a dictionary vector.\n\n @param vector The vector to slice.\n @param sel The selection vector.\n @param len The length of the selection vector."]
3129 pub fn duckdb_slice_vector(
3130 vector: duckdb_vector,
3131 sel: duckdb_selection_vector,
3132 len: idx_t,
3133 );
3134}
3135unsafe extern "C" {
3136 #[doc = "Copy the src vector to the dst with a selection vector that identifies which indices to copy.\n\n @param src The vector to copy from.\n @param dst The vector to copy to.\n @param sel The selection vector. The length of the selection vector should not be more than the length of the src\nvector\n @param src_count The number of entries from selection vector to copy. Think of this as the effective length of the\nselection vector starting from index 0\n @param src_offset The offset in the selection vector to copy from (important: actual number of items copied =\nsrc_count - src_offset).\n @param dst_offset The offset in the dst vector to start copying to."]
3137 pub fn duckdb_vector_copy_sel(
3138 src: duckdb_vector,
3139 dst: duckdb_vector,
3140 sel: duckdb_selection_vector,
3141 src_count: idx_t,
3142 src_offset: idx_t,
3143 dst_offset: idx_t,
3144 );
3145}
3146unsafe extern "C" {
3147 #[doc = "Copies the value from `value` to `vector`.\n\n @param vector The receiving vector.\n @param value The value to copy into the vector."]
3148 pub fn duckdb_vector_reference_value(
3149 vector: duckdb_vector,
3150 value: duckdb_value,
3151 );
3152}
3153unsafe extern "C" {
3154 #[doc = "Changes `to_vector` to reference `from_vector. After, the vectors share ownership of the data.\n\n @param to_vector The receiving vector.\n @param from_vector The vector to reference."]
3155 pub fn duckdb_vector_reference_vector(
3156 to_vector: duckdb_vector,
3157 from_vector: duckdb_vector,
3158 );
3159}
3160unsafe extern "C" {
3161 #[doc = "Returns whether or not a row is valid (i.e. not NULL) in the given validity mask.\n\n @param validity The validity mask, as obtained through `duckdb_vector_get_validity`\n @param row The row index\n @return true if the row is valid, false otherwise"]
3162 pub fn duckdb_validity_row_is_valid(
3163 validity: *mut u64,
3164 row: idx_t,
3165 ) -> bool;
3166}
3167unsafe extern "C" {
3168 #[doc = "In a validity mask, sets a specific row to either valid or invalid.\n\nNote that `duckdb_vector_ensure_validity_writable` should be called before calling `duckdb_vector_get_validity`,\nto ensure that there is a validity mask to write to.\n\n @param validity The validity mask, as obtained through `duckdb_vector_get_validity`.\n @param row The row index\n @param valid Whether or not to set the row to valid, or invalid"]
3169 pub fn duckdb_validity_set_row_validity(
3170 validity: *mut u64,
3171 row: idx_t,
3172 valid: bool,
3173 );
3174}
3175unsafe extern "C" {
3176 #[doc = "In a validity mask, sets a specific row to invalid.\n\nEquivalent to `duckdb_validity_set_row_validity` with valid set to false.\n\n @param validity The validity mask\n @param row The row index"]
3177 pub fn duckdb_validity_set_row_invalid(
3178 validity: *mut u64,
3179 row: idx_t,
3180 );
3181}
3182unsafe extern "C" {
3183 #[doc = "In a validity mask, sets a specific row to valid.\n\nEquivalent to `duckdb_validity_set_row_validity` with valid set to true.\n\n @param validity The validity mask\n @param row The row index"]
3184 pub fn duckdb_validity_set_row_valid(
3185 validity: *mut u64,
3186 row: idx_t,
3187 );
3188}
3189unsafe extern "C" {
3190 #[doc = "Creates a new empty scalar function.\n\nThe return value must be destroyed with `duckdb_destroy_scalar_function`.\n\n @return The scalar function object."]
3191 pub fn duckdb_create_scalar_function() -> duckdb_scalar_function;
3192}
3193unsafe extern "C" {
3194 #[doc = "Destroys the given scalar function object.\n\n @param scalar_function The scalar function to destroy"]
3195 pub fn duckdb_destroy_scalar_function(scalar_function: *mut duckdb_scalar_function);
3196}
3197unsafe extern "C" {
3198 #[doc = "Sets the name of the given scalar function.\n\n @param scalar_function The scalar function\n @param name The name of the scalar function"]
3199 pub fn duckdb_scalar_function_set_name(
3200 scalar_function: duckdb_scalar_function,
3201 name: *const ::std::os::raw::c_char,
3202 );
3203}
3204unsafe extern "C" {
3205 #[doc = "Sets the parameters of the given scalar function to varargs. Does not require adding parameters with\nduckdb_scalar_function_add_parameter.\n\n @param scalar_function The scalar function.\n @param type The type of the arguments.\n @return The parameter type. Cannot contain INVALID."]
3206 pub fn duckdb_scalar_function_set_varargs(
3207 scalar_function: duckdb_scalar_function,
3208 type_: duckdb_logical_type,
3209 );
3210}
3211unsafe extern "C" {
3212 #[doc = "Sets the scalar function's null-handling behavior to special.\n\n @param scalar_function The scalar function."]
3213 pub fn duckdb_scalar_function_set_special_handling(scalar_function: duckdb_scalar_function);
3214}
3215unsafe extern "C" {
3216 #[doc = "Sets the Function Stability of the scalar function to VOLATILE, indicating the function should be re-run for every row.\nThis limits optimization that can be performed for the function.\n\n @param scalar_function The scalar function."]
3217 pub fn duckdb_scalar_function_set_volatile(scalar_function: duckdb_scalar_function);
3218}
3219unsafe extern "C" {
3220 #[doc = "Adds a parameter to the scalar function.\n\n @param scalar_function The scalar function.\n @param type The parameter type. Cannot contain INVALID."]
3221 pub fn duckdb_scalar_function_add_parameter(
3222 scalar_function: duckdb_scalar_function,
3223 type_: duckdb_logical_type,
3224 );
3225}
3226unsafe extern "C" {
3227 #[doc = "Sets the return type of the scalar function.\n\n @param scalar_function The scalar function\n @param type Cannot contain INVALID or ANY."]
3228 pub fn duckdb_scalar_function_set_return_type(
3229 scalar_function: duckdb_scalar_function,
3230 type_: duckdb_logical_type,
3231 );
3232}
3233unsafe extern "C" {
3234 #[doc = "Assigns extra information to the scalar function that can be fetched during binding, etc.\n\n @param scalar_function The scalar function\n @param extra_info The extra information\n @param destroy The callback that will be called to destroy the extra information (if any)"]
3235 pub fn duckdb_scalar_function_set_extra_info(
3236 scalar_function: duckdb_scalar_function,
3237 extra_info: *mut ::std::os::raw::c_void,
3238 destroy: duckdb_delete_callback_t,
3239 );
3240}
3241unsafe extern "C" {
3242 #[doc = "Sets the (optional) bind function of the scalar function.\n\n @param scalar_function The scalar function.\n @param bind The bind function."]
3243 pub fn duckdb_scalar_function_set_bind(
3244 scalar_function: duckdb_scalar_function,
3245 bind: duckdb_scalar_function_bind_t,
3246 );
3247}
3248unsafe extern "C" {
3249 #[doc = "Sets the user-provided bind data in the bind object of the scalar function.\nThe bind data object can be retrieved again during execution.\nIn most case, you also need to set the copy-callback of your bind data via duckdb_scalar_function_set_bind_data_copy.\n\n @param info The bind info of the scalar function.\n @param bind_data The bind data object.\n @param destroy The callback to destroy the bind data (if any)."]
3250 pub fn duckdb_scalar_function_set_bind_data(
3251 info: duckdb_bind_info,
3252 bind_data: *mut ::std::os::raw::c_void,
3253 destroy: duckdb_delete_callback_t,
3254 );
3255}
3256unsafe extern "C" {
3257 #[doc = "Sets the copy-callback for the user-provided bind data in the bind object of the scalar function.\n\n @param info The bind info of the scalar function.\n @param copy The callback to copy the bind data (if any)."]
3258 pub fn duckdb_scalar_function_set_bind_data_copy(
3259 info: duckdb_bind_info,
3260 copy: duckdb_copy_callback_t,
3261 );
3262}
3263unsafe extern "C" {
3264 #[doc = "Report that an error has occurred while calling bind on a scalar function.\n\n @param info The bind info object.\n @param error The error message."]
3265 pub fn duckdb_scalar_function_bind_set_error(
3266 info: duckdb_bind_info,
3267 error: *const ::std::os::raw::c_char,
3268 );
3269}
3270unsafe extern "C" {
3271 #[doc = "Sets the main function of the scalar function.\n\n @param scalar_function The scalar function\n @param function The function"]
3272 pub fn duckdb_scalar_function_set_function(
3273 scalar_function: duckdb_scalar_function,
3274 function: duckdb_scalar_function_t,
3275 );
3276}
3277unsafe extern "C" {
3278 #[doc = "Register the scalar function object within the given connection.\n\nThe function requires at least a name, a function and a return type.\n\nIf the function is incomplete or a function with this name already exists DuckDBError is returned.\n\n @param con The connection to register it in.\n @param scalar_function The function pointer\n @return Whether or not the registration was successful."]
3279 pub fn duckdb_register_scalar_function(
3280 con: duckdb_connection,
3281 scalar_function: duckdb_scalar_function,
3282 ) -> duckdb_state;
3283}
3284unsafe extern "C" {
3285 #[doc = "Retrieves the extra info of the function as set in `duckdb_scalar_function_set_extra_info`.\n\n @param info The info object.\n @return The extra info."]
3286 pub fn duckdb_scalar_function_get_extra_info(
3287 info: duckdb_function_info
3288 ) -> *mut ::std::os::raw::c_void;
3289}
3290unsafe extern "C" {
3291 #[doc = "Retrieves the extra info of the function as set in the bind info.\n\n @param info The info object.\n @return The extra info."]
3292 pub fn duckdb_scalar_function_bind_get_extra_info(
3293 info: duckdb_bind_info
3294 ) -> *mut ::std::os::raw::c_void;
3295}
3296unsafe extern "C" {
3297 #[doc = "Gets the scalar function's bind data set by `duckdb_scalar_function_set_bind_data`.\nNote that the bind data is read-only.\n\n @param info The function info.\n @return The bind data object."]
3298 pub fn duckdb_scalar_function_get_bind_data(
3299 info: duckdb_function_info
3300 ) -> *mut ::std::os::raw::c_void;
3301}
3302unsafe extern "C" {
3303 #[doc = "Retrieves the client context of the bind info of a scalar function.\n\n @param info The bind info object of the scalar function.\n @param out_context The client context of the bind info. Must be destroyed with `duckdb_destroy_client_context`."]
3304 pub fn duckdb_scalar_function_get_client_context(
3305 info: duckdb_bind_info,
3306 out_context: *mut duckdb_client_context,
3307 );
3308}
3309unsafe extern "C" {
3310 #[doc = "Report that an error has occurred while executing the scalar function.\n\n @param info The info object.\n @param error The error message"]
3311 pub fn duckdb_scalar_function_set_error(
3312 info: duckdb_function_info,
3313 error: *const ::std::os::raw::c_char,
3314 );
3315}
3316unsafe extern "C" {
3317 #[doc = "Creates a new empty scalar function set.\n\nThe return value must be destroyed with `duckdb_destroy_scalar_function_set`.\n\n @return The scalar function set object."]
3318 pub fn duckdb_create_scalar_function_set(
3319 name: *const ::std::os::raw::c_char
3320 ) -> duckdb_scalar_function_set;
3321}
3322unsafe extern "C" {
3323 #[doc = "Destroys the given scalar function set object."]
3324 pub fn duckdb_destroy_scalar_function_set(scalar_function_set: *mut duckdb_scalar_function_set);
3325}
3326unsafe extern "C" {
3327 #[doc = "Adds the scalar function as a new overload to the scalar function set.\n\nReturns DuckDBError if the function could not be added, for example if the overload already exists.\n\n @param set The scalar function set\n @param function The function to add"]
3328 pub fn duckdb_add_scalar_function_to_set(
3329 set: duckdb_scalar_function_set,
3330 function: duckdb_scalar_function,
3331 ) -> duckdb_state;
3332}
3333unsafe extern "C" {
3334 #[doc = "Register the scalar function set within the given connection.\n\nThe set requires at least a single valid overload.\n\nIf the set is incomplete or a function with this name already exists DuckDBError is returned.\n\n @param con The connection to register it in.\n @param set The function set to register\n @return Whether or not the registration was successful."]
3335 pub fn duckdb_register_scalar_function_set(
3336 con: duckdb_connection,
3337 set: duckdb_scalar_function_set,
3338 ) -> duckdb_state;
3339}
3340unsafe extern "C" {
3341 #[doc = "Returns the number of input arguments of the scalar function.\n\n @param info The bind info.\n @return The number of input arguments."]
3342 pub fn duckdb_scalar_function_bind_get_argument_count(info: duckdb_bind_info) -> idx_t;
3343}
3344unsafe extern "C" {
3345 #[doc = "Returns the input argument at index of the scalar function.\n\n @param info The bind info.\n @param index The argument index.\n @return The input argument at index. Must be destroyed with `duckdb_destroy_expression`."]
3346 pub fn duckdb_scalar_function_bind_get_argument(
3347 info: duckdb_bind_info,
3348 index: idx_t,
3349 ) -> duckdb_expression;
3350}
3351unsafe extern "C" {
3352 #[doc = "Retrieves the state pointer of the function info.\n\n @param info The function info object.\n @return The state pointer."]
3353 pub fn duckdb_scalar_function_get_state(
3354 info: duckdb_function_info
3355 ) -> *mut ::std::os::raw::c_void;
3356}
3357unsafe extern "C" {
3358 #[doc = "Sets the (optional) state init function of the scalar function.\nThis is called once for each worker thread that begins executing the function\n @param scalar_function The scalar function.\n @param init The init function."]
3359 pub fn duckdb_scalar_function_set_init(
3360 scalar_function: duckdb_scalar_function,
3361 init: duckdb_scalar_function_init_t,
3362 );
3363}
3364unsafe extern "C" {
3365 #[doc = "Report that an error has occurred while calling init on a scalar function.\n\n @param info The init info object.\n @param error The error message."]
3366 pub fn duckdb_scalar_function_init_set_error(
3367 info: duckdb_init_info,
3368 error: *const ::std::os::raw::c_char,
3369 );
3370}
3371unsafe extern "C" {
3372 #[doc = "Sets the state pointer in the init info of the scalar function.\n\n @param info The init info object.\n @param state The state pointer.\n @param destroy The callback to destroy the state (if any)."]
3373 pub fn duckdb_scalar_function_init_set_state(
3374 info: duckdb_init_info,
3375 state: *mut ::std::os::raw::c_void,
3376 destroy: duckdb_delete_callback_t,
3377 );
3378}
3379unsafe extern "C" {
3380 #[doc = "Retrieves the client context of the init info of a scalar function.\n\n @param info The init info object of the scalar function.\n @param out_context The client context of the init info. Must be destroyed with `duckdb_destroy_client_context`."]
3381 pub fn duckdb_scalar_function_init_get_client_context(
3382 info: duckdb_init_info,
3383 out_context: *mut duckdb_client_context,
3384 );
3385}
3386unsafe extern "C" {
3387 #[doc = "Gets the scalar function's bind data set by `duckdb_scalar_function_set_bind_data`.\nNote that the bind data is read-only.\n\n @param info The init info object.\n @return The bind data object."]
3388 pub fn duckdb_scalar_function_init_get_bind_data(
3389 info: duckdb_init_info
3390 ) -> *mut ::std::os::raw::c_void;
3391}
3392unsafe extern "C" {
3393 #[doc = "Retrieves the extra info of the function as set in the init info.\n\n @param info The init info object.\n @return The extra info."]
3394 pub fn duckdb_scalar_function_init_get_extra_info(
3395 info: duckdb_init_info
3396 ) -> *mut ::std::os::raw::c_void;
3397}
3398unsafe extern "C" {
3399 #[doc = "Creates a new selection vector of size `size`.\nMust be destroyed with `duckdb_destroy_selection_vector`.\n\n @param size The size of the selection vector.\n @return The selection vector."]
3400 pub fn duckdb_create_selection_vector(size: idx_t) -> duckdb_selection_vector;
3401}
3402unsafe extern "C" {
3403 #[doc = "Destroys the selection vector and de-allocates its memory.\n\n @param sel The selection vector."]
3404 pub fn duckdb_destroy_selection_vector(sel: duckdb_selection_vector);
3405}
3406unsafe extern "C" {
3407 #[doc = "Access the data pointer of a selection vector.\n\n @param sel The selection vector.\n @return The data pointer."]
3408 pub fn duckdb_selection_vector_get_data_ptr(sel: duckdb_selection_vector) -> *mut sel_t;
3409}
3410unsafe extern "C" {
3411 #[doc = "Creates a new empty aggregate function.\n\nThe return value should be destroyed with `duckdb_destroy_aggregate_function`.\n\n @return The aggregate function object."]
3412 pub fn duckdb_create_aggregate_function() -> duckdb_aggregate_function;
3413}
3414unsafe extern "C" {
3415 #[doc = "Destroys the given aggregate function object."]
3416 pub fn duckdb_destroy_aggregate_function(aggregate_function: *mut duckdb_aggregate_function);
3417}
3418unsafe extern "C" {
3419 #[doc = "Sets the name of the given aggregate function.\n\n @param aggregate_function The aggregate function\n @param name The name of the aggregate function"]
3420 pub fn duckdb_aggregate_function_set_name(
3421 aggregate_function: duckdb_aggregate_function,
3422 name: *const ::std::os::raw::c_char,
3423 );
3424}
3425unsafe extern "C" {
3426 #[doc = "Adds a parameter to the aggregate function.\n\n @param aggregate_function The aggregate function.\n @param type The parameter type. Cannot contain INVALID."]
3427 pub fn duckdb_aggregate_function_add_parameter(
3428 aggregate_function: duckdb_aggregate_function,
3429 type_: duckdb_logical_type,
3430 );
3431}
3432unsafe extern "C" {
3433 #[doc = "Sets the return type of the aggregate function.\n\n @param aggregate_function The aggregate function.\n @param type The return type. Cannot contain INVALID or ANY."]
3434 pub fn duckdb_aggregate_function_set_return_type(
3435 aggregate_function: duckdb_aggregate_function,
3436 type_: duckdb_logical_type,
3437 );
3438}
3439unsafe extern "C" {
3440 #[doc = "Sets the main functions of the aggregate function.\n\n @param aggregate_function The aggregate function\n @param state_size state size\n @param state_init state init function\n @param update update states\n @param combine combine states\n @param finalize finalize states"]
3441 pub fn duckdb_aggregate_function_set_functions(
3442 aggregate_function: duckdb_aggregate_function,
3443 state_size: duckdb_aggregate_state_size,
3444 state_init: duckdb_aggregate_init_t,
3445 update: duckdb_aggregate_update_t,
3446 combine: duckdb_aggregate_combine_t,
3447 finalize: duckdb_aggregate_finalize_t,
3448 );
3449}
3450unsafe extern "C" {
3451 #[doc = "Sets the state destructor callback of the aggregate function (optional)\n\n @param aggregate_function The aggregate function\n @param destroy state destroy callback"]
3452 pub fn duckdb_aggregate_function_set_destructor(
3453 aggregate_function: duckdb_aggregate_function,
3454 destroy: duckdb_aggregate_destroy_t,
3455 );
3456}
3457unsafe extern "C" {
3458 #[doc = "Register the aggregate function object within the given connection.\n\nThe function requires at least a name, functions and a return type.\n\nIf the function is incomplete or a function with this name already exists DuckDBError is returned.\n\n @param con The connection to register it in.\n @return Whether or not the registration was successful."]
3459 pub fn duckdb_register_aggregate_function(
3460 con: duckdb_connection,
3461 aggregate_function: duckdb_aggregate_function,
3462 ) -> duckdb_state;
3463}
3464unsafe extern "C" {
3465 #[doc = "Sets the NULL handling of the aggregate function to SPECIAL_HANDLING.\n\n @param aggregate_function The aggregate function"]
3466 pub fn duckdb_aggregate_function_set_special_handling(
3467 aggregate_function: duckdb_aggregate_function
3468 );
3469}
3470unsafe extern "C" {
3471 #[doc = "Assigns extra information to the scalar function that can be fetched during binding, etc.\n\n @param aggregate_function The aggregate function\n @param extra_info The extra information\n @param destroy The callback that will be called to destroy the extra information (if any)"]
3472 pub fn duckdb_aggregate_function_set_extra_info(
3473 aggregate_function: duckdb_aggregate_function,
3474 extra_info: *mut ::std::os::raw::c_void,
3475 destroy: duckdb_delete_callback_t,
3476 );
3477}
3478unsafe extern "C" {
3479 #[doc = "Retrieves the extra info of the function as set in `duckdb_aggregate_function_set_extra_info`.\n\n @param info The info object\n @return The extra info"]
3480 pub fn duckdb_aggregate_function_get_extra_info(
3481 info: duckdb_function_info
3482 ) -> *mut ::std::os::raw::c_void;
3483}
3484unsafe extern "C" {
3485 #[doc = "Report that an error has occurred while executing the aggregate function.\n\n @param info The info object\n @param error The error message"]
3486 pub fn duckdb_aggregate_function_set_error(
3487 info: duckdb_function_info,
3488 error: *const ::std::os::raw::c_char,
3489 );
3490}
3491unsafe extern "C" {
3492 #[doc = "Creates a new empty aggregate function set.\n\nThe return value should be destroyed with `duckdb_destroy_aggregate_function_set`.\n\n @return The aggregate function set object."]
3493 pub fn duckdb_create_aggregate_function_set(
3494 name: *const ::std::os::raw::c_char
3495 ) -> duckdb_aggregate_function_set;
3496}
3497unsafe extern "C" {
3498 #[doc = "Destroys the given aggregate function set object."]
3499 pub fn duckdb_destroy_aggregate_function_set(
3500 aggregate_function_set: *mut duckdb_aggregate_function_set
3501 );
3502}
3503unsafe extern "C" {
3504 #[doc = "Adds the aggregate function as a new overload to the aggregate function set.\n\nReturns DuckDBError if the function could not be added, for example if the overload already exists.\n\n @param set The aggregate function set\n @param function The function to add"]
3505 pub fn duckdb_add_aggregate_function_to_set(
3506 set: duckdb_aggregate_function_set,
3507 function: duckdb_aggregate_function,
3508 ) -> duckdb_state;
3509}
3510unsafe extern "C" {
3511 #[doc = "Register the aggregate function set within the given connection.\n\nThe set requires at least a single valid overload.\n\nIf the set is incomplete or a function with this name already exists DuckDBError is returned.\n\n @param con The connection to register it in.\n @param set The function set to register\n @return Whether or not the registration was successful."]
3512 pub fn duckdb_register_aggregate_function_set(
3513 con: duckdb_connection,
3514 set: duckdb_aggregate_function_set,
3515 ) -> duckdb_state;
3516}
3517unsafe extern "C" {
3518 #[doc = "Creates a new empty table function.\n\nThe return value should be destroyed with `duckdb_destroy_table_function`.\n\n @return The table function object."]
3519 pub fn duckdb_create_table_function() -> duckdb_table_function;
3520}
3521unsafe extern "C" {
3522 #[doc = "Destroys the given table function object.\n\n @param table_function The table function to destroy"]
3523 pub fn duckdb_destroy_table_function(table_function: *mut duckdb_table_function);
3524}
3525unsafe extern "C" {
3526 #[doc = "Sets the name of the given table function.\n\n @param table_function The table function\n @param name The name of the table function"]
3527 pub fn duckdb_table_function_set_name(
3528 table_function: duckdb_table_function,
3529 name: *const ::std::os::raw::c_char,
3530 );
3531}
3532unsafe extern "C" {
3533 #[doc = "Adds a parameter to the table function.\n\n @param table_function The table function.\n @param type The parameter type. Cannot contain INVALID."]
3534 pub fn duckdb_table_function_add_parameter(
3535 table_function: duckdb_table_function,
3536 type_: duckdb_logical_type,
3537 );
3538}
3539unsafe extern "C" {
3540 #[doc = "Adds a named parameter to the table function.\n\n @param table_function The table function.\n @param name The parameter name.\n @param type The parameter type. Cannot contain INVALID."]
3541 pub fn duckdb_table_function_add_named_parameter(
3542 table_function: duckdb_table_function,
3543 name: *const ::std::os::raw::c_char,
3544 type_: duckdb_logical_type,
3545 );
3546}
3547unsafe extern "C" {
3548 #[doc = "Assigns extra information to the table function that can be fetched during binding, etc.\n\n @param table_function The table function\n @param extra_info The extra information\n @param destroy The callback that will be called to destroy the extra information (if any)"]
3549 pub fn duckdb_table_function_set_extra_info(
3550 table_function: duckdb_table_function,
3551 extra_info: *mut ::std::os::raw::c_void,
3552 destroy: duckdb_delete_callback_t,
3553 );
3554}
3555unsafe extern "C" {
3556 #[doc = "Sets the bind function of the table function.\n\n @param table_function The table function\n @param bind The bind function"]
3557 pub fn duckdb_table_function_set_bind(
3558 table_function: duckdb_table_function,
3559 bind: duckdb_table_function_bind_t,
3560 );
3561}
3562unsafe extern "C" {
3563 #[doc = "Sets the init function of the table function.\n\n @param table_function The table function\n @param init The init function"]
3564 pub fn duckdb_table_function_set_init(
3565 table_function: duckdb_table_function,
3566 init: duckdb_table_function_init_t,
3567 );
3568}
3569unsafe extern "C" {
3570 #[doc = "Sets the thread-local init function of the table function.\n\n @param table_function The table function\n @param init The init function"]
3571 pub fn duckdb_table_function_set_local_init(
3572 table_function: duckdb_table_function,
3573 init: duckdb_table_function_init_t,
3574 );
3575}
3576unsafe extern "C" {
3577 #[doc = "Sets the main function of the table function.\n\n @param table_function The table function\n @param function The function"]
3578 pub fn duckdb_table_function_set_function(
3579 table_function: duckdb_table_function,
3580 function: duckdb_table_function_t,
3581 );
3582}
3583unsafe extern "C" {
3584 #[doc = "Sets whether or not the given table function supports projection pushdown.\n\nIf this is set to true, the system will provide a list of all required columns in the `init` stage through\nthe `duckdb_init_get_column_count` and `duckdb_init_get_column_index` functions.\nIf this is set to false (the default), the system will expect all columns to be projected.\n\n @param table_function The table function\n @param pushdown True if the table function supports projection pushdown, false otherwise."]
3585 pub fn duckdb_table_function_supports_projection_pushdown(
3586 table_function: duckdb_table_function,
3587 pushdown: bool,
3588 );
3589}
3590unsafe extern "C" {
3591 #[doc = "Register the table function object within the given connection.\n\nThe function requires at least a name, a bind function, an init function and a main function.\n\nIf the function is incomplete or a function with this name already exists DuckDBError is returned.\n\n @param con The connection to register it in.\n @param function The function pointer\n @return Whether or not the registration was successful."]
3592 pub fn duckdb_register_table_function(
3593 con: duckdb_connection,
3594 function: duckdb_table_function,
3595 ) -> duckdb_state;
3596}
3597unsafe extern "C" {
3598 #[doc = "Retrieves the extra info of the function as set in `duckdb_table_function_set_extra_info`.\n\n @param info The info object\n @return The extra info"]
3599 pub fn duckdb_bind_get_extra_info(info: duckdb_bind_info) -> *mut ::std::os::raw::c_void;
3600}
3601unsafe extern "C" {
3602 #[doc = "Retrieves the client context of the bind info of a table function.\n\n @param info The bind info object of the table function.\n @param out_context The client context of the bind info. Must be destroyed with `duckdb_destroy_client_context`."]
3603 pub fn duckdb_table_function_get_client_context(
3604 info: duckdb_bind_info,
3605 out_context: *mut duckdb_client_context,
3606 );
3607}
3608unsafe extern "C" {
3609 #[doc = "Adds a result column to the output of the table function.\n\n @param info The table function's bind info.\n @param name The column name.\n @param type The logical column type."]
3610 pub fn duckdb_bind_add_result_column(
3611 info: duckdb_bind_info,
3612 name: *const ::std::os::raw::c_char,
3613 type_: duckdb_logical_type,
3614 );
3615}
3616unsafe extern "C" {
3617 #[doc = "Retrieves the number of regular (non-named) parameters to the function.\n\n @param info The info object\n @return The number of parameters"]
3618 pub fn duckdb_bind_get_parameter_count(info: duckdb_bind_info) -> idx_t;
3619}
3620unsafe extern "C" {
3621 #[doc = "Retrieves the parameter at the given index.\n\nThe result must be destroyed with `duckdb_destroy_value`.\n\n @param info The info object\n @param index The index of the parameter to get\n @return The value of the parameter. Must be destroyed with `duckdb_destroy_value`."]
3622 pub fn duckdb_bind_get_parameter(
3623 info: duckdb_bind_info,
3624 index: idx_t,
3625 ) -> duckdb_value;
3626}
3627unsafe extern "C" {
3628 #[doc = "Retrieves a named parameter with the given name.\n\nThe result must be destroyed with `duckdb_destroy_value`.\n\n @param info The info object\n @param name The name of the parameter\n @return The value of the parameter. Must be destroyed with `duckdb_destroy_value`."]
3629 pub fn duckdb_bind_get_named_parameter(
3630 info: duckdb_bind_info,
3631 name: *const ::std::os::raw::c_char,
3632 ) -> duckdb_value;
3633}
3634unsafe extern "C" {
3635 #[doc = "Sets the user-provided bind data in the bind object of the table function.\nThis object can be retrieved again during execution.\n\n @param info The bind info of the table function.\n @param bind_data The bind data object.\n @param destroy The callback to destroy the bind data (if any)."]
3636 pub fn duckdb_bind_set_bind_data(
3637 info: duckdb_bind_info,
3638 bind_data: *mut ::std::os::raw::c_void,
3639 destroy: duckdb_delete_callback_t,
3640 );
3641}
3642unsafe extern "C" {
3643 #[doc = "Sets the cardinality estimate for the table function, used for optimization.\n\n @param info The bind data object.\n @param is_exact Whether or not the cardinality estimate is exact, or an approximation"]
3644 pub fn duckdb_bind_set_cardinality(
3645 info: duckdb_bind_info,
3646 cardinality: idx_t,
3647 is_exact: bool,
3648 );
3649}
3650unsafe extern "C" {
3651 #[doc = "Report that an error has occurred while calling bind on a table function.\n\n @param info The info object\n @param error The error message"]
3652 pub fn duckdb_bind_set_error(
3653 info: duckdb_bind_info,
3654 error: *const ::std::os::raw::c_char,
3655 );
3656}
3657unsafe extern "C" {
3658 #[doc = "Retrieves the extra info of the function as set in `duckdb_table_function_set_extra_info`.\n\n @param info The info object\n @return The extra info"]
3659 pub fn duckdb_init_get_extra_info(info: duckdb_init_info) -> *mut ::std::os::raw::c_void;
3660}
3661unsafe extern "C" {
3662 #[doc = "Gets the bind data set by `duckdb_bind_set_bind_data` during the bind.\n\nNote that the bind data should be considered as read-only.\nFor tracking state, use the init data instead.\n\n @param info The info object\n @return The bind data object"]
3663 pub fn duckdb_init_get_bind_data(info: duckdb_init_info) -> *mut ::std::os::raw::c_void;
3664}
3665unsafe extern "C" {
3666 #[doc = "Sets the user-provided init data in the init object. This object can be retrieved again during execution.\n\n @param info The info object\n @param init_data The init data object.\n @param destroy The callback that will be called to destroy the init data (if any)"]
3667 pub fn duckdb_init_set_init_data(
3668 info: duckdb_init_info,
3669 init_data: *mut ::std::os::raw::c_void,
3670 destroy: duckdb_delete_callback_t,
3671 );
3672}
3673unsafe extern "C" {
3674 #[doc = "Returns the number of projected columns.\n\nThis function must be used if projection pushdown is enabled to figure out which columns to emit.\n\n @param info The info object\n @return The number of projected columns."]
3675 pub fn duckdb_init_get_column_count(info: duckdb_init_info) -> idx_t;
3676}
3677unsafe extern "C" {
3678 #[doc = "Returns the column index of the projected column at the specified position.\n\nThis function must be used if projection pushdown is enabled to figure out which columns to emit.\n\n @param info The info object\n @param column_index The index at which to get the projected column index, from 0..duckdb_init_get_column_count(info)\n @return The column index of the projected column."]
3679 pub fn duckdb_init_get_column_index(
3680 info: duckdb_init_info,
3681 column_index: idx_t,
3682 ) -> idx_t;
3683}
3684unsafe extern "C" {
3685 #[doc = "Sets how many threads can process this table function in parallel (default: 1)\n\n @param info The info object\n @param max_threads The maximum amount of threads that can process this table function"]
3686 pub fn duckdb_init_set_max_threads(
3687 info: duckdb_init_info,
3688 max_threads: idx_t,
3689 );
3690}
3691unsafe extern "C" {
3692 #[doc = "Report that an error has occurred while calling init.\n\n @param info The info object\n @param error The error message"]
3693 pub fn duckdb_init_set_error(
3694 info: duckdb_init_info,
3695 error: *const ::std::os::raw::c_char,
3696 );
3697}
3698unsafe extern "C" {
3699 #[doc = "Retrieves the extra info of the function as set in `duckdb_table_function_set_extra_info`.\n\n @param info The info object\n @return The extra info"]
3700 pub fn duckdb_function_get_extra_info(
3701 info: duckdb_function_info
3702 ) -> *mut ::std::os::raw::c_void;
3703}
3704unsafe extern "C" {
3705 #[doc = "Gets the table function's bind data set by `duckdb_bind_set_bind_data`.\n\nNote that the bind data is read-only.\nFor tracking state, use the init data instead.\n\n @param info The function info object.\n @return The bind data object."]
3706 pub fn duckdb_function_get_bind_data(info: duckdb_function_info)
3707 -> *mut ::std::os::raw::c_void;
3708}
3709unsafe extern "C" {
3710 #[doc = "Gets the init data set by `duckdb_init_set_init_data` during the init.\n\n @param info The info object\n @return The init data object"]
3711 pub fn duckdb_function_get_init_data(info: duckdb_function_info)
3712 -> *mut ::std::os::raw::c_void;
3713}
3714unsafe extern "C" {
3715 #[doc = "Gets the thread-local init data set by `duckdb_init_set_init_data` during the local_init.\n\n @param info The info object\n @return The init data object"]
3716 pub fn duckdb_function_get_local_init_data(
3717 info: duckdb_function_info
3718 ) -> *mut ::std::os::raw::c_void;
3719}
3720unsafe extern "C" {
3721 #[doc = "Report that an error has occurred while executing the function.\n\n @param info The info object\n @param error The error message"]
3722 pub fn duckdb_function_set_error(
3723 info: duckdb_function_info,
3724 error: *const ::std::os::raw::c_char,
3725 );
3726}
3727unsafe extern "C" {
3728 #[doc = "Add a replacement scan definition to the specified database.\n\n @param db The database object to add the replacement scan to\n @param replacement The replacement scan callback\n @param extra_data Extra data that is passed back into the specified callback\n @param delete_callback The delete callback to call on the extra data, if any"]
3729 pub fn duckdb_add_replacement_scan(
3730 db: duckdb_database,
3731 replacement: duckdb_replacement_callback_t,
3732 extra_data: *mut ::std::os::raw::c_void,
3733 delete_callback: duckdb_delete_callback_t,
3734 );
3735}
3736unsafe extern "C" {
3737 #[doc = "Sets the replacement function name. If this function is called in the replacement callback,\nthe replacement scan is performed. If it is not called, the replacement callback is not performed.\n\n @param info The info object\n @param function_name The function name to substitute."]
3738 pub fn duckdb_replacement_scan_set_function_name(
3739 info: duckdb_replacement_scan_info,
3740 function_name: *const ::std::os::raw::c_char,
3741 );
3742}
3743unsafe extern "C" {
3744 #[doc = "Adds a parameter to the replacement scan function.\n\n @param info The info object\n @param parameter The parameter to add."]
3745 pub fn duckdb_replacement_scan_add_parameter(
3746 info: duckdb_replacement_scan_info,
3747 parameter: duckdb_value,
3748 );
3749}
3750unsafe extern "C" {
3751 #[doc = "Report that an error has occurred while executing the replacement scan.\n\n @param info The info object\n @param error The error message"]
3752 pub fn duckdb_replacement_scan_set_error(
3753 info: duckdb_replacement_scan_info,
3754 error: *const ::std::os::raw::c_char,
3755 );
3756}
3757unsafe extern "C" {
3758 #[doc = "Returns the root node of the profiling information. Returns nullptr, if profiling is not enabled.\n\n @param connection A connection object.\n @return A profiling information object."]
3759 pub fn duckdb_get_profiling_info(connection: duckdb_connection) -> duckdb_profiling_info;
3760}
3761unsafe extern "C" {
3762 #[doc = "Returns the value of the metric of the current profiling info node. Returns nullptr, if the metric does\nnot exist or is not enabled. Currently, the value holds a string, and you can retrieve the string\nby calling the corresponding function: char *duckdb_get_varchar(duckdb_value value).\n\n @param info A profiling information object.\n @param key The name of the requested metric.\n @return The value of the metric. Must be freed with `duckdb_destroy_value`"]
3763 pub fn duckdb_profiling_info_get_value(
3764 info: duckdb_profiling_info,
3765 key: *const ::std::os::raw::c_char,
3766 ) -> duckdb_value;
3767}
3768unsafe extern "C" {
3769 #[doc = "Returns the key-value metric map of this profiling node as a MAP duckdb_value.\nThe individual elements are accessible via the duckdb_value MAP functions.\n\n @param info A profiling information object.\n @return The key-value metric map as a MAP duckdb_value."]
3770 pub fn duckdb_profiling_info_get_metrics(info: duckdb_profiling_info) -> duckdb_value;
3771}
3772unsafe extern "C" {
3773 #[doc = "Returns the number of children in the current profiling info node.\n\n @param info A profiling information object.\n @return The number of children in the current node."]
3774 pub fn duckdb_profiling_info_get_child_count(info: duckdb_profiling_info) -> idx_t;
3775}
3776unsafe extern "C" {
3777 #[doc = "Returns the child node at the specified index.\n\n @param info A profiling information object.\n @param index The index of the child node.\n @return The child node at the specified index."]
3778 pub fn duckdb_profiling_info_get_child(
3779 info: duckdb_profiling_info,
3780 index: idx_t,
3781 ) -> duckdb_profiling_info;
3782}
3783unsafe extern "C" {
3784 #[doc = "Creates an appender object.\n\nNote that the object must be destroyed with `duckdb_appender_destroy`.\n\n @param connection The connection context to create the appender in.\n @param schema The schema of the table to append to, or `nullptr` for the default schema.\n @param table The table name to append to.\n @param out_appender The resulting appender object.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
3785 pub fn duckdb_appender_create(
3786 connection: duckdb_connection,
3787 schema: *const ::std::os::raw::c_char,
3788 table: *const ::std::os::raw::c_char,
3789 out_appender: *mut duckdb_appender,
3790 ) -> duckdb_state;
3791}
3792unsafe extern "C" {
3793 #[doc = "Creates an appender object.\n\nNote that the object must be destroyed with `duckdb_appender_destroy`.\n\n @param connection The connection context to create the appender in.\n @param catalog The catalog of the table to append to, or `nullptr` for the default catalog.\n @param schema The schema of the table to append to, or `nullptr` for the default schema.\n @param table The table name to append to.\n @param out_appender The resulting appender object.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
3794 pub fn duckdb_appender_create_ext(
3795 connection: duckdb_connection,
3796 catalog: *const ::std::os::raw::c_char,
3797 schema: *const ::std::os::raw::c_char,
3798 table: *const ::std::os::raw::c_char,
3799 out_appender: *mut duckdb_appender,
3800 ) -> duckdb_state;
3801}
3802unsafe extern "C" {
3803 #[doc = "Creates an appender object that executes the given query with any data appended to it.\n\nNote that the object must be destroyed with `duckdb_appender_destroy`.\n\n @param connection The connection context to create the appender in.\n @param query The query to execute, can be an INSERT, DELETE, UPDATE or MERGE INTO statement.\n @param column_count The number of columns to append.\n @param types The types of the columns to append.\n @param table_name (optionally) the table name used to refer to the appended data, defaults to \"appended_data\".\n @param column_names (optionally) the list of column names, defaults to \"col1\", \"col2\", ...\n @param out_appender The resulting appender object.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
3804 pub fn duckdb_appender_create_query(
3805 connection: duckdb_connection,
3806 query: *const ::std::os::raw::c_char,
3807 column_count: idx_t,
3808 types: *mut duckdb_logical_type,
3809 table_name: *const ::std::os::raw::c_char,
3810 column_names: *mut *const ::std::os::raw::c_char,
3811 out_appender: *mut duckdb_appender,
3812 ) -> duckdb_state;
3813}
3814unsafe extern "C" {
3815 #[doc = "Returns the number of columns that belong to the appender.\nIf there is no active column list, then this equals the table's physical columns.\n\n @param appender The appender to get the column count from.\n @return The number of columns in the data chunks."]
3816 pub fn duckdb_appender_column_count(appender: duckdb_appender) -> idx_t;
3817}
3818unsafe extern "C" {
3819 #[doc = "Returns the type of the column at the specified index. This is either a type in the active column list, or the same type\nas a column in the receiving table.\n\nNote: The resulting type must be destroyed with `duckdb_destroy_logical_type`.\n\n @param appender The appender to get the column type from.\n @param col_idx The index of the column to get the type of.\n @return The `duckdb_logical_type` of the column."]
3820 pub fn duckdb_appender_column_type(
3821 appender: duckdb_appender,
3822 col_idx: idx_t,
3823 ) -> duckdb_logical_type;
3824}
3825unsafe extern "C" {
3826 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\nUse duckdb_appender_error_data instead.\n\nReturns the error message associated with the appender.\nIf the appender has no error message, this returns `nullptr` instead.\n\nThe error message should not be freed. It will be de-allocated when `duckdb_appender_destroy` is called.\n\n @param appender The appender to get the error from.\n @return The error message, or `nullptr` if there is none."]
3827 pub fn duckdb_appender_error(appender: duckdb_appender) -> *const ::std::os::raw::c_char;
3828}
3829unsafe extern "C" {
3830 #[doc = "Returns the error data associated with the appender.\nMust be destroyed with duckdb_destroy_error_data.\n\n @param appender The appender to get the error data from.\n @return The error data."]
3831 pub fn duckdb_appender_error_data(appender: duckdb_appender) -> duckdb_error_data;
3832}
3833unsafe extern "C" {
3834 #[doc = "Flush the appender to the table, forcing the cache of the appender to be cleared. If flushing the data triggers a\nconstraint violation or any other error, then all data is invalidated, and this function returns DuckDBError.\nIt is not possible to append more values. Call duckdb_appender_error_data to obtain the error data followed by\nduckdb_appender_destroy to destroy the invalidated appender.\n\n @param appender The appender to flush.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
3835 pub fn duckdb_appender_flush(appender: duckdb_appender) -> duckdb_state;
3836}
3837unsafe extern "C" {
3838 #[doc = "Clears all buffered data from the appender without flushing it to the table. This discards any data that has been\nappended but not yet written. The appender can continue to be used after clearing.\n\n @param appender The appender to clear.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
3839 pub fn duckdb_appender_clear(appender: duckdb_appender) -> duckdb_state;
3840}
3841unsafe extern "C" {
3842 #[doc = "Closes the appender by flushing all intermediate states and closing it for further appends. If flushing the data\ntriggers a constraint violation or any other error, then all data is invalidated, and this function returns DuckDBError.\nCall duckdb_appender_error_data to obtain the error data followed by duckdb_appender_destroy to destroy the invalidated\nappender.\n\n @param appender The appender to flush and close.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
3843 pub fn duckdb_appender_close(appender: duckdb_appender) -> duckdb_state;
3844}
3845unsafe extern "C" {
3846 #[doc = "Closes the appender by flushing all intermediate states to the table and destroying it. By destroying it, this function\nde-allocates all memory associated with the appender. If flushing the data triggers a constraint violation,\nthen all data is invalidated, and this function returns DuckDBError. Due to the destruction of the appender, it is no\nlonger possible to obtain the specific error message with duckdb_appender_error. Therefore, call duckdb_appender_close\nbefore destroying the appender, if you need insights into the specific error.\n\n @param appender The appender to flush, close and destroy.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
3847 pub fn duckdb_appender_destroy(appender: *mut duckdb_appender) -> duckdb_state;
3848}
3849unsafe extern "C" {
3850 #[doc = "Appends a column to the active column list of the appender. Immediately flushes all previous data.\n\nThe active column list specifies all columns that are expected when flushing the data. Any non-active columns are filled\nwith their default values, or NULL.\n\n @param appender The appender to add the column to.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
3851 pub fn duckdb_appender_add_column(
3852 appender: duckdb_appender,
3853 name: *const ::std::os::raw::c_char,
3854 ) -> duckdb_state;
3855}
3856unsafe extern "C" {
3857 #[doc = "Removes all columns from the active column list of the appender, resetting the appender to treat all columns as active.\nImmediately flushes all previous data.\n\n @param appender The appender to clear the columns from.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
3858 pub fn duckdb_appender_clear_columns(appender: duckdb_appender) -> duckdb_state;
3859}
3860unsafe extern "C" {
3861 #[doc = "A nop function, provided for backwards compatibility reasons. Does nothing. Only `duckdb_appender_end_row` is required."]
3862 pub fn duckdb_appender_begin_row(appender: duckdb_appender) -> duckdb_state;
3863}
3864unsafe extern "C" {
3865 #[doc = "Finish the current row of appends. After end_row is called, the next row can be appended.\n\n @param appender The appender.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
3866 pub fn duckdb_appender_end_row(appender: duckdb_appender) -> duckdb_state;
3867}
3868unsafe extern "C" {
3869 #[doc = "Append a DEFAULT value (NULL if DEFAULT not available for column) to the appender."]
3870 pub fn duckdb_append_default(appender: duckdb_appender) -> duckdb_state;
3871}
3872unsafe extern "C" {
3873 #[doc = "Append a DEFAULT value, at the specified row and column, (NULL if DEFAULT not available for column) to the chunk created\nfrom the specified appender. The default value of the column must be a constant value. Non-deterministic expressions\nlike nextval('seq') or random() are not supported.\n\n @param appender The appender to get the default value from.\n @param chunk The data chunk to append the default value to.\n @param col The chunk column index to append the default value to.\n @param row The chunk row index to append the default value to.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
3874 pub fn duckdb_append_default_to_chunk(
3875 appender: duckdb_appender,
3876 chunk: duckdb_data_chunk,
3877 col: idx_t,
3878 row: idx_t,
3879 ) -> duckdb_state;
3880}
3881unsafe extern "C" {
3882 #[doc = "Append a bool value to the appender."]
3883 pub fn duckdb_append_bool(
3884 appender: duckdb_appender,
3885 value: bool,
3886 ) -> duckdb_state;
3887}
3888unsafe extern "C" {
3889 #[doc = "Append an int8_t value to the appender."]
3890 pub fn duckdb_append_int8(
3891 appender: duckdb_appender,
3892 value: i8,
3893 ) -> duckdb_state;
3894}
3895unsafe extern "C" {
3896 #[doc = "Append an int16_t value to the appender."]
3897 pub fn duckdb_append_int16(
3898 appender: duckdb_appender,
3899 value: i16,
3900 ) -> duckdb_state;
3901}
3902unsafe extern "C" {
3903 #[doc = "Append an int32_t value to the appender."]
3904 pub fn duckdb_append_int32(
3905 appender: duckdb_appender,
3906 value: i32,
3907 ) -> duckdb_state;
3908}
3909unsafe extern "C" {
3910 #[doc = "Append an int64_t value to the appender."]
3911 pub fn duckdb_append_int64(
3912 appender: duckdb_appender,
3913 value: i64,
3914 ) -> duckdb_state;
3915}
3916unsafe extern "C" {
3917 #[doc = "Append a duckdb_hugeint value to the appender."]
3918 pub fn duckdb_append_hugeint(
3919 appender: duckdb_appender,
3920 value: duckdb_hugeint,
3921 ) -> duckdb_state;
3922}
3923unsafe extern "C" {
3924 #[doc = "Append a uint8_t value to the appender."]
3925 pub fn duckdb_append_uint8(
3926 appender: duckdb_appender,
3927 value: u8,
3928 ) -> duckdb_state;
3929}
3930unsafe extern "C" {
3931 #[doc = "Append a uint16_t value to the appender."]
3932 pub fn duckdb_append_uint16(
3933 appender: duckdb_appender,
3934 value: u16,
3935 ) -> duckdb_state;
3936}
3937unsafe extern "C" {
3938 #[doc = "Append a uint32_t value to the appender."]
3939 pub fn duckdb_append_uint32(
3940 appender: duckdb_appender,
3941 value: u32,
3942 ) -> duckdb_state;
3943}
3944unsafe extern "C" {
3945 #[doc = "Append a uint64_t value to the appender."]
3946 pub fn duckdb_append_uint64(
3947 appender: duckdb_appender,
3948 value: u64,
3949 ) -> duckdb_state;
3950}
3951unsafe extern "C" {
3952 #[doc = "Append a duckdb_uhugeint value to the appender."]
3953 pub fn duckdb_append_uhugeint(
3954 appender: duckdb_appender,
3955 value: duckdb_uhugeint,
3956 ) -> duckdb_state;
3957}
3958unsafe extern "C" {
3959 #[doc = "Append a float value to the appender."]
3960 pub fn duckdb_append_float(
3961 appender: duckdb_appender,
3962 value: f32,
3963 ) -> duckdb_state;
3964}
3965unsafe extern "C" {
3966 #[doc = "Append a double value to the appender."]
3967 pub fn duckdb_append_double(
3968 appender: duckdb_appender,
3969 value: f64,
3970 ) -> duckdb_state;
3971}
3972unsafe extern "C" {
3973 #[doc = "Append a duckdb_date value to the appender."]
3974 pub fn duckdb_append_date(
3975 appender: duckdb_appender,
3976 value: duckdb_date,
3977 ) -> duckdb_state;
3978}
3979unsafe extern "C" {
3980 #[doc = "Append a duckdb_time value to the appender."]
3981 pub fn duckdb_append_time(
3982 appender: duckdb_appender,
3983 value: duckdb_time,
3984 ) -> duckdb_state;
3985}
3986unsafe extern "C" {
3987 #[doc = "Append a duckdb_timestamp value to the appender."]
3988 pub fn duckdb_append_timestamp(
3989 appender: duckdb_appender,
3990 value: duckdb_timestamp,
3991 ) -> duckdb_state;
3992}
3993unsafe extern "C" {
3994 #[doc = "Append a duckdb_interval value to the appender."]
3995 pub fn duckdb_append_interval(
3996 appender: duckdb_appender,
3997 value: duckdb_interval,
3998 ) -> duckdb_state;
3999}
4000unsafe extern "C" {
4001 #[doc = "Append a varchar value to the appender."]
4002 pub fn duckdb_append_varchar(
4003 appender: duckdb_appender,
4004 val: *const ::std::os::raw::c_char,
4005 ) -> duckdb_state;
4006}
4007unsafe extern "C" {
4008 #[doc = "Append a varchar value to the appender."]
4009 pub fn duckdb_append_varchar_length(
4010 appender: duckdb_appender,
4011 val: *const ::std::os::raw::c_char,
4012 length: idx_t,
4013 ) -> duckdb_state;
4014}
4015unsafe extern "C" {
4016 #[doc = "Append a blob value to the appender."]
4017 pub fn duckdb_append_blob(
4018 appender: duckdb_appender,
4019 data: *const ::std::os::raw::c_void,
4020 length: idx_t,
4021 ) -> duckdb_state;
4022}
4023unsafe extern "C" {
4024 #[doc = "Append a NULL value to the appender (of any type)."]
4025 pub fn duckdb_append_null(appender: duckdb_appender) -> duckdb_state;
4026}
4027unsafe extern "C" {
4028 #[doc = "Append a duckdb_value to the appender."]
4029 pub fn duckdb_append_value(
4030 appender: duckdb_appender,
4031 value: duckdb_value,
4032 ) -> duckdb_state;
4033}
4034unsafe extern "C" {
4035 #[doc = "Appends a pre-filled data chunk to the specified appender.\nAttempts casting, if the data chunk types do not match the active appender types.\n\n @param appender The appender to append to.\n @param chunk The data chunk to append.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
4036 pub fn duckdb_append_data_chunk(
4037 appender: duckdb_appender,
4038 chunk: duckdb_data_chunk,
4039 ) -> duckdb_state;
4040}
4041unsafe extern "C" {
4042 #[doc = "Creates a table description object. Note that `duckdb_table_description_destroy` should always be called on the\nresulting table_description, even if the function returns `DuckDBError`.\n\n @param connection The connection context.\n @param schema The schema of the table, or `nullptr` for the default schema.\n @param table The table name.\n @param out The resulting table description object.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
4043 pub fn duckdb_table_description_create(
4044 connection: duckdb_connection,
4045 schema: *const ::std::os::raw::c_char,
4046 table: *const ::std::os::raw::c_char,
4047 out: *mut duckdb_table_description,
4048 ) -> duckdb_state;
4049}
4050unsafe extern "C" {
4051 #[doc = "Creates a table description object. Note that `duckdb_table_description_destroy` must be called on the resulting\ntable_description, even if the function returns `DuckDBError`.\n\n @param connection The connection context.\n @param catalog The catalog (database) name of the table, or `nullptr` for the default catalog.\n @param schema The schema of the table, or `nullptr` for the default schema.\n @param table The table name.\n @param out The resulting table description object.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
4052 pub fn duckdb_table_description_create_ext(
4053 connection: duckdb_connection,
4054 catalog: *const ::std::os::raw::c_char,
4055 schema: *const ::std::os::raw::c_char,
4056 table: *const ::std::os::raw::c_char,
4057 out: *mut duckdb_table_description,
4058 ) -> duckdb_state;
4059}
4060unsafe extern "C" {
4061 #[doc = "Destroy the TableDescription object.\n\n @param table_description The table_description to destroy."]
4062 pub fn duckdb_table_description_destroy(table_description: *mut duckdb_table_description);
4063}
4064unsafe extern "C" {
4065 #[doc = "Returns the error message associated with the given table_description.\nIf the table_description has no error message, this returns `nullptr` instead.\nThe error message should not be freed. It will be de-allocated when `duckdb_table_description_destroy` is called.\n\n @param table_description The table_description to get the error from.\n @return The error message, or `nullptr` if there is none."]
4066 pub fn duckdb_table_description_error(
4067 table_description: duckdb_table_description
4068 ) -> *const ::std::os::raw::c_char;
4069}
4070unsafe extern "C" {
4071 #[doc = "Check if the column at 'index' index of the table has a DEFAULT expression.\n\n @param table_description The table_description to query.\n @param index The index of the column to query.\n @param out The out-parameter used to store the result.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
4072 pub fn duckdb_column_has_default(
4073 table_description: duckdb_table_description,
4074 index: idx_t,
4075 out: *mut bool,
4076 ) -> duckdb_state;
4077}
4078unsafe extern "C" {
4079 #[doc = "Return the number of columns of the described table.\n\n @param table_description The table_description to query.\n @return The column count."]
4080 pub fn duckdb_table_description_get_column_count(
4081 table_description: duckdb_table_description
4082 ) -> idx_t;
4083}
4084unsafe extern "C" {
4085 #[doc = "Obtain the column name at 'index'.\nThe out result must be destroyed with `duckdb_free`.\n\n @param table_description The table_description to query.\n @param index The index of the column to query.\n @return The column name."]
4086 pub fn duckdb_table_description_get_column_name(
4087 table_description: duckdb_table_description,
4088 index: idx_t,
4089 ) -> *mut ::std::os::raw::c_char;
4090}
4091unsafe extern "C" {
4092 #[doc = "Obtain the column type at 'index'.\nThe return value must be destroyed with `duckdb_destroy_logical_type`.\n\n @param table_description The table_description to query.\n @param index The index of the column to query.\n @return The column type."]
4093 pub fn duckdb_table_description_get_column_type(
4094 table_description: duckdb_table_description,
4095 index: idx_t,
4096 ) -> duckdb_logical_type;
4097}
4098unsafe extern "C" {
4099 #[doc = "Transforms a DuckDB Schema into an Arrow Schema\n\n @param arrow_options The Arrow settings used to produce arrow.\n @param types The DuckDB logical types for each column in the schema.\n @param names The names for each column in the schema.\n @param column_count The number of columns that exist in the schema.\n @param out_schema The resulting arrow schema. Must be destroyed with `out_schema->release(out_schema)`.\n @return The error data. Must be destroyed with `duckdb_destroy_error_data`."]
4100 pub fn duckdb_to_arrow_schema(
4101 arrow_options: duckdb_arrow_options,
4102 types: *mut duckdb_logical_type,
4103 names: *mut *const ::std::os::raw::c_char,
4104 column_count: idx_t,
4105 out_schema: *mut ArrowSchema,
4106 ) -> duckdb_error_data;
4107}
4108unsafe extern "C" {
4109 #[doc = "Transforms a DuckDB data chunk into an Arrow array.\n\n @param arrow_options The Arrow settings used to produce arrow.\n @param chunk The DuckDB data chunk to convert.\n @param out_arrow_array The output Arrow structure that will hold the converted data. Must be released with\n`out_arrow_array->release(out_arrow_array)`\n @return The error data. Must be destroyed with `duckdb_destroy_error_data`."]
4110 pub fn duckdb_data_chunk_to_arrow(
4111 arrow_options: duckdb_arrow_options,
4112 chunk: duckdb_data_chunk,
4113 out_arrow_array: *mut ArrowArray,
4114 ) -> duckdb_error_data;
4115}
4116unsafe extern "C" {
4117 #[doc = "Transforms an Arrow Schema into a DuckDB Schema.\n\n @param connection The connection to get the transformation settings from.\n @param schema The input Arrow schema. Must be released with `schema->release(schema)`.\n @param out_types The Arrow converted schema with extra information about the arrow types. Must be destroyed with\n`duckdb_destroy_arrow_converted_schema`.\n @return The error data. Must be destroyed with `duckdb_destroy_error_data`."]
4118 pub fn duckdb_schema_from_arrow(
4119 connection: duckdb_connection,
4120 schema: *mut ArrowSchema,
4121 out_types: *mut duckdb_arrow_converted_schema,
4122 ) -> duckdb_error_data;
4123}
4124unsafe extern "C" {
4125 #[doc = "Transforms an Arrow array into a DuckDB data chunk. The data chunk will retain ownership of the underlying Arrow data.\n\n @param connection The connection to get the transformation settings from.\n @param arrow_array The input Arrow array. Data ownership is passed on to DuckDB's DataChunk, the underlying object\ndoes not need to be released and won't have ownership of the data.\n @param converted_schema The Arrow converted schema with extra information about the arrow types.\n @param out_chunk The resulting DuckDB data chunk. Must be destroyed by duckdb_destroy_data_chunk.\n @return The error data. Must be destroyed with `duckdb_destroy_error_data`."]
4126 pub fn duckdb_data_chunk_from_arrow(
4127 connection: duckdb_connection,
4128 arrow_array: *mut ArrowArray,
4129 converted_schema: duckdb_arrow_converted_schema,
4130 out_chunk: *mut duckdb_data_chunk,
4131 ) -> duckdb_error_data;
4132}
4133unsafe extern "C" {
4134 #[doc = "Destroys the arrow converted schema and de-allocates all memory allocated for that arrow converted schema.\n\n @param arrow_converted_schema The arrow converted schema to destroy."]
4135 pub fn duckdb_destroy_arrow_converted_schema(
4136 arrow_converted_schema: *mut duckdb_arrow_converted_schema
4137 );
4138}
4139unsafe extern "C" {
4140 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nExecutes a SQL query within a connection and stores the full (materialized) result in an arrow structure.\nIf the query fails to execute, DuckDBError is returned and the error message can be retrieved by calling\n`duckdb_query_arrow_error`.\n\nNote that after running `duckdb_query_arrow`, `duckdb_destroy_arrow` must be called on the result object even if the\nquery fails, otherwise the error stored within the result will not be freed correctly.\n\n @param connection The connection to perform the query in.\n @param query The SQL query to run.\n @param out_result The query result.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
4141 pub fn duckdb_query_arrow(
4142 connection: duckdb_connection,
4143 query: *const ::std::os::raw::c_char,
4144 out_result: *mut duckdb_arrow,
4145 ) -> duckdb_state;
4146}
4147unsafe extern "C" {
4148 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nFetch the internal arrow schema from the arrow result. Remember to call release on the respective\nArrowSchema object.\n\n @param result The result to fetch the schema from.\n @param out_schema The output schema.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
4149 pub fn duckdb_query_arrow_schema(
4150 result: duckdb_arrow,
4151 out_schema: *mut duckdb_arrow_schema,
4152 ) -> duckdb_state;
4153}
4154unsafe extern "C" {
4155 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nFetch the internal arrow schema from the prepared statement. Remember to call release on the respective\nArrowSchema object.\n\n @param prepared The prepared statement to fetch the schema from.\n @param out_schema The output schema.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
4156 pub fn duckdb_prepared_arrow_schema(
4157 prepared: duckdb_prepared_statement,
4158 out_schema: *mut duckdb_arrow_schema,
4159 ) -> duckdb_state;
4160}
4161unsafe extern "C" {
4162 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nConvert a data chunk into an arrow struct array. Remember to call release on the respective\nArrowArray object.\n\n @param result The result object the data chunk have been fetched from.\n @param chunk The data chunk to convert.\n @param out_array The output array."]
4163 pub fn duckdb_result_arrow_array(
4164 result: duckdb_result,
4165 chunk: duckdb_data_chunk,
4166 out_array: *mut duckdb_arrow_array,
4167 );
4168}
4169unsafe extern "C" {
4170 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nFetch an internal arrow struct array from the arrow result. Remember to call release on the respective\nArrowArray object.\n\nThis function can be called multiple time to get next chunks, which will free the previous out_array.\nSo consume the out_array before calling this function again.\n\n @param result The result to fetch the array from.\n @param out_array The output array.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
4171 pub fn duckdb_query_arrow_array(
4172 result: duckdb_arrow,
4173 out_array: *mut duckdb_arrow_array,
4174 ) -> duckdb_state;
4175}
4176unsafe extern "C" {
4177 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nReturns the number of columns present in the arrow result object.\n\n @param result The result object.\n @return The number of columns present in the result object."]
4178 pub fn duckdb_arrow_column_count(result: duckdb_arrow) -> idx_t;
4179}
4180unsafe extern "C" {
4181 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nReturns the number of rows present in the arrow result object.\n\n @param result The result object.\n @return The number of rows present in the result object."]
4182 pub fn duckdb_arrow_row_count(result: duckdb_arrow) -> idx_t;
4183}
4184unsafe extern "C" {
4185 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nReturns the number of rows changed by the query stored in the arrow result. This is relevant only for\nINSERT/UPDATE/DELETE queries. For other queries the rows_changed will be 0.\n\n @param result The result object.\n @return The number of rows changed."]
4186 pub fn duckdb_arrow_rows_changed(result: duckdb_arrow) -> idx_t;
4187}
4188unsafe extern "C" {
4189 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nReturns the error message contained within the result. The error is only set if `duckdb_query_arrow` returns\n`DuckDBError`.\n\nThe error message should not be freed. It will be de-allocated when `duckdb_destroy_arrow` is called.\n\n @param result The result object to fetch the error from.\n @return The error of the result."]
4190 pub fn duckdb_query_arrow_error(result: duckdb_arrow) -> *const ::std::os::raw::c_char;
4191}
4192unsafe extern "C" {
4193 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nCloses the result and de-allocates all memory allocated for the arrow result.\n\n @param result The result to destroy."]
4194 pub fn duckdb_destroy_arrow(result: *mut duckdb_arrow);
4195}
4196unsafe extern "C" {
4197 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nReleases the arrow array stream and de-allocates its memory.\n\n @param stream_p The arrow array stream to destroy."]
4198 pub fn duckdb_destroy_arrow_stream(stream_p: *mut duckdb_arrow_stream);
4199}
4200unsafe extern "C" {
4201 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nExecutes the prepared statement with the given bound parameters, and returns an arrow query result.\nNote that after running `duckdb_execute_prepared_arrow`, `duckdb_destroy_arrow` must be called on the result object.\n\n @param prepared_statement The prepared statement to execute.\n @param out_result The query result.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
4202 pub fn duckdb_execute_prepared_arrow(
4203 prepared_statement: duckdb_prepared_statement,
4204 out_result: *mut duckdb_arrow,
4205 ) -> duckdb_state;
4206}
4207unsafe extern "C" {
4208 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nScans the Arrow stream and creates a view with the given name.\n\n @param connection The connection on which to execute the scan.\n @param table_name Name of the temporary view to create.\n @param arrow Arrow stream wrapper.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
4209 pub fn duckdb_arrow_scan(
4210 connection: duckdb_connection,
4211 table_name: *const ::std::os::raw::c_char,
4212 arrow: duckdb_arrow_stream,
4213 ) -> duckdb_state;
4214}
4215unsafe extern "C" {
4216 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nScans the Arrow array and creates a view with the given name.\nNote that after running `duckdb_arrow_array_scan`, `duckdb_destroy_arrow_stream` must be called on the out stream.\n\n @param connection The connection on which to execute the scan.\n @param table_name Name of the temporary view to create.\n @param arrow_schema Arrow schema wrapper.\n @param arrow_array Arrow array wrapper.\n @param out_stream Output array stream that wraps around the passed schema, for releasing/deleting once done.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure."]
4217 pub fn duckdb_arrow_array_scan(
4218 connection: duckdb_connection,
4219 table_name: *const ::std::os::raw::c_char,
4220 arrow_schema: duckdb_arrow_schema,
4221 arrow_array: duckdb_arrow_array,
4222 out_stream: *mut duckdb_arrow_stream,
4223 ) -> duckdb_state;
4224}
4225unsafe extern "C" {
4226 #[doc = "Execute DuckDB tasks on this thread.\n\nWill return after `max_tasks` have been executed, or if there are no more tasks present.\n\n @param database The database object to execute tasks for\n @param max_tasks The maximum amount of tasks to execute"]
4227 pub fn duckdb_execute_tasks(
4228 database: duckdb_database,
4229 max_tasks: idx_t,
4230 );
4231}
4232unsafe extern "C" {
4233 #[doc = "Creates a task state that can be used with duckdb_execute_tasks_state to execute tasks until\n`duckdb_finish_execution` is called on the state.\n\n`duckdb_destroy_state` must be called on the result.\n\n @param database The database object to create the task state for\n @return The task state that can be used with duckdb_execute_tasks_state."]
4234 pub fn duckdb_create_task_state(database: duckdb_database) -> duckdb_task_state;
4235}
4236unsafe extern "C" {
4237 #[doc = "Execute DuckDB tasks on this thread.\n\nThe thread will keep on executing tasks forever, until duckdb_finish_execution is called on the state.\nMultiple threads can share the same duckdb_task_state.\n\n @param state The task state of the executor"]
4238 pub fn duckdb_execute_tasks_state(state: duckdb_task_state);
4239}
4240unsafe extern "C" {
4241 #[doc = "Execute DuckDB tasks on this thread.\n\nThe thread will keep on executing tasks until either duckdb_finish_execution is called on the state,\nmax_tasks tasks have been executed or there are no more tasks to be executed.\n\nMultiple threads can share the same duckdb_task_state.\n\n @param state The task state of the executor\n @param max_tasks The maximum amount of tasks to execute\n @return The amount of tasks that have actually been executed"]
4242 pub fn duckdb_execute_n_tasks_state(
4243 state: duckdb_task_state,
4244 max_tasks: idx_t,
4245 ) -> idx_t;
4246}
4247unsafe extern "C" {
4248 #[doc = "Finish execution on a specific task.\n\n @param state The task state to finish execution"]
4249 pub fn duckdb_finish_execution(state: duckdb_task_state);
4250}
4251unsafe extern "C" {
4252 #[doc = "Check if the provided duckdb_task_state has finished execution\n\n @param state The task state to inspect\n @return Whether or not duckdb_finish_execution has been called on the task state"]
4253 pub fn duckdb_task_state_is_finished(state: duckdb_task_state) -> bool;
4254}
4255unsafe extern "C" {
4256 #[doc = "Destroys the task state returned from duckdb_create_task_state.\n\nNote that this should not be called while there is an active duckdb_execute_tasks_state running\non the task state.\n\n @param state The task state to clean up"]
4257 pub fn duckdb_destroy_task_state(state: duckdb_task_state);
4258}
4259unsafe extern "C" {
4260 #[doc = "Returns true if the execution of the current query is finished.\n\n @param con The connection on which to check"]
4261 pub fn duckdb_execution_is_finished(con: duckdb_connection) -> bool;
4262}
4263unsafe extern "C" {
4264 #[doc = "DEPRECATION NOTICE**: This method is scheduled for removal in a future release.\n\nFetches a data chunk from the (streaming) duckdb_result. This function should be called repeatedly until the result is\nexhausted.\n\nThe result must be destroyed with `duckdb_destroy_data_chunk`.\n\nThis function can only be used on duckdb_results created with 'duckdb_pending_prepared_streaming'\n\nIf this function is used, none of the other result functions can be used and vice versa (i.e. this function cannot be\nmixed with the legacy result functions or the materialized result functions).\n\nIt is not known beforehand how many chunks will be returned by this result.\n\n @param result The result object to fetch the data chunk from.\n @return The resulting data chunk. Returns `NULL` if the result has an error."]
4265 pub fn duckdb_stream_fetch_chunk(result: duckdb_result) -> duckdb_data_chunk;
4266}
4267unsafe extern "C" {
4268 #[doc = "Fetches a data chunk from a duckdb_result. This function should be called repeatedly until the result is exhausted.\n\nThe result must be destroyed with `duckdb_destroy_data_chunk`.\n\nIt is not known beforehand how many chunks will be returned by this result.\n\n @param result The result object to fetch the data chunk from.\n @return The resulting data chunk. Returns `NULL` if the result has an error."]
4269 pub fn duckdb_fetch_chunk(result: duckdb_result) -> duckdb_data_chunk;
4270}
4271unsafe extern "C" {
4272 #[doc = "Creates a new cast function object.\n\n @return The cast function object."]
4273 pub fn duckdb_create_cast_function() -> duckdb_cast_function;
4274}
4275unsafe extern "C" {
4276 #[doc = "Sets the source type of the cast function.\n\n @param cast_function The cast function object.\n @param source_type The source type to set."]
4277 pub fn duckdb_cast_function_set_source_type(
4278 cast_function: duckdb_cast_function,
4279 source_type: duckdb_logical_type,
4280 );
4281}
4282unsafe extern "C" {
4283 #[doc = "Sets the target type of the cast function.\n\n @param cast_function The cast function object.\n @param target_type The target type to set."]
4284 pub fn duckdb_cast_function_set_target_type(
4285 cast_function: duckdb_cast_function,
4286 target_type: duckdb_logical_type,
4287 );
4288}
4289unsafe extern "C" {
4290 #[doc = "Sets the \"cost\" of implicitly casting the source type to the target type using this function.\n\n @param cast_function The cast function object.\n @param cost The cost to set."]
4291 pub fn duckdb_cast_function_set_implicit_cast_cost(
4292 cast_function: duckdb_cast_function,
4293 cost: i64,
4294 );
4295}
4296unsafe extern "C" {
4297 #[doc = "Sets the actual cast function to use.\n\n @param cast_function The cast function object.\n @param function The function to set."]
4298 pub fn duckdb_cast_function_set_function(
4299 cast_function: duckdb_cast_function,
4300 function: duckdb_cast_function_t,
4301 );
4302}
4303unsafe extern "C" {
4304 #[doc = "Assigns extra information to the cast function that can be fetched during execution, etc.\n\n @param extra_info The extra information\n @param destroy The callback that will be called to destroy the extra information (if any)"]
4305 pub fn duckdb_cast_function_set_extra_info(
4306 cast_function: duckdb_cast_function,
4307 extra_info: *mut ::std::os::raw::c_void,
4308 destroy: duckdb_delete_callback_t,
4309 );
4310}
4311unsafe extern "C" {
4312 #[doc = "Retrieves the extra info of the function as set in `duckdb_cast_function_set_extra_info`.\n\n @param info The info object.\n @return The extra info."]
4313 pub fn duckdb_cast_function_get_extra_info(
4314 info: duckdb_function_info
4315 ) -> *mut ::std::os::raw::c_void;
4316}
4317unsafe extern "C" {
4318 #[doc = "Get the cast execution mode from the given function info.\n\n @param info The info object.\n @return The cast mode."]
4319 pub fn duckdb_cast_function_get_cast_mode(info: duckdb_function_info) -> duckdb_cast_mode;
4320}
4321unsafe extern "C" {
4322 #[doc = "Report that an error has occurred while executing the cast function.\n\n @param info The info object.\n @param error The error message."]
4323 pub fn duckdb_cast_function_set_error(
4324 info: duckdb_function_info,
4325 error: *const ::std::os::raw::c_char,
4326 );
4327}
4328unsafe extern "C" {
4329 #[doc = "Report that an error has occurred while executing the cast function, setting the corresponding output row to NULL.\n\n @param info The info object.\n @param error The error message.\n @param row The index of the row within the output vector to set to NULL.\n @param output The output vector."]
4330 pub fn duckdb_cast_function_set_row_error(
4331 info: duckdb_function_info,
4332 error: *const ::std::os::raw::c_char,
4333 row: idx_t,
4334 output: duckdb_vector,
4335 );
4336}
4337unsafe extern "C" {
4338 #[doc = "Registers a cast function within the given connection.\n\n @param con The connection to use.\n @param cast_function The cast function to register.\n @return Whether or not the registration was successful."]
4339 pub fn duckdb_register_cast_function(
4340 con: duckdb_connection,
4341 cast_function: duckdb_cast_function,
4342 ) -> duckdb_state;
4343}
4344unsafe extern "C" {
4345 #[doc = "Destroys the cast function object.\n\n @param cast_function The cast function object."]
4346 pub fn duckdb_destroy_cast_function(cast_function: *mut duckdb_cast_function);
4347}
4348unsafe extern "C" {
4349 #[doc = "Destroys the expression and de-allocates its memory.\n\n @param expr A pointer to the expression."]
4350 pub fn duckdb_destroy_expression(expr: *mut duckdb_expression);
4351}
4352unsafe extern "C" {
4353 #[doc = "Returns the return type of an expression.\n\n @param expr The expression.\n @return The return type. Must be destroyed with `duckdb_destroy_logical_type`."]
4354 pub fn duckdb_expression_return_type(expr: duckdb_expression) -> duckdb_logical_type;
4355}
4356unsafe extern "C" {
4357 #[doc = "Returns whether the expression is foldable into a value or not.\n\n @param expr The expression.\n @return True, if the expression is foldable, else false."]
4358 pub fn duckdb_expression_is_foldable(expr: duckdb_expression) -> bool;
4359}
4360unsafe extern "C" {
4361 #[doc = "Folds an expression creating a folded value.\n\n @param context The client context.\n @param expr The expression. Must be foldable.\n @param out_value The folded value, if folding was successful. Must be destroyed with `duckdb_destroy_value`.\n @return The error data. Must be destroyed with `duckdb_destroy_error_data`."]
4362 pub fn duckdb_expression_fold(
4363 context: duckdb_client_context,
4364 expr: duckdb_expression,
4365 out_value: *mut duckdb_value,
4366 ) -> duckdb_error_data;
4367}
4368unsafe extern "C" {
4369 #[doc = "Get a file system instance associated with the given client context.\n\n @param context The client context.\n @return The resulting file system instance. Must be destroyed with `duckdb_destroy_file_system`."]
4370 pub fn duckdb_client_context_get_file_system(
4371 context: duckdb_client_context
4372 ) -> duckdb_file_system;
4373}
4374unsafe extern "C" {
4375 #[doc = "Destroys the given file system instance.\n @param file_system The file system instance to destroy."]
4376 pub fn duckdb_destroy_file_system(file_system: *mut duckdb_file_system);
4377}
4378unsafe extern "C" {
4379 #[doc = "Retrieves the last error that occurred on the given file system instance.\n\n @param file_system The file system instance.\n @return The error data."]
4380 pub fn duckdb_file_system_error_data(file_system: duckdb_file_system) -> duckdb_error_data;
4381}
4382unsafe extern "C" {
4383 #[doc = "Opens a file at the given path with the specified options.\n\n @param file_system The file system instance.\n @param path The path to the file.\n @param options The file open options specifying how to open the file.\n @param out_file The resulting file handle instance, or `nullptr` if the open failed. Must be destroyed with\n`duckdb_destroy_file_handle`.\n @return Whether the operation was successful. If not, the error data can be retrieved using\n`duckdb_file_system_error_data`."]
4384 pub fn duckdb_file_system_open(
4385 file_system: duckdb_file_system,
4386 path: *const ::std::os::raw::c_char,
4387 options: duckdb_file_open_options,
4388 out_file: *mut duckdb_file_handle,
4389 ) -> duckdb_state;
4390}
4391unsafe extern "C" {
4392 #[doc = "Creates a new file open options instance with blank settings.\n\n @return The new file open options instance. Must be destroyed with `duckdb_destroy_file_open_options`."]
4393 pub fn duckdb_create_file_open_options() -> duckdb_file_open_options;
4394}
4395unsafe extern "C" {
4396 #[doc = "Sets a specific flag in the file open options.\n\n @param options The file open options instance.\n @param flag The flag to set (e.g., read, write).\n @param value If the flag is enabled or disabled.\n @return `DuckDBSuccess` on success or `DuckDBError` if the flag is unrecognized or unsupported by this version of\nDuckDB."]
4397 pub fn duckdb_file_open_options_set_flag(
4398 options: duckdb_file_open_options,
4399 flag: duckdb_file_flag,
4400 value: bool,
4401 ) -> duckdb_state;
4402}
4403unsafe extern "C" {
4404 #[doc = "Destroys the given file open options instance.\n @param options The file open options instance to destroy."]
4405 pub fn duckdb_destroy_file_open_options(options: *mut duckdb_file_open_options);
4406}
4407unsafe extern "C" {
4408 #[doc = "Destroys the given file handle and deallocates all associated resources.\nThis will also close the file if it is still open.\n\n @param file_handle The file handle to destroy."]
4409 pub fn duckdb_destroy_file_handle(file_handle: *mut duckdb_file_handle);
4410}
4411unsafe extern "C" {
4412 #[doc = "Retrieves the last error that occurred on the given file handle.\n\n @param file_handle The file handle.\n @return The error data. Must be destroyed with `duckdb_destroy_error_data`"]
4413 pub fn duckdb_file_handle_error_data(file_handle: duckdb_file_handle) -> duckdb_error_data;
4414}
4415unsafe extern "C" {
4416 #[doc = "Reads data from the file into the buffer.\n\n @param file_handle The file handle to read from.\n @param buffer The buffer to read data into.\n @param size The number of bytes to read.\n @return The number of bytes actually read, or negative on error."]
4417 pub fn duckdb_file_handle_read(
4418 file_handle: duckdb_file_handle,
4419 buffer: *mut ::std::os::raw::c_void,
4420 size: i64,
4421 ) -> i64;
4422}
4423unsafe extern "C" {
4424 #[doc = "Writes data from the buffer to the file.\n\n @param file_handle The file handle to write to.\n @param buffer The buffer containing data to write.\n @param size The number of bytes to write.\n @return The number of bytes actually written, or negative on error."]
4425 pub fn duckdb_file_handle_write(
4426 file_handle: duckdb_file_handle,
4427 buffer: *const ::std::os::raw::c_void,
4428 size: i64,
4429 ) -> i64;
4430}
4431unsafe extern "C" {
4432 #[doc = "Tells the current position in the file.\n\n @param file_handle The file handle to tell the position of.\n @return The current position in the file, or negative on error."]
4433 pub fn duckdb_file_handle_tell(file_handle: duckdb_file_handle) -> i64;
4434}
4435unsafe extern "C" {
4436 #[doc = "Gets the size of the file.\n\n @param file_handle The file handle to get the size of.\n @return The size of the file in bytes, or negative on error."]
4437 pub fn duckdb_file_handle_size(file_handle: duckdb_file_handle) -> i64;
4438}
4439unsafe extern "C" {
4440 #[doc = "Seeks to a specific position in the file.\n\n @param file_handle The file handle to seek in.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure. If unsuccessful, the error data can be retrieved using\n`duckdb_file_handle_error_data`."]
4441 pub fn duckdb_file_handle_seek(
4442 file_handle: duckdb_file_handle,
4443 position: i64,
4444 ) -> duckdb_state;
4445}
4446unsafe extern "C" {
4447 #[doc = "Synchronizes the file's state with the underlying storage.\n\n @param file_handle The file handle to synchronize.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure. If unsuccessful, the error data can be retrieved using\n`duckdb_file_handle_error_data`."]
4448 pub fn duckdb_file_handle_sync(file_handle: duckdb_file_handle) -> duckdb_state;
4449}
4450unsafe extern "C" {
4451 #[doc = "Closes the given file handle.\n\n @param file_handle The file handle to close.\n @return `DuckDBSuccess` on success or `DuckDBError` on failure. If unsuccessful, the error data can be retrieved using\n`duckdb_file_handle_error_data`."]
4452 pub fn duckdb_file_handle_close(file_handle: duckdb_file_handle) -> duckdb_state;
4453}
4454unsafe extern "C" {
4455 #[doc = "Creates a configuration option instance.\n\n @return The resulting configuration option instance. Must be destroyed with `duckdb_destroy_config_option`."]
4456 pub fn duckdb_create_config_option() -> duckdb_config_option;
4457}
4458unsafe extern "C" {
4459 #[doc = "Destroys the given configuration option instance.\n @param option The configuration option instance to destroy."]
4460 pub fn duckdb_destroy_config_option(option: *mut duckdb_config_option);
4461}
4462unsafe extern "C" {
4463 #[doc = "Sets the name of the configuration option.\n\n @param option The configuration option instance.\n @param name The name to set."]
4464 pub fn duckdb_config_option_set_name(
4465 option: duckdb_config_option,
4466 name: *const ::std::os::raw::c_char,
4467 );
4468}
4469unsafe extern "C" {
4470 #[doc = "Sets the type of the configuration option.\n\n @param option The configuration option instance.\n @param type The type to set."]
4471 pub fn duckdb_config_option_set_type(
4472 option: duckdb_config_option,
4473 type_: duckdb_logical_type,
4474 );
4475}
4476unsafe extern "C" {
4477 #[doc = "Sets the default value of the configuration option.\nIf the type of this option has already been set with `duckdb_config_option_set_type`, the value is cast to the type.\nOtherwise, the type is inferred from the value.\n\n @param option The configuration option instance.\n @param default_value The default value to set."]
4478 pub fn duckdb_config_option_set_default_value(
4479 option: duckdb_config_option,
4480 default_value: duckdb_value,
4481 );
4482}
4483unsafe extern "C" {
4484 #[doc = "Sets the default scope of the configuration option.\nIf not set, this defaults to `DUCKDB_CONFIG_OPTION_SCOPE_SESSION`.\n\n @param option The configuration option instance.\n @param default_scope The default scope to set."]
4485 pub fn duckdb_config_option_set_default_scope(
4486 option: duckdb_config_option,
4487 default_scope: duckdb_config_option_scope,
4488 );
4489}
4490unsafe extern "C" {
4491 #[doc = "Sets the description of the configuration option.\n\n @param option The configuration option instance.\n @param description The description to set."]
4492 pub fn duckdb_config_option_set_description(
4493 option: duckdb_config_option,
4494 description: *const ::std::os::raw::c_char,
4495 );
4496}
4497unsafe extern "C" {
4498 #[doc = "Registers the given configuration option on the specified connection.\n\n @param connection The connection to register the option on.\n @param option The configuration option instance to register.\n @return A duckdb_state indicating success or failure."]
4499 pub fn duckdb_register_config_option(
4500 connection: duckdb_connection,
4501 option: duckdb_config_option,
4502 ) -> duckdb_state;
4503}
4504unsafe extern "C" {
4505 #[doc = "Retrieves the value of a configuration option by name from the given client context.\n\n @param context The client context.\n @param name The name of the configuration option to retrieve.\n @param out_scope Output parameter to optionally store the scope that the configuration option was retrieved from.\nIf this is `nullptr`, the scope is not returned.\nIf the requested option does not exist the scope is set to `DUCKDB_CONFIG_OPTION_SCOPE_INVALID`.\n @return The value of the configuration option. Returns `nullptr` if the option does not exist."]
4506 pub fn duckdb_client_context_get_config_option(
4507 context: duckdb_client_context,
4508 name: *const ::std::os::raw::c_char,
4509 out_scope: *mut duckdb_config_option_scope,
4510 ) -> duckdb_value;
4511}
4512unsafe extern "C" {
4513 #[doc = "Creates a new empty copy function.\n\nThe return value must be destroyed with `duckdb_destroy_copy_function`.\n\n @return The copy function object."]
4514 pub fn duckdb_create_copy_function() -> duckdb_copy_function;
4515}
4516unsafe extern "C" {
4517 #[doc = "Sets the name of the copy function.\n\n @param copy_function The copy function\n @param name The name to set"]
4518 pub fn duckdb_copy_function_set_name(
4519 copy_function: duckdb_copy_function,
4520 name: *const ::std::os::raw::c_char,
4521 );
4522}
4523unsafe extern "C" {
4524 #[doc = "Sets the extra info pointer of the copy function, which can be used to store arbitrary data.\n\n @param copy_function The copy function\n @param extra_info The extra info pointer\n @param destructor A destructor function to call to destroy the extra info"]
4525 pub fn duckdb_copy_function_set_extra_info(
4526 copy_function: duckdb_copy_function,
4527 extra_info: *mut ::std::os::raw::c_void,
4528 destructor: duckdb_delete_callback_t,
4529 );
4530}
4531unsafe extern "C" {
4532 #[doc = "Registers the given copy function on the database connection under the specified name.\n\n @param connection The database connection\n @param copy_function The copy function to register"]
4533 pub fn duckdb_register_copy_function(
4534 connection: duckdb_connection,
4535 copy_function: duckdb_copy_function,
4536 ) -> duckdb_state;
4537}
4538unsafe extern "C" {
4539 #[doc = "Destroys the given copy function object.\n @param copy_function The copy function to destroy."]
4540 pub fn duckdb_destroy_copy_function(copy_function: *mut duckdb_copy_function);
4541}
4542unsafe extern "C" {
4543 #[doc = "Sets the bind function of the copy function, to use when binding `COPY ... TO`.\n\n @param bind The bind function"]
4544 pub fn duckdb_copy_function_set_bind(
4545 copy_function: duckdb_copy_function,
4546 bind: duckdb_copy_function_bind_t,
4547 );
4548}
4549unsafe extern "C" {
4550 #[doc = "Report that an error occurred during the binding-phase of a `COPY ... TO` function.\n\n @param info The bind info provided to the bind function\n @param error The error message"]
4551 pub fn duckdb_copy_function_bind_set_error(
4552 info: duckdb_copy_function_bind_info,
4553 error: *const ::std::os::raw::c_char,
4554 );
4555}
4556unsafe extern "C" {
4557 #[doc = "Retrieves the extra info pointer of the copy function.\n\n @param info The bind info provided to the bind function\n @return The extra info pointer."]
4558 pub fn duckdb_copy_function_bind_get_extra_info(
4559 info: duckdb_copy_function_bind_info
4560 ) -> *mut ::std::os::raw::c_void;
4561}
4562unsafe extern "C" {
4563 #[doc = "Retrieves the client context of the current connection binding the `COPY ... TO` function.\n\nMust be destroyed with `duckdb_destroy_client_context`\n\n @param info The bind info provided to the bind function\n @return The client context."]
4564 pub fn duckdb_copy_function_bind_get_client_context(
4565 info: duckdb_copy_function_bind_info
4566 ) -> duckdb_client_context;
4567}
4568unsafe extern "C" {
4569 #[doc = "Retrieves the number of columns that will be provided to the `COPY ... TO` function.\n\n @param info The bind info provided to the bind function\n @return The number of columns."]
4570 pub fn duckdb_copy_function_bind_get_column_count(
4571 info: duckdb_copy_function_bind_info
4572 ) -> idx_t;
4573}
4574unsafe extern "C" {
4575 #[doc = "Retrieves the type of a column that will be provided to the `COPY ... TO` function.\n\n @param info The bind info provided to the bind function\n @param col_idx The index of the column to retrieve the type for\n @return The type of the column. Must be destroyed with `duckdb_destroy_logical_type`."]
4576 pub fn duckdb_copy_function_bind_get_column_type(
4577 info: duckdb_copy_function_bind_info,
4578 col_idx: idx_t,
4579 ) -> duckdb_logical_type;
4580}
4581unsafe extern "C" {
4582 #[doc = "Retrieves all values for the given options provided to the `COPY ... TO` function.\n\n @param info The bind info provided to the bind function\n @return A STRUCT value containing all options as fields. Must be destroyed with `duckdb_destroy_value`."]
4583 pub fn duckdb_copy_function_bind_get_options(
4584 info: duckdb_copy_function_bind_info
4585 ) -> duckdb_value;
4586}
4587unsafe extern "C" {
4588 #[doc = "Sets the bind data of the copy function, to be provided to the init, sink and finalize functions.\n\n @param info The bind info provided to the bind function\n @param bind_data The bind data pointer\n @param destructor A destructor function to call to destroy the bind data"]
4589 pub fn duckdb_copy_function_bind_set_bind_data(
4590 info: duckdb_copy_function_bind_info,
4591 bind_data: *mut ::std::os::raw::c_void,
4592 destructor: duckdb_delete_callback_t,
4593 );
4594}
4595unsafe extern "C" {
4596 #[doc = "Sets the initialization function of the copy function, called right before executing `COPY ... TO`.\n\n @param init The init function"]
4597 pub fn duckdb_copy_function_set_global_init(
4598 copy_function: duckdb_copy_function,
4599 init: duckdb_copy_function_global_init_t,
4600 );
4601}
4602unsafe extern "C" {
4603 #[doc = "Report that an error occurred during the initialization-phase of a `COPY ... TO` function.\n\n @param info The init info provided to the init function\n @param error The error message"]
4604 pub fn duckdb_copy_function_global_init_set_error(
4605 info: duckdb_copy_function_global_init_info,
4606 error: *const ::std::os::raw::c_char,
4607 );
4608}
4609unsafe extern "C" {
4610 #[doc = "Retrieves the extra info pointer of the copy function.\n\n @param info The init info provided to the init function\n @return The extra info pointer."]
4611 pub fn duckdb_copy_function_global_init_get_extra_info(
4612 info: duckdb_copy_function_global_init_info
4613 ) -> *mut ::std::os::raw::c_void;
4614}
4615unsafe extern "C" {
4616 #[doc = "Retrieves the client context of the current connection initializing the `COPY ... TO` function.\n\nMust be destroyed with `duckdb_destroy_client_context`\n\n @param info The init info provided to the init function\n @return The client context."]
4617 pub fn duckdb_copy_function_global_init_get_client_context(
4618 info: duckdb_copy_function_global_init_info
4619 ) -> duckdb_client_context;
4620}
4621unsafe extern "C" {
4622 #[doc = "Retrieves the bind data provided during the binding-phase of a `COPY ... TO` function.\n\n @param info The init info provided to the init function\n @return The bind data pointer."]
4623 pub fn duckdb_copy_function_global_init_get_bind_data(
4624 info: duckdb_copy_function_global_init_info
4625 ) -> *mut ::std::os::raw::c_void;
4626}
4627unsafe extern "C" {
4628 #[doc = "Retrieves the file path provided to the `COPY ... TO` function.\n\nLives for the duration of the initialization callback, must not be destroyed.\n\n @param info The init info provided to the init function\n @return The file path."]
4629 pub fn duckdb_copy_function_global_init_get_file_path(
4630 info: duckdb_copy_function_global_init_info
4631 ) -> *const ::std::os::raw::c_char;
4632}
4633unsafe extern "C" {
4634 #[doc = "Sets the global state of the copy function, to be provided to all subsequent local init, sink and finalize functions.\n\n @param info The init info provided to the init function\n @param global_state The global state pointer\n @param destructor A destructor function to call to destroy the global state"]
4635 pub fn duckdb_copy_function_global_init_set_global_state(
4636 info: duckdb_copy_function_global_init_info,
4637 global_state: *mut ::std::os::raw::c_void,
4638 destructor: duckdb_delete_callback_t,
4639 );
4640}
4641unsafe extern "C" {
4642 #[doc = "Sets the sink function of the copy function, called during `COPY ... TO`.\n\n @param function The sink function"]
4643 pub fn duckdb_copy_function_set_sink(
4644 copy_function: duckdb_copy_function,
4645 function: duckdb_copy_function_sink_t,
4646 );
4647}
4648unsafe extern "C" {
4649 #[doc = "Report that an error occurred during the sink-phase of a `COPY ... TO` function.\n\n @param info The sink info provided to the sink function\n @param error The error message"]
4650 pub fn duckdb_copy_function_sink_set_error(
4651 info: duckdb_copy_function_sink_info,
4652 error: *const ::std::os::raw::c_char,
4653 );
4654}
4655unsafe extern "C" {
4656 #[doc = "Retrieves the extra info pointer of the copy function.\n\n @param info The sink info provided to the sink function\n @return The extra info pointer."]
4657 pub fn duckdb_copy_function_sink_get_extra_info(
4658 info: duckdb_copy_function_sink_info
4659 ) -> *mut ::std::os::raw::c_void;
4660}
4661unsafe extern "C" {
4662 #[doc = "Retrieves the client context of the current connection during the sink-phase of the `COPY ... TO` function.\n\nMust be destroyed with `duckdb_destroy_client_context`\n\n @param info The sink info provided to the sink function\n @return The client context."]
4663 pub fn duckdb_copy_function_sink_get_client_context(
4664 info: duckdb_copy_function_sink_info
4665 ) -> duckdb_client_context;
4666}
4667unsafe extern "C" {
4668 #[doc = "Retrieves the bind data provided during the binding-phase of a `COPY ... TO` function.\n\n @param info The sink info provided to the sink function\n @return The bind data pointer."]
4669 pub fn duckdb_copy_function_sink_get_bind_data(
4670 info: duckdb_copy_function_sink_info
4671 ) -> *mut ::std::os::raw::c_void;
4672}
4673unsafe extern "C" {
4674 #[doc = "Retrieves the global state provided during the init-phase of a `COPY ... TO` function.\n\n @param info The sink info provided to the sink function\n @return The global state pointer."]
4675 pub fn duckdb_copy_function_sink_get_global_state(
4676 info: duckdb_copy_function_sink_info
4677 ) -> *mut ::std::os::raw::c_void;
4678}
4679unsafe extern "C" {
4680 #[doc = "Sets the finalize function of the copy function, called at the end of `COPY ... TO`.\n\n @param finalize The finalize function"]
4681 pub fn duckdb_copy_function_set_finalize(
4682 copy_function: duckdb_copy_function,
4683 finalize: duckdb_copy_function_finalize_t,
4684 );
4685}
4686unsafe extern "C" {
4687 #[doc = "Report that an error occurred during the finalize-phase of a `COPY ... TO` function\n\n @param info The finalize info provided to the finalize function\n @param error The error message"]
4688 pub fn duckdb_copy_function_finalize_set_error(
4689 info: duckdb_copy_function_finalize_info,
4690 error: *const ::std::os::raw::c_char,
4691 );
4692}
4693unsafe extern "C" {
4694 #[doc = "Retrieves the extra info pointer of the copy function.\n\n @param info The finalize info provided to the finalize function\n @return The extra info pointer."]
4695 pub fn duckdb_copy_function_finalize_get_extra_info(
4696 info: duckdb_copy_function_finalize_info
4697 ) -> *mut ::std::os::raw::c_void;
4698}
4699unsafe extern "C" {
4700 #[doc = "Retrieves the client context of the current connection during the finalize-phase of the `COPY ... TO` function.\n\nMust be destroyed with `duckdb_destroy_client_context`\n\n @param info The finalize info provided to the finalize function\n @return The client context."]
4701 pub fn duckdb_copy_function_finalize_get_client_context(
4702 info: duckdb_copy_function_finalize_info
4703 ) -> duckdb_client_context;
4704}
4705unsafe extern "C" {
4706 #[doc = "Retrieves the bind data provided during the binding-phase of a `COPY ... TO` function.\n\n @param info The finalize info provided to the finalize function\n @return The bind data pointer."]
4707 pub fn duckdb_copy_function_finalize_get_bind_data(
4708 info: duckdb_copy_function_finalize_info
4709 ) -> *mut ::std::os::raw::c_void;
4710}
4711unsafe extern "C" {
4712 #[doc = "Retrieves the global state provided during the init-phase of a `COPY ... TO` function.\n\n @param info The finalize info provided to the finalize function\n @return The global state pointer."]
4713 pub fn duckdb_copy_function_finalize_get_global_state(
4714 info: duckdb_copy_function_finalize_info
4715 ) -> *mut ::std::os::raw::c_void;
4716}
4717unsafe extern "C" {
4718 #[doc = "Sets the table function to use when executing a `COPY ... FROM (...)` statement with this copy function.\n\nThe table function must have a `duckdb_table_function_bind_t`, `duckdb_table_function_init_t` and\n`duckdb_table_function_t` set.\n\nThe table function must take a single VARCHAR parameter (the file path).\n\nOptions passed to the `COPY ... FROM (...)` statement are forwarded as named parameters to the table function.\n\nSince `COPY ... FROM` copies into an already existing table, the table function should not define its own result columns\nusing `duckdb_bind_add_result_column` when binding . Instead use `duckdb_table_function_bind_get_result_column_count`\nand related functions in the bind callback of the table function to retrieve the schema of the target table of the `COPY\n... FROM` statement.\n\n @param copy_function The copy function\n @param table_function The table function to use for `COPY ... FROM`"]
4719 pub fn duckdb_copy_function_set_copy_from_function(
4720 copy_function: duckdb_copy_function,
4721 table_function: duckdb_table_function,
4722 );
4723}
4724unsafe extern "C" {
4725 #[doc = "Retrieves the number of result columns of a table function.\n\nIf the table function is used in a `COPY ... FROM` statement, this can be used to retrieve the number of columns in the\ntarget table at the start of the bind callback.\n\n @param info The bind info provided to the bind function\n @return The number of result columns."]
4726 pub fn duckdb_table_function_bind_get_result_column_count(info: duckdb_bind_info) -> idx_t;
4727}
4728unsafe extern "C" {
4729 #[doc = "Retrieves the name of a result column of a table function.\n\nIf the table function is used in a `COPY ... FROM` statement, this can be used to retrieve the names of the columns in\nthe target table at the start of the bind callback.\n\nThe result is valid for the duration of the bind callback or until the next call to `duckdb_bind_add_result_column`, so\nit must not be destroyed.\n\n @param info The bind info provided to the bind function\n @param col_idx The index of the result column to retrieve the name for\n @return The name of the result column."]
4730 pub fn duckdb_table_function_bind_get_result_column_name(
4731 info: duckdb_bind_info,
4732 col_idx: idx_t,
4733 ) -> *const ::std::os::raw::c_char;
4734}
4735unsafe extern "C" {
4736 #[doc = "Retrieves the type of a result column of a table function.\n\nIf the table function is used in a `COPY ... FROM` statement, this can be used to retrieve the types of the columns in\nthe target table at the start of the bind callback.\n\nThe result must be destroyed with `duckdb_destroy_logical_type`.\n\n @param info The bind info provided to the bind function\n @param col_idx The index of the result column to retrieve the type for\n @return The type of the result column."]
4737 pub fn duckdb_table_function_bind_get_result_column_type(
4738 info: duckdb_bind_info,
4739 col_idx: idx_t,
4740 ) -> duckdb_logical_type;
4741}
4742unsafe extern "C" {
4743 #[doc = "Retrieve a database catalog instance by name.\nThis function can only be called from within the context of an active transaction, e.g. during execution of a registered\nfunction callback. Otherwise returns `nullptr`.\n @param context The client context.\n @param catalog_name The name of the catalog.\n @return The resulting catalog instance, or `nullptr` if called from outside an active transaction or if a catalog with\nthe specified name does not exist. Must be destroyed with `duckdb_destroy_catalog`"]
4744 pub fn duckdb_client_context_get_catalog(
4745 context: duckdb_client_context,
4746 catalog_name: *const ::std::os::raw::c_char,
4747 ) -> duckdb_catalog;
4748}
4749unsafe extern "C" {
4750 #[doc = "Retrieve the \"type name\" of the given catalog.\nE.g. for a DuckDB database, this returns 'duckdb'.\nThe returned string is owned by the catalog and remains valid until the catalog is destroyed.\n\n @param catalog The catalog.\n @return The type name of the catalog."]
4751 pub fn duckdb_catalog_get_type_name(catalog: duckdb_catalog) -> *const ::std::os::raw::c_char;
4752}
4753unsafe extern "C" {
4754 #[doc = "Retrieve a catalog entry from the given catalog by type, schema name and entry name.\nThe returned catalog entry remains valid for the duration of the current transaction.\n\n @param catalog The catalog.\n @param context The client context.\n @param entry_type The type of the catalog entry to retrieve.\n @param schema_name The schema name of the catalog entry.\n @param entry_name The name of the catalog entry.\n @return The resulting catalog entry, or `nullptr` if no such entry exists. Must be destroyed with\n`duckdb_destroy_catalog_entry`. Remains valid for the duration of the current transaction."]
4755 pub fn duckdb_catalog_get_entry(
4756 catalog: duckdb_catalog,
4757 context: duckdb_client_context,
4758 entry_type: duckdb_catalog_entry_type,
4759 schema_name: *const ::std::os::raw::c_char,
4760 entry_name: *const ::std::os::raw::c_char,
4761 ) -> duckdb_catalog_entry;
4762}
4763unsafe extern "C" {
4764 #[doc = "Destroys the given catalog instance.\n\nNote that this does not actually \"drop\" the contents of the catalog; it merely frees the C API handle.\n\n @param catalog The catalog instance to destroy."]
4765 pub fn duckdb_destroy_catalog(catalog: *mut duckdb_catalog);
4766}
4767unsafe extern "C" {
4768 #[doc = "Get the type of the given catalog entry.\n\n @param entry The catalog entry.\n @return The type of the catalog entry."]
4769 pub fn duckdb_catalog_entry_get_type(entry: duckdb_catalog_entry) -> duckdb_catalog_entry_type;
4770}
4771unsafe extern "C" {
4772 #[doc = "Get the name of the given catalog entry.\n\n @param entry The catalog entry.\n @return The name of the catalog entry. The returned string is owned by the catalog entry and remains valid until the\ncatalog entry is destroyed."]
4773 pub fn duckdb_catalog_entry_get_name(
4774 entry: duckdb_catalog_entry
4775 ) -> *const ::std::os::raw::c_char;
4776}
4777unsafe extern "C" {
4778 #[doc = "Destroys the given catalog entry instance.\n\nNote that this does not actually \"drop\" the catalog entry from the database catalog; it merely frees the C API handle.\n\n @param entry The catalog entry instance to destroy."]
4779 pub fn duckdb_destroy_catalog_entry(entry: *mut duckdb_catalog_entry);
4780}
4781unsafe extern "C" {
4782 #[doc = "Creates a new log storage object.\n\n @return A log storage object. Must be destroyed with `duckdb_destroy_log_storage`."]
4783 pub fn duckdb_create_log_storage() -> duckdb_log_storage;
4784}
4785unsafe extern "C" {
4786 #[doc = "Destroys a log storage object.\n\n @param log_storage The log storage object to destroy."]
4787 pub fn duckdb_destroy_log_storage(log_storage: *mut duckdb_log_storage);
4788}
4789unsafe extern "C" {
4790 #[doc = "Sets the callback function for writing log entries.\n\n @param log_storage The log storage object.\n @param function The function to call."]
4791 pub fn duckdb_log_storage_set_write_log_entry(
4792 log_storage: duckdb_log_storage,
4793 function: duckdb_logger_write_log_entry_t,
4794 );
4795}
4796unsafe extern "C" {
4797 #[doc = "Sets the extra data of the custom log storage.\n\n @param log_storage The log storage object.\n @param extra_data The extra data that is passed back into the callbacks.\n @param delete_callback The delete callback to call on the extra data, if any."]
4798 pub fn duckdb_log_storage_set_extra_data(
4799 log_storage: duckdb_log_storage,
4800 extra_data: *mut ::std::os::raw::c_void,
4801 delete_callback: duckdb_delete_callback_t,
4802 );
4803}
4804unsafe extern "C" {
4805 #[doc = "Sets the name of the log storage.\n\n @param log_storage The log storage object.\n @param name The name of the log storage."]
4806 pub fn duckdb_log_storage_set_name(
4807 log_storage: duckdb_log_storage,
4808 name: *const ::std::os::raw::c_char,
4809 );
4810}
4811unsafe extern "C" {
4812 #[doc = "Registers a custom log storage for the logger.\n\n @param database A database object.\n @param log_storage The log storage object.\n @return Whether the registration was successful."]
4813 pub fn duckdb_register_log_storage(
4814 database: duckdb_database,
4815 log_storage: duckdb_log_storage,
4816 ) -> duckdb_state;
4817}
4818unsafe extern "C" {
4819 #[doc = "Gets the CRS (Coordinate Reference System) of a GEOMETRY type.\nResult must be freed with `duckdb_free`.\n\n @param type The GEOMETRY type.\n @return The CRS of the GEOMETRY type, or NULL if the type is not a GEOMETRY type."]
4820 pub fn duckdb_geometry_type_get_crs(type_: duckdb_logical_type) -> *mut ::std::os::raw::c_char;
4821}