querqle 0.1.2

A small library made to perform sql queries thru the odbc-api library, and convert the results directly into data structures.
Documentation
use crate::Connection;
use std::error::Error;
///A wrapper for the odbc_api environment used for this crate
pub struct Environment {
    env: odbc_api::Environment,
}
impl Environment {
    ///Generates a Connection using a standard ODBC connection string and
    ///an obdc_api ConnectionOptions object
    pub fn connect_with_connection_string_and_custom_options<'a>(
        &self,
        connection_string: &str,
        connection_options: odbc_api::ConnectionOptions,
    ) -> Result<Connection, Box<dyn Error>> {
        Ok(Connection::new(self
                .env
                .connect_with_connection_string(connection_string, connection_options)?))
    }
    ///Generatates a connection using a standard ODBC connection string.
    ///Uses the default odbc_api settings
    pub fn connect_with_connection_string<'a>(
        &self,
        connection_string: &str,
    ) -> Result<Connection, Box<dyn Error>> {
        self.connect_with_connection_string_and_custom_options(
            connection_string,
            odbc_api::ConnectionOptions::default(),
        )
    }
    ///Generates a connection using a datasource string, user, and password.
    ///Uses the default odbc_api settings
    pub fn connect<'a>(
        &self,
        data_source_name: &str,
        user: &str,
        pwd: &str
    ) -> Result<Connection, Box<dyn Error>> {
        self.connect_with_custom_options(data_source_name, user, pwd, odbc_api::ConnectionOptions::default())
    }
    ///Generates a connection using a datasource string, user, password, and
    ///an obdc_api ConnectionOptions object
    pub fn connect_with_custom_options<'a>(
        &self,
        data_source_name: &str,
        user: &str,
        pwd: &str,
        options: odbc_api::ConnectionOptions
    ) -> Result<Connection, Box<dyn Error>> {
        Ok(Connection::new(self
                .env
            .connect(data_source_name, user, pwd, options)?))
    }
    ///Creates a new ODBC environment
    pub fn new() -> Result<Self, Box<dyn Error>> {
        Ok(Environment {
            env: odbc_api::Environment::new()?,
        })
    }
}