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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
mod as_handle;
mod bind;
mod buffer;
mod column_description;
mod connection;
mod data_type;
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,
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::{ParameterDescription, Statement, StatementImpl},
};
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 => (),
other => {
if !panicking() {
panic!("SQLFreeHandle failed with error code: {:?}", other.0)
}
}
}
}