Expand description
better-duck-core — a safe, low-level Rust wrapper around the
DuckDB C API (libduckdb-sys).
This crate provides:
- A high-level
connection::Connectionfor opening databases and executing SQL. - Low-level raw types (
RawConnection,DuckResult,DuckRow) for advanced use. - Type conversion traits (
types::DuckDialect,types::appendable::AppendAble) for mapping between Rust types and DuckDB values.
Re-exports§
pub extern crate libduckdb_sys;
Re-exports§
pub use asynchronous::AsyncConnection;pub use asynchronous::AsyncDatabase;pub use asynchronous::AsyncPool;pub use config::AccessMode;pub use config::Config;pub use config::DefaultNullOrder;pub use config::DefaultOrder;pub use database::Database;pub use result_set::ResultSet;pub use types::appendable::AppendAble;pub use libduckdb_sys as ffi;
Modules§
- asynchronous
- Async facade over
connection::Connection, gated by theasyncfeature. Async facade overConnection, gated by theasyncfeature. - config
- DuckDB database configuration.
- connection
- High-level DuckDB connection type.
- database
- A shared, cloneable handle to an open DuckDB database.
- error
- Error types returned by this crate.
- pool
- An
r2d2connection pool backed by a sharedDatabase. Anr2d2connection pool backed by a sharedDatabase. - result_
set - An owned, thread-safe, fully materialized query result.
- types
- DuckDB type system and value conversion traits.
- udf
- User-defined DuckDB functions: scalar functions and table functions. User-defined DuckDB functions: scalar functions and table functions.
Macros§
- duck_
bail - Returns early from a fallible user-defined-function body with a formatted error message.
- impl_
appendable_ via_ to_ duck_ native - Implements
AppendAblefor a type that already implementscrate::types::DuckDialectby going through theduckdb_valuepath:to_duck()→duckdb_bind_value/duckdb_append_value→duckdb_destroy_value.
Structs§
- Appender
- A DuckDB appender for bulk-inserting rows into a table. A DuckDB appender for bulk-inserting rows into a table without going through the SQL parser.
- Cached
Statement - A prepared statement suitable for caching and re-execution. A prepared statement that can be reset and re-executed with different bindings.
- Duck
Result - A fully iterable DuckDB query result. Represents the result of a DuckDB query, providing row-by-row iteration over the returned data.
- DuckRow
- A single row from a DuckDB query result. A single row of data returned by a DuckDB query, consisting of typed values and their associated column names.
Attribute Macros§
- duckdb_
scalar - Registers a plain Rust function as a DuckDB scalar function. See
udf. Registers a plain Rust function as a DuckDB scalar function. - duckdb_
table_ function - Registers a plain Rust function as a DuckDB table function. See
udf. Registers a plain Rust function as a DuckDB table function.