better-duck-core for the driver, and
better-duck-diesel if you want the Diesel ORM backend. DuckDB itself is
compiled and embedded — there is no system package to install.
Add the crates
- Cargo.toml
- cargo add
The default feature set is
["chrono", "decimal"]. To pick features à la carte, see
Feature flags.
Bundled DuckDB — no system library
DuckDB is compiled from vendored source and statically linked into your binary bybetter-duck-sys. You do not install a DuckDB system package, and there is no shared library to
ship at runtime. This is what makes better-duck embedded-first
and suitable for Tauri desktop apps, iOS cross-builds, and other environments where a system library
isn’t an option.
Toolchain requirements
The minimum supported Rust version (MSRV) is 1.96. Check with
rustc --version; update with
rustup update. A C/C++ toolchain is also required to compile the vendored DuckDB (the one your
platform already uses for native crates — e.g. the MSVC build tools on Windows, Xcode command-line
tools on macOS, gcc/clang on Linux).Troubleshooting
cargo add better-duck-core resolves to nothing / 0.1 doesn't match
cargo add better-duck-core resolves to nothing / 0.1 doesn't match
Cargo excludes pre-releases from a default requirement. Pin the exact string
"0.1.0-beta.8" (or pass --version 0.1.0-beta.8 to cargo add).The first build takes minutes
The first build takes minutes
Expected — the first build compiles the DuckDB engine from source. Incremental builds reuse the
artifact. Enabling an extension feature recompiles a variant and adds time.
A linker or C compiler error on first build
A linker or C compiler error on first build
DuckDB is compiled from C/C++ source, so a working native toolchain is required. Install your
platform’s standard build tools (see Toolchain requirements) and rebuild.
Which DuckDB version am I running?
Which DuckDB version am I running?
Call
better_duck_core::library_version() at runtime — it
returns the linked DuckDB version string. There is no system DuckDB to match.Next steps
Quickstart
A minimal end-to-end example.
Feature flags
Turn on
arrow, udf, derive, async, extensions, and more.Architecture
The crate family and the bundled-DuckDB model.
Versioning & compatibility
Beta policy, MSRV, platforms, and upgrading.