1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
// SPDX-License-Identifier: MIT
// Copyright 2026 Tom F. <https://github.com/tomtom215/>
// My way of giving something small back to the open source community
// and encouraging more Rust development!
//! Convenience re-exports for the most commonly used `quack-rs` items.
//!
//! This prelude covers the types and functions needed in the `src/lib.rs`
//! of a typical `DuckDB` Rust extension. Import it with:
//!
//! ```rust,no_run
//! use quack_rs::prelude::*;
//! ```
//!
//! # What is included
//!
//! | Item | From |
//! |------|------|
//! | [`init_extension`] | `entry_point` module |
//! | [`init_extension_v2`] | `entry_point` module |
//! | `entry_point!` | `entry_point` module (macro) |
//! | `entry_point_v2!` | `entry_point` module (macro) |
//! | [`Connection`] | `connection` module |
//! | [`Registrar`] | `connection` module |
//! | [`CastFn`] | `cast` module |
//! | [`CastFunctionBuilder`] | `cast` module |
//! | [`CastFunctionInfo`] | `cast` module |
//! | [`CastMode`] | `cast` module |
//! | [`AggregateFunctionBuilder`] | `aggregate` module |
//! | [`AggregateFunctionInfo`] | `aggregate` module |
//! | [`AggregateFunctionSetBuilder`] | `aggregate` module |
//! | [`AggregateState`] | `aggregate` module |
//! | [`FfiState`] | `aggregate` module |
//! | [`ScalarFunctionBuilder`] | `scalar` module |
//! | [`ScalarFunctionInfo`] | `scalar` module |
//! | [`ScalarFunctionSetBuilder`] | `scalar` module |
//! | [`ScalarOverloadBuilder`] | `scalar` module |
//! | [`TableFunctionBuilder`] | `table` module |
//! | [`BindInfo`] | `table` module |
//! | [`InitInfo`] | `table` module |
//! | [`FunctionInfo`] | `table` module |
//! | [`FfiBindData`] | `table` module |
//! | [`FfiInitData`] | `table` module |
//! | [`FfiLocalInitData`] | `table` module |
//! | [`ReplacementScanBuilder`] | `replacement_scan` module |
//! | [`ReplacementScanInfo`] | `replacement_scan` module |
//! | [`SqlMacro`] | `sql_macro` module |
//! | [`ChunkWriter`] | `chunk_writer` module |
//! | [`DataChunk`] | `data_chunk` module |
//! | [`Value`] | `value` module |
//! | [`VectorReader`] | `vector` module |
//! | [`VectorWriter`] | `vector` module |
//! | [`ValidityBitmap`] | `vector::validity` module |
//! | [`ArrayVector`] | `vector::complex` module |
//! | [`StructReader`] | `vector::struct_reader` module |
//! | [`StructWriter`] | `vector::struct_writer` module |
//! | [`StructVector`] | `vector::complex` module |
//! | [`ListVector`] | `vector::complex` module |
//! | [`MapVector`] | `vector::complex` module |
//! | [`TypeId`] | `types` module |
//! | [`LogicalType`] | `types` module |
//! | [`NullHandling`] | `types` module |
//! | [`DuckInterval`] | `interval` module |
//! | [`interval_to_micros`] | `interval` module |
//! | [`ExtensionError`] | `error` module |
//! | [`ExtResult`] | `error` module |
//! | [`SecretEntry`] | `secrets` module |
//! | [`SecretsManager`] | `secrets` module |
//! | [`TlsConfigProvider`] | `tls` module |
//! | [`TlsVersion`] | `tls` module |
//! | [`audit_tls_provider`] | `tls` module |
//! | [`ExtensionWarning`] | `warning` module |
//! | [`WarningCollector`] | `warning` module |
//! | [`WarningSeverity`] | `warning` module |
//! | [`DUCKDB_API_VERSION`] | crate root |
//!
//! # What is NOT included
//!
//! The following items are intentionally excluded from the prelude because they
//! are used less frequently and benefit from explicit import paths:
//!
//! - [`crate::config::DbConfig`] — RAII wrapper for opening secondary `DuckDB` databases;
//! import explicitly via `use quack_rs::config::DbConfig` when needed
//! - `validate::*` — validation utilities (use explicitly to make intent clear)
//! - `scaffold::*` — project generation (use explicitly)
//! - `testing::*` — test harness (typically imported only in `#[cfg(test)]`)
//! - `interval::read_interval_at` — low-level; use [`VectorReader::read_interval`] instead
//!
//! # Example
//!
//! ```rust,no_run
//! use quack_rs::prelude::*;
//!
//! // Your state struct
//! #[derive(Default)]
//! struct MyState { count: i64 }
//! impl AggregateState for MyState {}
//!
//! // Registration (called from your entry point)
//! fn register(con: libduckdb_sys::duckdb_connection) -> ExtResult<()> {
//! let _ = AggregateFunctionBuilder::try_new("my_count")?
//! .param(TypeId::BigInt)
//! .returns(TypeId::BigInt)
//! .state_size(FfiState::<MyState>::size_callback)
//! .init(FfiState::<MyState>::init_callback)
//! // ... callbacks ...
//! ;
//! Ok(())
//! }
//! ```
// Entry point
pub use crate;
// Connection facade and Registrar trait
pub use crate;
// Cast functions
pub use crate;
// Aggregate functions
pub use crate;
// Scalar functions
pub use crate;
pub use crate;
// Copy functions
pub use crate;
// Table functions
pub use crate;
// Replacement scans
pub use crate;
// SQL macros
pub use crateSqlMacro;
// Chunk writer
pub use crateChunkWriter;
// Data chunks
pub use crateDataChunk;
// Value
pub use crateValue;
// Vector I/O
pub use crate;
pub use crate;
// Types
pub use crate;
// Interval
pub use crate;
// Error
pub use crate;
// Secrets manager
pub use crate;
// TLS config provider
pub use crate;
// Warnings
pub use crate;
// API version constant
pub use crateDUCKDB_API_VERSION;
// The entry_point! macro is already available at the crate root via #[macro_export],
// so `use quack_rs::prelude::*` brings it into scope automatically.