tank-duckdb 0.42.0

DuckDB driver implementation for Tank: the Rust data layer
Documentation

tank-duckdb

DuckDB driver implementation for Tank: the Rust data layer.

Implements Tank’s Driver and related traits for DuckDB, mapping Tank operations and queries into direct DuckDB commands. It does not replace the main tank crate. you still use it to define entities, manage schemas, and build queries.

📘 https://tankhq.github.io/tank

🖥️ https://github.com/TankHQ/tank

📦 https://crates.io/crates/tank

Features

  • DuckDB C API (FFI) using libduckdb-sys
  • Bulk inserts use DuckDB's appender API
  • Queries are executed in parallel using tokio runtime, results are send using flume unbounded channel

Install

cargo add tank
cargo add tank-duckdb

Optional feature flags:

  • bundled (default): uses the bundled DuckDB library.

Disable it if you want a system DuckDB:

cargo add tank-duckdb --no-default-features

Quick Start

use tank::{ConnectionPool, Driver, PoolConfig};
use tank_duckdb::DuckDBDriver;

let driver = DuckDBDriver::new();
let pool = driver
    .connect_pool("duckdb://path/to/database.duckdb?mode=rw".into(), PoolConfig::new())
    .await?;
let mut connection = pool.get().await?;