8 releases (breaking)

0.7.0 May 30, 2024
0.6.0 Jan 7, 2023
0.5.0 Apr 28, 2021
0.4.1 Mar 9, 2021
0.1.0 Oct 2, 2019

#673 in Database interfaces

Download history 50/week @ 2024-03-13 62/week @ 2024-03-20 151/week @ 2024-03-27 72/week @ 2024-04-03 48/week @ 2024-04-10 147/week @ 2024-04-17 58/week @ 2024-04-24 99/week @ 2024-05-01 208/week @ 2024-05-08 90/week @ 2024-05-15 138/week @ 2024-05-22 306/week @ 2024-05-29 264/week @ 2024-06-05 338/week @ 2024-06-12 174/week @ 2024-06-19 177/week @ 2024-06-26

985 downloads per month
Used in 2 crates

MIT/Apache

13KB

r2d2-oracle

CI Crates.io Crates.io unsafe forbidden

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.

Usage

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"] }

Changelog

For the changelog please see the dedicated 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 provides buit-in connection pooling support
  • There is an async (tokio-based) version of r2d2, bb8 and a corresponding 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.

Dependencies

~5–11MB
~123K SLoC