mod as_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;
pub use {
as_handle::AsHandle,
bind::{CData, CDataMut, DelayedInput, HasDataType},
column_description::{ColumnDescription, Nullability},
connection::Connection,
data_type::DataType,
descriptor::Descriptor,
diagnostics::{Diagnostics, Record, State},
environment::Environment,
logging::log_diagnostics,
sql_char::{slice_to_cow_utf8, slice_to_utf8, OutputStringBuffer, SqlChar, SqlText, SzBuffer},
sql_result::SqlResult,
statement::{AsStatementRef, ParameterDescription, Statement, StatementImpl, StatementRef},
};
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 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)
}
}
}
}