[−][src]Type Definition odbc_safe::Connection
type Connection<'env, AC> = DataSource<'env, Connected<'env, AC>>;
Connection can be used as a shorthand for a DataSource in Connected state.
Methods
impl<'env, AC: AutocommitMode> Connection<'env, AC>[src]
pub fn disconnect(
self
) -> Return<DataSource<'env, Unconnected<'env>>, Connection<'env, AC>>[src]
self
) -> Return<DataSource<'env, Unconnected<'env>>, Connection<'env, AC>>
When an application has finished using a data source, it calls disconnect. disconnect
disconnects the driver from the data source.
- See [Disconnecting from a Data Source or Driver][1]
- See [SQLDisconnect Function][2] [1]: https://docs.microsoft.com/sql/odbc/reference/develop-app/disconnecting-from-a-data-source-or-driver [2]: https://docs.microsoft.com/sql/odbc/reference/syntax/sqldisconnect-function
pub fn is_read_only(&mut self) -> Return<bool>[src]
true if the data source is set to READ ONLY mode, false otherwise.
impl<'env> Connection<'env, AutocommitOff>[src]
pub fn enable_autocommit(self) -> Return<Connection<'env, AutocommitOn>, Self>[src]
Set autocommit mode on, per ODBC spec triggers implicit commit of any running transaction
pub fn commit(&mut self) -> Return<()>[src]
Commit transaction if any, can be safely called and will be no-op if no transaction present or autocommit mode is enabled
pub fn rollback(&mut self) -> Return<()>[src]
Rollback transaction if any, can be safely called and will be no-op if no transaction present or autocommit mode is enabled
impl<'env> Connection<'env, AutocommitOn>[src]
pub fn disable_autocommit(self) -> Return<Connection<'env, AutocommitOff>, Self>[src]
Set autocommit mode off