Expand description
§ODBC
Open Database Connectivity or short ODBC is a low level high performance interface introduced by Microsoft to access relational data stores. This crate wraps the raw C interface and is intended to be usable in safe and idiomatic Rust.
[ODBC Programmer’s Reference] (https://docs.microsoft.com/en-us/sql/odbc/reference/odbc-programmer-s-reference)
§Internal Design
While designed as a relatively low level wrapper around ODBC this crate tries to prevent many
errors at compile time. The borrow checker and the RAII (Resource Acquisition Is
Initialization) idiom should prevent any occurrence of SQL_INVALID_HANDLE
in safe code.
Using the type system and the borrow checker this crate ensures that each method call happens in a valid state and state transitions are modeled in the type system. This should eliminate the possibility of function sequence errors in safe code.
[Basic ODBC Application Steps] (https://docs.microsoft.com/en-us/sql/odbc/reference/develop-app/basic-odbc-application-steps)
[ODBC State Transitions] (https://docs.microsoft.com/en-us/sql/odbc/reference/appendixes/appendix-b-odbc-state-transition-tables)
Re-exports§
pub extern crate odbc_safe;
pub use odbc_safe as safe;
pub use ResultSetState::*;
Modules§
- ffi
- Reexport odbc-sys as ffi
Structs§
- Column
Descriptor - Connection
- Represents a connection to an ODBC data source
- Cursor
- Used to retrieve data from the fields of a query result
- Data
Source Info - Holds name and description of a datasource
- Diagnostic
Record - ODBC Diagnostic Record
- Driver
Info - Struct holding information available on a driver.
- Encoded
Value - Environment
- Handle to an ODBC Environment
- Statement
- A
Statement
can be used to execute queries and retrieves results.
Enums§
- Allocated
Statement
state used to represent a freshly allocated connection- HasResult
Statement
state used to represent a statement with a result set cursor. A statement is most likely to enter this state after aSELECT
query.- NoResult
Statement
state used to represent a statement with no result set. A statement is likely to enter this state after executing e.g. aCREATE TABLE
statement- Prepared
Statement
state used to represent a statement compiled into an access plan. A statement will enter this state after a call toStatement::prepared
- Result
SetState - Holds a
Statement
after execution of a query.Allocated
Statics§
Traits§
- GetDiag
Rec - Allows retrieving a diagnostic record, describing errors (or lack thereof) during the last operation.
- Handle
- Reflects the ability of a type to expose a valid handle
- Odbc
Type - Output
- Indicates that a type can be retrieved using
Cursor::get_data
Functions§
- create_
environment_ v3 - Creates an ODBC Environment and declares specification of version 3.0 are used
- create_
environment_ v3_ with_ os_ db_ encoding
Type Aliases§
- Executed
Statement
state used to represent a statement with a result set cursor. A statement is most likely to enter this state after aSELECT
query.- Result
- Result type returned by most functions in this crate
- SqlDate
- SqlSs
Time2 - SqlTime
- SqlTimestamp
- Version3
- Environment state used to represent that environment has been set to odbc version 3