Skip to main content
better-duck is distributed on crates.io. Add 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.
better-duck is a pre-release (0.1.0-beta.8). Cargo’s default version requirement excludes pre-release versions: a requirement like "0.1" will not match 0.1.0-beta.8. You must pin the exact version string, as shown below. See Versioning & compatibility.

Add the crates

better-duck-macros is pulled in automatically by the udf and derive features — you don’t depend on it directly. Keep sibling crates on the same version.
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 by better-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.
Because DuckDB is compiled from source, your first build (and any clean rebuild) is slower than a typical crate — it is compiling the DuckDB engine itself. Subsequent incremental builds reuse the compiled artifact. Builds that bundle an extension (for example json + parquet) recompile a DuckDB variant and take noticeably longer.

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).
better-duck is licensed under either MIT or Apache-2.0, at your option.

Troubleshooting

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).
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.
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.
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.