Struct odbc::DataSource [] [src]

pub struct DataSource<'a, S: DataSourceState> { /* fields omitted */ }

Represents a connection to an ODBC data source

A DataSource is in one of two states Connected or Disconnected. These are known at compile time. Every new DataSource starts out as Disconnected. To do execute a query it needs to be connected. You can achieve this by calling e.g. connect and captuer the result in a new binding which will be of type DataSource::<Connected>.

Methods

impl<'a> DataSource<'a, Disconnected>
[src]

Allocate an ODBC data source

Arguments

  • env - Environment used to allocate the data source handle.

Connects to an ODBC data source

Arguments

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

impl<'a> DataSource<'a, Connected>
[src]

true if the data source is set to READ ONLY mode, false otherwise.

This characteristic pertains only to the data source itself; it is not characteristic of the driver that enables access to the data source. A driver that is read/write can be used with a data source that is read-only. If a driver is read-only, all of its data sources must be read-only.

Closes the connection to the DataSource. If not called explicitly this the disconnect will be invoked by drop()

Trait Implementations

impl<'a, S: DataSourceState> Handle for DataSource<'a, S>
[src]

Returns a valid handle to the odbc type.

impl<'a, S: DataSourceState> Drop for DataSource<'a, S>
[src]

A method called when the value goes out of scope. Read more