Expand description
A crate for writing odbc clients in safe Rust
This crate is only concerned about providing safe bindings to ODBC. It does not try to provide convinience or idiomatic usage on top. This is left to higher level crates.
§Desgin decisions:
- Constructing a child is not considered to mutate the parent. This is necessare so a parent handle can be referenced by several child handles.
- Any transition in the ODBC State machine is modelled in the type system. This prevents Function Sequence errors. See [ODBC State Transition Tables][1] [1]: https://docs.microsoft.com/sql/odbc/reference/appendixes/appendix-b-odbc-state-transition-tables
Re-exports§
pub extern crate odbc_sys as sys;
pub use return_::Success;
pub use return_::Info;
pub use return_::Error;
Structs§
- Connected
- An
HDbc
with the additional invariant of being ‘connected’. - Data
Source - A
DataSource
is used to query and manipulate a data source. - Diag
Result - Result of
Diagnostics::diagnostics
- Environment
- An
Environment
is a global context, in which to access data. - NoVersion
- Used to indicate that the ODBC environments version is not yet declared
- Odbc3
- Used to declare ODBC 3 specifications.
- Odbc3m8
- Used to declare ODBC 3.8 specifications.
- Statement
- A
Statement
is most easily thought of as an SQL statement, such asSELECT * FROM Employee
. - Unconnected
- An
HDbc
with the additional invariant of being ‘allocated’, but not ‘connected’.
Enums§
- Autocommit
Off - State used by
Connected
. Means that autocommit is disabled - Autocommit
On - State used by
Connected
. Means that autocommit is enabled - Data
Type - Describes a column or parameter type.
- Indicator
- Used to indicate the required target buffer length.
- NoCursor
- State used by
Statement
. A statement is likely to enter this state after executing e.g. aCREATE TABLE
statement. - Open
- Cursor state of
Statement
. A statement is likely to enter this state after executing e.g aSELECT
query. - Positioned
- Cursor state of
Statement
. A statement will enter this state after a successful call tofetch()
- Prepared
- State used by
Statement
. A statement will enter this state after a successful call toprepare()
. - Return
- Holds result and indicates the overall success or failure of a function.
- Return
Option - Holds result and indicates the overall success or failure of a function.
- Unprepared
- State used by
Statement
. Indicates that no Access Plan has been created, yet.
Traits§
- Autocommit
Mode - Marker trait for autocommit mode state types
- CData
Type - See [C Data Types in ODBC][1] [1]: https://docs.microsoft.com/sql/odbc/reference/develop-app/c-data-types-in-odbc
- Cursor
State - Implemented by the
Open
andPositioned
states forStatement
. - Diagnostics
- A type implementing this trait is able to provide diagnostic information regarding the last method call.
- HDbc
Wrapper - Implemented by
Connected
andUnconnected
. - Handle
- Basic functionality for all wrappers around ODBC Handles
- SqlStr
- A type implementing this trait can be passed as a string argument in API calls
- Version
- Type indicates an ODBC Version
Type Aliases§
- Connection
Connection
can be used as a shorthand for aDataSource
inConnected
state.- Result
Set - Shorthand for
Statements
inOpen
state.