pub fn connection_with<O, F>(connection_string: &str, f: F) -> Owhere
    F: Fn(Result<Connection, OdbcError>) -> (Option<Connection>, O),
Expand description

Access to thread local connection.

Provided closure will receive the Connection object and may return it for reuse by another call or drop it to force new connection to be established to database on next call.

If there was an error during connection establishment it is provided to the closure. Next call will attempt to connect again and a new error may be provided.

connection_string is used only when making new Connection object initially, after error or after old Connection object was dropped.