tank-duckdb 0.44.0

DuckDB driver implementation for Tank: the Rust data layer
docs.rs failed to build tank-duckdb-0.44.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: tank-duckdb-0.42.0

tank-duckdb

tank-duckdb is the DuckDB driver for Tank: the Rust data layer.

It maps Tank operations and queries to native DuckDB commands. Use it with the main tank crate, which provides entity definitions and the query API.

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

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

📦 Crate: https://crates.io/crates/tank-duckdb

Features

  • DuckDB C API (FFI) using libduckdb-sys
  • Bulk inserts use DuckDB's appender API
  • Queries execute through the Tokio runtime, with results streamed through a Flume 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?;

Run this inside an async function. The returned connection can execute Tank entity operations.