#duck-db #sql

yanked duckdb2

Simple DuckDB binding for Rust

1 stable release

1.0.0 Sep 8, 2024
0.1.1 Sep 6, 2024
0.1.0 Sep 6, 2024

#24 in #duck-db

Download history 393/week @ 2024-09-05 58/week @ 2024-09-12 27/week @ 2024-09-19 10/week @ 2024-09-26

98 downloads per month

MIT license

53KB
1.5K SLoC

duckdb2

Crates.io docs.rs

Simple DuckDB binding for Rust

Usage

cargo add duckdb2
use duckdb2::{Database, Config};

fn main() {
    let config = Config::new();
    let db = Database::open_with("./test.db", config).unwrap();
    let conn = db.connect().unwrap();

    conn.execute("CREATE TABLE IF NOT EXISTS users (id int32, age int8)").unwrap();
    conn.execute("INSERT INTO users VALUES (1, 18), (2, 22), (3, 32);").unwrap();
    
    let query = conn.query("SELECT * FROM users").unwrap();
    dbg!(query);
}

Dependencies

~14MB
~183K SLoC