| Crates.io | frozen-duckdb |
| lib.rs | frozen-duckdb |
| version | 0.1.0 |
| created_at | 2025-10-07 22:35:53.196512+00 |
| updated_at | 2025-10-07 22:35:53.196512+00 |
| description | Pre-compiled DuckDB binary for fast Rust builds - Drop-in replacement for duckdb-rs |
| homepage | https://github.com/seanchatmangpt/frozen-duckdb |
| repository | https://github.com/seanchatmangpt/frozen-duckdb |
| max_upload_size | |
| id | 1872900 |
| size | 13,630,324 |
Pre-compiled DuckDB binary that never needs compilation - Fast builds forever!
This project provides architecture-specific DuckDB binaries that eliminate the slow compilation bottleneck in Rust projects using duckdb-rs. Instead of compiling DuckDB from source every time, this project uses pre-compiled official binaries for lightning-fast builds.
| Build Type | Before | After | Improvement |
|---|---|---|---|
| First Build | 1-2 minutes | 7-10 seconds | 85% faster |
| Incremental | 30 seconds | 0.11 seconds | 99% faster |
| Release Builds | 1-2 minutes | 0.11 seconds | 99% faster |
libduckdb_x86_64.dylib (55MB) - Intel Macslibduckdb_arm64.dylib (50MB) - Apple Silicon Macs# Clone this repository
git clone https://github.com/seanchatmangpt/frozen-duckdb.git
cd frozen-duckdb
# Set up environment (automatically detects your architecture)
source prebuilt/setup_env.sh
# Use in your Rust project
cargo build -p your-duckdb-crate
# Clone this repository
git clone https://github.com/seanchatmangpt/frozen-duckdb.git
cd frozen-duckdb
# Build the frozen binary
./scripts/build_frozen_duckdb.sh
# Set up environment
source prebuilt/setup_env.sh
Cargo.toml[dependencies]
# Use prebuilt DuckDB - no compilation needed!
duckdb = { version = "1.4.0", default-features = false }
build.rs)use std::env;
use std::path::Path;
fn main() {
// Check if we should use the prebuilt DuckDB
if let Ok(lib_dir) = env::var("DUCKDB_LIB_DIR") {
let lib_dir = Path::new(&lib_dir);
let include_dir = env::var("DUCKDB_INCLUDE_DIR")
.map(|p| Path::new(&p).to_path_buf())
.unwrap_or_else(|_| lib_dir.join("include"));
// Tell rustc where to find the DuckDB library and headers
println!("cargo:rustc-link-search=native={}", lib_dir.display());
println!("cargo:rustc-link-lib=dylib=duckdb");
println!("cargo:include={}", include_dir.display());
// This prevents the bundled build
println!("cargo:rerun-if-env-changed=DUCKDB_LIB_DIR");
println!("cargo:rerun-if-env-changed=DUCKDB_INCLUDE_DIR");
} else {
// Fall back to bundled if no prebuilt library is specified
println!("cargo:warning=No DUCKDB_LIB_DIR specified, using bundled DuckDB");
}
}
# In your project directory
source /path/to/frozen-duckdb/prebuilt/setup_env.sh
cargo build
# Set up the frozen DuckDB environment (auto-detects architecture)
source prebuilt/setup_env.sh
# Build your project (now fast!)
cargo build -p your-duckdb-crate
# Run tests
cargo test -p your-duckdb-crate
The frozen-duckdb CLI provides utilities for managing test datasets:
# Generate TPC-H benchmark data (industry standard)
cargo run -- download --dataset tpch --output-dir datasets
# Generate Chinook sample data
cargo run -- download --dataset chinook --output-dir datasets
# Convert between formats
cargo run -- convert --input data.csv --output data.parquet --input-format csv --output-format parquet
# Show system information
cargo run -- info
TPC-H Dataset Features:
The setup script automatically detects your architecture:
source prebuilt/setup_env.sh
# 🍎 Detected Apple Silicon (arm64), using 50MB binary
# 🖥️ Detected x86_64 architecture, using 55MB binary
# GitHub Actions example
- name: Set up frozen DuckDB
run: |
git clone https://github.com/seanchatmangpt/frozen-duckdb.git
source frozen-duckdb/prebuilt/setup_env.sh
echo "DUCKDB_LIB_DIR=$DUCKDB_LIB_DIR" >> $GITHUB_ENV
echo "DUCKDB_INCLUDE_DIR=$DUCKDB_INCLUDE_DIR" >> $GITHUB_ENV
- name: Build with frozen DuckDB
run: cargo build --release
If you get "library not found" errors:
# Check environment variables
echo $DUCKDB_LIB_DIR
echo $DUCKDB_INCLUDE_DIR
# Verify library exists
ls -la $DUCKDB_LIB_DIR/libduckdb*
# Re-source the environment
source prebuilt/setup_env.sh
If you need to force a specific architecture:
# Force x86_64 (Intel Mac)
ARCH=x86_64 source prebuilt/setup_env.sh
# Force arm64 (Apple Silicon)
ARCH=arm64 source prebuilt/setup_env.sh
If you encounter Arrow version conflicts:
# Apply the Arrow patch
./scripts/apply_arrow_patch.sh
frozen-duckdb/
├── prebuilt/ # Pre-compiled binaries
│ ├── libduckdb_x86_64.dylib # Intel Mac binary (55MB)
│ ├── libduckdb_arm64.dylib # Apple Silicon binary (50MB)
│ ├── duckdb.h # C header
│ ├── duckdb.hpp # C++ header
│ └── setup_env.sh # Smart environment setup
├── scripts/ # Build and setup scripts
│ ├── build_frozen_duckdb.sh
│ ├── download_duckdb_binaries.sh
│ └── apply_arrow_patch.sh
├── examples/ # Usage examples
└── README.md # This file
This project is licensed under the MIT License - see the LICENSE file for details.
cargo build -p my-duckdb-crate
Compiling libduckdb-sys v1.4.0
Compiling duckdb v1.4.0
Compiling my-duckdb-crate v0.1.0
Finished dev profile [unoptimized + debuginfo] target(s) in 2m 15s
source prebuilt/setup_env.sh
cargo build -p my-duckdb-crate
Compiling my-duckdb-crate v0.1.0
Finished dev profile [unoptimized + debuginfo] target(s) in 0.11s
Result: 99% faster builds! 🚀