Struct mysql::conn::MyConn
[−]
[src]
pub struct MyConn {
// some fields omitted
}Mysql connection.
Methods
impl MyConn
fn new(opts: MyOpts) -> MyResult<MyConn>
Creates new MyConn.
fn reset(&mut self) -> MyResult<()>
Resets MyConn (drops state then reconnects).
fn ping(&mut self) -> bool
Executes COM_PING
on MyConn. Return true on success or false on error.
fn start_transaction<'a>(&'a mut self, consistent_snapshot: bool, isolation_level: Option<IsolationLevel>, readonly: Option<bool>) -> MyResult<Transaction<'a>>
Starts new transaction with provided options.
readonly is only available since MySQL 5.6.5.
fn query<'a, T: AsRef<str> + 'a>(&'a mut self, query: T) -> MyResult<QueryResult<'a>>
Implements text protocol of mysql server.
Executes mysql query on MyConn. QueryResult
will borrow MyConn until the end of its scope.
fn prepare<'a, T: AsRef<str> + 'a>(&'a mut self, query: T) -> MyResult<Stmt<'a>>
Implements binary protocol of mysql server.
Prepares mysql statement on MyConn. Stmt will
borrow MyConn until the end of its scope.
This call will take statement from cache if has been prepared on this connection.
fn prep_exec<'a, A, T>(&'a mut self, query: A, params: T) -> MyResult<QueryResult<'a>> where A: AsRef<str> + 'a, T: ToRow
Prepares and executes statement in one call.
This call will take statement from cache if has been prepared on this connection.