15个不稳定版本 (5个破坏性更新)

0.6.4 2022年2月12日
0.6.3 2021年10月30日
0.6.2 2021年5月29日
0.5.0 2021年5月12日
0.1.0 2021年5月2日

#2615数据库接口

Download history 30/week @ 2024-03-09 25/week @ 2024-03-16 5/week @ 2024-03-23 45/week @ 2024-03-30 46/week @ 2024-04-06 59/week @ 2024-04-13 46/week @ 2024-04-20 29/week @ 2024-04-27 35/week @ 2024-05-04 45/week @ 2024-05-11 26/week @ 2024-05-18 9/week @ 2024-05-25 10/week @ 2024-06-01 10/week @ 2024-06-08 14/week @ 2024-06-15 22/week @ 2024-06-22

每月57 次下载

MIT/Apache

155KB
5K SLoC

mobc-reql

ReQL连接池实现

use mobc_reql::{GetSession, Pool, SessionManager};

// Create the session manager
let manager = SessionManager::new(Default::default());

// Pull the rest of your nodes from your cluster. The connection pool
// connects to the node with the lowest latency.
// It is optional but highly recommended. This way, your app will
// continue working even when nodes go up and down.
tokio::spawn(manager.discover_hosts());

// Create the pool
let pool = Pool::builder().max_open(20).build(manager);

// Get a session from the pool
let session = pool.session().await?;

// You can pass a reference of the session to run.
// This allows you to use the same underlying connection for multiple
// queries as long as none of them is a change-feed.
// You can even use just one connection for your entire app, even running
// the queries concurrently.
//
// Change feeds on the other hand, require dedicated connections,
// so for each changefeed you need to grab a new session from the pool.
r.expr("Hello world!").run(&session);

依赖项

~14–30MB
~519K SLoC