Crates.io | duckdb2 |
lib.rs | duckdb2 |
version | 1.0.0 |
source | src |
created_at | 2024-09-06 08:56:55.525404 |
updated_at | 2024-09-08 12:53:45.904133 |
description | Simple DuckDB binding for Rust |
homepage | https://github.com/ducksq-dev/duckdb2 |
repository | https://github.com/ducksq-dev/duckdb2 |
max_upload_size | |
id | 1365692 |
size | 79,481 |
Simple DuckDB binding for Rust
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);
}