mod any_handle;
mod bind;
mod buffer;
mod column_description;
mod connection;
mod data_type;
mod descriptor;
mod diagnostics;
mod environment;
mod logging;
mod sql_char;
mod sql_result;
mod statement;
mod statement_connection;
pub use self::{
any_handle::AnyHandle,
bind::{CData, CDataMut, DelayedInput, HasDataType},
column_description::{ColumnDescription, Nullability},
connection::Connection,
data_type::DataType,
descriptor::Descriptor,
diagnostics::{DiagnosticStream, Diagnostics, Record, State},
environment::Environment,
logging::log_diagnostics,
sql_char::{OutputStringBuffer, SqlChar, SqlText, SzBuffer, slice_to_cow_utf8, slice_to_utf8},
sql_result::SqlResult,
statement::{AsStatementRef, ParameterDescription, Statement, StatementImpl, StatementRef},
statement_connection::{StatementConnection, StatementParent},
};
pub(crate) use self::data_type::ASSUMED_MAX_LENGTH_OF_W_VARCHAR;
use log::debug;
use odbc_sys::{Handle, HandleType, SQLFreeHandle, SqlReturn};
use std::thread::panicking;
pub unsafe fn drop_handle(handle: Handle, handle_type: HandleType) {
match unsafe { SQLFreeHandle(handle_type, handle) } {
SqlReturn::SUCCESS => {
debug!("SQLFreeHandle dropped {handle:?} of type {handle_type:?}.");
}
other => {
if !panicking() {
panic!("SQLFreeHandle failed with error code: {:?}", other.0)
}
}
}
}