1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#![doc = include_str!("../README.md")]
#![allow(dead_code)]

mod errors;
mod manager;
mod pool;

pub(crate) use manager::ENV;
pub(crate) use pool::SharedPool;

pub use errors::OdbcError;
pub use manager::ODBCConnectionManager;
pub use pool::ODBCConnection;
pub use tokio::{self, task};

pub use odbc_api as odbc;

/// Block non async closure or functions so it can run within async.
///
/// # Examples
/// ```rust no_run
///
/// let connection = manager.aquire().await?;
///
/// let _ = blocking!(connection.execute("DROP TABLE IF EXISTS TEST", ()))?;
/// ```
///
#[macro_export]

macro_rules! blocking {
    ($($expr:tt)*) => {
        $crate::tokio::task::spawn_blocking(move || { $($expr)* })
            .await.expect("Blocking task failed to complete.")
    };
}