Struct ibm_db::Environment[][src]

pub struct Environment<V> { /* fields omitted */ }
Expand description

Handle to an ODBC Environment

Creating an instance of this type is the first thing you do then using ODBC. The environment must outlive all connections created with it.

Implementations

Stores all driver description and attributes in a Vec

Stores all data source server names and descriptions in a Vec

Stores all system data source server names and descriptions in a Vec

Stores all user data source server names and descriptions in a Vec

Creates an ODBC Environment and declares specification of V are used. You can use the shorthand create_environment_v3() instead.

Example

use odbc::*;
fn do_database_stuff() -> std::result::Result<(), Option<DiagnosticRecord>> {
    let env : Environment<Version3> = Environment::new()?; // first thing to do
    // ...
    Ok(())
}

Return

While most functions in this crate return a DiagnosticRecord in the event of an Error the creation of an environment is special. Since DiagnosticRecords are created using the environment, at least its allocation has to be successful to obtain one. If the allocation fails it is sadly not possible to receive further Diagnostics. Setting an unsupported version may however result in an ordinary Some(DiagnosticRecord).

Connects to an ODBC data source

Arguments

  • dsn - Data source name configured in the odbc.ini file
  • usr - User identifier
  • pwd - Authentication (usually password)

Connects to an ODBC data source using a connection string

See [SQLDriverConnect][1] for the syntax. [1]: https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqldriverconnect-function

Trait Implementations

Formats the value using the given formatter. Read more

Returns a valid handle to the odbc type.

Used to identify the type of the handle in various functions of the ODBC C interface

Returns a ptr to the wrapped ODBC Object

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the current values of multiple fields of a diagnostic record that contains error, warning, and status information. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.