tank-duckdb

Crates.iotank-duckdb
lib.rstank-duckdb
version0.16.0
created_at2025-05-10 14:11:50.557769+00
updated_at2026-01-20 23:41:49.055625+00
descriptionDuckDB driver implementation for Tank: the Rust data layer
homepage
repositoryhttps://github.com/TankHQ/tank
max_upload_size
id1668403
size130,512
BarsDev (barsdeveloper)

documentation

README

Tank: Table Abstraction & Navigation Kit logo featuring a green tank with a gear background and stacked database cylinders

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

Connect

use tank::{Connection, Driver, Executor};
use tank_duckdb::DuckDBDriver;

let driver = DuckDBDriver::new();
let connection = driver
    .connect("duckdb://path/to/database.duckdb?mode=rw".into())
    .await?;
Commit count: 401

cargo fmt