ODBCEnv¶
ODBCEnv¶
The class that wraps our ODBC Environment handle.
Usage¶
It is currently very simple as very few of the attributes are implemented as of yet.
Currently, we only support ODBC version 3.0.
Error Handling¶
ODBCEnv maintains an error chain that can aggregate errors from all
child connections and their statements via all_errors():
// Get all errors across entire handle hierarchy, sorted by sequence
for err in env.all_errors().values() do
env.err.print(err.string())
end
Implements¶
- SqlState ref
Constructors¶
create¶
Returns¶
- ODBCEnv ref^
Public fields¶
let odbcenv: ODBCHandleEnv tag¶
var strict: Bool val¶
Public Functions¶
dbc¶
Used to create an ODBCDbc object from this ODBCEnv.
Parameters¶
- sl: SourceLoc val = __loc
Returns¶
- ODBCDbc ref ?
sqlstates¶
Returns an array of SQL States
Returns¶
error_chain¶
Access the error chain for inspection.
Returns¶
- ODBCErrorChain box
last_error¶
Convenience method: get the most recent error frame.
Returns¶
- (ODBCErrorFrame val | None val)
configure_error_chain¶
Configure error chain behavior.
- max_frames: Maximum number of frames to store (default: 100)
- auto_clear: Clear chain on prepare()/finish() (default: true)
- log_success: Also record successful operations (default: false)
fun ref configure_error_chain(
max_frames: USize val = 100,
auto_clear: Bool val = true,
log_success: Bool val = false)
: None val
Parameters¶
Returns¶
- None val
all_errors¶
Returns all errors across the entire handle hierarchy, sorted by sequence.
Returns¶
- Array[ODBCErrorFrame val] val