pub fn initialized_connection_with<O, E, I, F>(
    connection_string: &str,
    init: I,
    f: F
) -> Owhere
    E: From<OdbcError>,
    I: Fn(&mut Connection) -> Result<(), E>,
    F: Fn(Result<Connection, E>) -> (Option<Connection>, O),
Expand description

Access to thread local connection with connection initialization.

Like connection_with but also takes init closure that is executed once when new connection was successfully established. This allows for execution of connection configuration queries.

If init returns an error it is passed to the second closure and the connection will be dropped.