Crate deadpool_tiberius_rustls

Crate deadpool_tiberius_rustls 

Source
Expand description

This crate chains config from [tiberius] and deadpool to make it easier for creating tiberius connection pool.

§Example

let pool = deadpool_tiberius::Manager::new()
    .host("host")
    .port(1433)
    .basic_authentication("username", "password")
    .database("database1")
    .max_size(20)
    .wait_timeout(1.52)
    .pre_recycle_sync(|_client, _metrics| {
        // do sth with connection object and pool metrics.
        Ok(())
    })
    .create_pool()?;

Manager::from_ado_string and Manager::from_jdbc_string also served as another entry for constructing Manager.

const CONN_STR: &str = "Driver={SQL Server};Integrated Security=True;\
                        Server=DESKTOP-TTTTTTT;Database=master;\
                        Trusted_Connection=yes;encrypt=DANGER_PLAINTEXT;";
let pool = deadpool_tiberius::Manager::from_ado_string(CONN_STR)?
                .max_size(20)
                .wait_timeout(1.52)
                .create_pool()?;

For all configurable pls visit Manager.

Re-exports§

pub use deadpool;
pub use tiberius_rustls;

Structs§

Manager
Connection pool Manager served as Builder. Call create_pool after filling out your configs.

Enums§

SqlServerError
Error type represents error from building pool, running pool, tiberius execution, io.

Type Aliases§

Client
Type aliasing for tiberius client with tokio as runtime.
Pool
Type aliasing for Pool.
SqlServerResult
Type aliasing for Result<T, SqlServerError>