[][src]Crate odbc_safe

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:

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'.

DataSource

A DataSource is used to query and manipulate a data source.

DiagResult

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 as SELECT * FROM Employee.

Unconnected

An HDbc with the additional invariant of being 'allocated', but not 'connected'.

Enums

AutocommitOff

State used by Connected. Means that autocommit is disabled

AutocommitOn

State used by Connected. Means that autocommit is enabled

DataType

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. a CREATE TABLE statement.

Open

Cursor state of Statement. A statement is likely to enter this state after executing e.g a SELECT query.

Positioned

Cursor state of Statement. A statement will enter this state after a successful call to fetch()

Prepared

State used by Statement. A statement will enter this state after a successful call to prepare().

Return

Holds result and indicates the overall success or failure of a function.

ReturnOption

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

AutocommitMode

Marker trait for autocommit mode state types

CDataType

See [C Data Types in ODBC][1] [1]: https://docs.microsoft.com/sql/odbc/reference/develop-app/c-data-types-in-odbc

CursorState

Implemented by the Open and Positioned states for Statement.

Diagnostics

A type implementing this trait is able to provide diagnostic information regarding the last method call.

HDbcWrapper

Implemented by Connected and Unconnected.

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 Definitions

Connection

Connection can be used as a shorthand for a DataSource in Connected state.

ResultSet

Shorthand for Statements in Open state.