https://github.com/rursprung/r2d2-oracle
an r2d2 adapter for the oracle database
https://github.com/rursprung/r2d2-oracle
connection database oracle pool r2d2 rust sql
Last synced: 11 months ago
JSON representation
an r2d2 adapter for the oracle database
- Host: GitHub
- URL: https://github.com/rursprung/r2d2-oracle
- Owner: rursprung
- License: apache-2.0
- Created: 2019-10-02T16:42:11.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-05-30T15:50:01.000Z (almost 2 years ago)
- Last Synced: 2025-04-30T13:28:08.840Z (11 months ago)
- Topics: connection, database, oracle, pool, r2d2, rust, sql
- Language: Rust
- Size: 79.1 KB
- Stars: 8
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# r2d2-oracle
[](https://github.com/rursprung/r2d2-oracle/actions/workflows/CI.yml)
[](https://crates.io/crates/r2d2-oracle)

[](https://github.com/rust-secure-code/safety-dance/)
The documentation can be found on [docs.rs](https://docs.rs/r2d2-oracle/).
Oracle support for the r2d2 connection pool.
This fits in between the [r2d2](https://crates.io/crates/r2d2) connection manager and [oracle](https://crates.io/crates/oracle) database driver crates.
## Usage
See the documentation of r2d2 for the details on how to use the connection pool.
```rust
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:
```toml
[dependencies]
r2d2-oracle = { version = "0.2.0", features = ["chrono"] }
```
## Changelog
For the changelog please see the dedicated [CHANGELOG.md](CHANGELOG.md).
## Current Status of the Crate & Roadmap to v1.0.0
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.
## Alternatives to `r2d2-oracle`
You may also want to consider the following alternatives to this crate, depending on your use-cases:
* Starting with version 0.5.5 the [`oracle`](https://crates.io/crates/oracle) provides buit-in connection pooling support
* There is an `async` ([`tokio`](https://crates.io/crates/tokio)-based) version of `r2d2`, [`bb8`](https://crates.io/crates/bb8) and a corresponding [`bb8-oracle`](https://crates.io/crates/bb8-oracle) fork of `r2d2-oracle` exists
## Minimum Supported Rust Version (MSRV)
This 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.