Crates.io | r2d2-oracle |
lib.rs | r2d2-oracle |
version | 0.7.0 |
source | src |
created_at | 2019-10-02 18:46:26.241419 |
updated_at | 2024-05-30 15:49:54.165244 |
description | Oracle support for the r2d2 connection pool |
homepage | |
repository | https://github.com/rursprung/r2d2-oracle |
max_upload_size | |
id | 169436 |
size | 36,794 |
The documentation can be found on docs.rs.
Oracle support for the r2d2 connection pool. This fits in between the r2d2 connection manager and oracle database driver crates.
See the documentation of r2d2 for the details on how to use the connection pool.
use std::thread;
use r2d2_oracle::OracleConnectionManager;
fn main() {
let manager = OracleConnectionManager::new("user", "password", "localhost");
let pool = r2d2::Pool::builder()
.max_size(15)
.build(manager)
.unwrap();
for _ in 0..20 {
let pool = pool.clone();
thread::spawn(move || {
let conn = pool.get().unwrap();
// use the connection
// it will be returned to the pool when it falls out of scope.
});
}
}
If you want to use chrono data types, enable the chrono
feature:
[dependencies]
r2d2-oracle = { version = "0.2.0", features = ["chrono"] }
For the changelog please see the dedicated CHANGELOG.md.
This is the initial release of the crate and has not yet been proven in production. Nevertheless: the crate is very small so not many problems are expected.
The precondition for releasing v1.0.0 is that both r2d2
and oracle
have released their v1.0.0.
r2d2-oracle
You may also want to consider the following alternatives to this crate, depending on your use-cases:
oracle
provides buit-in connection pooling supportasync
(tokio
-based) version of r2d2
, bb8
and a corresponding bb8-oracle
fork of r2d2-oracle
existsThis crate is guaranteed to compile on stable Rust 1.60 and up. It might compile with older versions but that may change in any new patch release.