better-duck is designed to be embedded-first: DuckDB is compiled from vendored C++ source at build time via theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/nimdeveloper/better-duck/llms.txt
Use this file to discover all available pages before exploring further.
cc crate, so there is no requirement to install or locate a system DuckDB library on any supported platform. This makes better-duck suitable for Tauri desktop applications, iOS cross-builds, CI environments, and any context where you cannot rely on a pre-installed native library. The same codebase runs unchanged across Linux, macOS, Windows, and iOS without any platform-specific feature flags.
Supported Targets
The following targets are verified in CI on every commit and pull request:| Platform | Status |
|---|---|
| Linux x86_64 | ✓ CI-tested |
| macOS Apple Silicon (aarch64) | ✓ CI-tested |
| macOS x86_64 | ✓ CI-tested |
| Windows x86_64 | ✓ CI-tested |
| iOS aarch64 | ✓ CI cross-build |
| iOS Simulator x86_64 | ✓ CI cross-build |
cargo build --target aarch64-apple-ios) to verify that the crate and DuckDB’s C++ source compile cleanly for those targets; test execution on iOS hardware is not part of CI.
WASM / browser (
wasm32-unknown-unknown) is listed in the roadmap as exploratory. DuckDB itself has a WASM build, and investigating whether better-duck-core can compile to WASM is on the list — but it is not currently supported. Do not use better-duck-core in a WASM context without verifying it yourself.Minimum Supported Rust Version (MSRV)
better-duck requires Rust 1.96 or later. This is enforced in the workspaceCargo.toml:
dtolnay/rust-toolchain@1.96 and runs the full test suite against that toolchain. Using an older Rust version will produce a build error from Cargo before any source is compiled.
Build Requirements
DuckDB’s C++ source is vendored inside thebetter-duck-sys crate as a compressed archive (vendor/duckdb.tar.gz). At build time, the cc crate extracts and compiles a unity-build of DuckDB’s amalgamated source. No additional tooling is required for ordinary consumers:
Install Rust 1.96+
Any standard Rust toolchain installed via
rustup is sufficient. No additional C++ compiler flags need to be set manually — cc picks up the system C++ compiler automatically.Add the dependency
cargo build.(Optional) Regenerate FFI bindings
This step is only needed by maintainers who are upgrading the vendored DuckDB version. It requires LLVM and The regenerated bindings are checked in to the repository so that all consumers can build without
clang to be installed and the buildtime_bindgen feature to be enabled:bindgen or LLVM.Embedded Environments
better-duck was designed specifically for environments where a system DuckDB library is unavailable or impractical:Tauri desktop apps
Embed a full DuckDB database engine inside a Tauri application. The vendored build produces a static library linked directly into the Tauri binary — no installer, no runtime dependency, no DLL hell.
iOS cross-builds
The crate cross-compiles to
aarch64-apple-ios and x86_64-apple-ios (Simulator). Use a standard cross-compilation toolchain (e.g. cargo-xcode or a custom build.rs linker setup) alongside a macOS host machine with Xcode installed.CI and serverless
Because there is nothing to install beyond Rust itself, better-duck works out of the box in any CI runner or serverless environment. The first build compiles DuckDB from source; subsequent builds use Cargo’s incremental compilation and
sccache/Swatinem/rust-cache to avoid recompilation.Air-gapped environments
Cargo’s
--offline flag and a pre-populated registry cache are sufficient to build better-duck with no network access. The entire DuckDB source is part of the better-duck-sys crate tarball — no network download occurs at build time.Cross-compilation setup
To cross-compile for iOS, install the target and ensure Xcode’s command-line tools are present:cc crate will automatically select xcrun --sdk iphoneos clang++ (or the simulator SDK for x86_64-apple-ios) when cross-compiling on macOS. No additional CXXFLAGS or linker flags are required for a basic cross-build.
Extensions
DuckDB extensions add support for additional file formats and functions. Two extensions are available as Cargo features:| Feature | Default | Description |
|---|---|---|
json | — | Compiles in DuckDB’s JSON extension translation units. Enables JSON reading/writing functions (read_json, json_extract, etc.) without needing LOAD 'json' at runtime. Forwarded from better-duck-sys/json. |
parquet | — | Compiles in DuckDB’s Parquet extension translation units. Enables read_parquet, write_parquet, and related functions. Forwarded from better-duck-sys/parquet. |
Cargo.toml: