1 个不稳定版本

使用旧的 Rust 2015

0.1.0 2023年8月15日

#16#duck-db

Download history 196/week @ 2024-03-11 99/week @ 2024-03-18 78/week @ 2024-03-25 136/week @ 2024-04-01 68/week @ 2024-04-08 66/week @ 2024-04-15 113/week @ 2024-04-22 114/week @ 2024-04-29 56/week @ 2024-05-06 131/week @ 2024-05-13 114/week @ 2024-05-20 111/week @ 2024-05-27 112/week @ 2024-06-03 100/week @ 2024-06-10 22/week @ 2024-06-17

246 每月下载量

MIT 许可证

4KB

r2d2-duckdb

为 duckdb 提供的 r2d2 连接池。

使用 DuckDB 作为后端。


lib.rs:

DuckDb 对 r2d2 连接池的支持。

库包:r2d2-duckdb

集成:r2d2

示例

extern crate r2d2;
extern crate r2d2_duckdb;
extern crate duckdb;

use std::thread;
use r2d2_duckdb::DuckDBConnectionManager;

fn main() {
    let manager = DuckDBConnectionManager::file("file.db");
    let pool = r2d2::Pool::builder().build(manager).unwrap();

    for i in 0..10i32 {
        let pool = pool.clone();
        thread::spawn(move || {
            let conn = pool.get().unwrap();
            let result = conn.execute("INSERT INTO foo (bar) VALUES (?)", duckdb::params![42]).unwrap();
        });
    }
}

依赖项

~21–29MB
~330K SLoC