duckdb2

Crates.ioduckdb2
lib.rsduckdb2
version1.0.0
sourcesrc
created_at2024-09-06 08:56:55.525404
updated_at2024-09-08 12:53:45.904133
descriptionSimple DuckDB binding for Rust
homepagehttps://github.com/ducksq-dev/duckdb2
repositoryhttps://github.com/ducksq-dev/duckdb2
max_upload_size
id1365692
size79,481
(wyhaya)

documentation

README

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);
}
Commit count: 0

cargo fmt