Struct mysql_async::Conn
source · pub struct Conn { /* private fields */ }
Expand description
Mysql connection
Implementations§
source§impl Conn
impl Conn
sourcepub fn last_insert_id(&self) -> Option<u64>
pub fn last_insert_id(&self) -> Option<u64>
Returns the ID generated by a query (usually INSERT
) on a table with a column having the
AUTO_INCREMENT
attribute. Returns None
if there was no previous query on the connection
or if the query did not update an AUTO_INCREMENT value.
sourcepub fn affected_rows(&self) -> u64
pub fn affected_rows(&self) -> u64
Returns the number of rows affected by the last INSERT
, UPDATE
, REPLACE
or DELETE
query.
pub fn new<T: Into<Opts>>(opts: T) -> impl MyFuture<Conn>
Trait Implementations§
source§impl Queryable for Conn
impl Queryable for Conn
source§fn ping(self) -> BoxFuture<Self>
fn ping(self) -> BoxFuture<Self>
Returns future that resolves to
Conn
if COM_PING
executed successfully.source§fn disconnect(self) -> BoxFuture<()>
fn disconnect(self) -> BoxFuture<()>
Returns future that disconnects this connection from a server.
source§fn query<Q: AsRef<str>>(
self,
query: Q
) -> BoxFuture<QueryResult<Self, TextProtocol>>
fn query<Q: AsRef<str>>(
self,
query: Q
) -> BoxFuture<QueryResult<Self, TextProtocol>>
Returns future that performs
query
.source§fn first<Q, R>(self, query: Q) -> BoxFuture<(Self, Option<R>)>where
Q: AsRef<str>,
R: FromRow,
fn first<Q, R>(self, query: Q) -> BoxFuture<(Self, Option<R>)>where
Q: AsRef<str>,
R: FromRow,
Returns future that resolves to a first row of result of a
query
execution (if any). Read moresource§fn drop_query<Q: AsRef<str>>(self, query: Q) -> BoxFuture<Self>
fn drop_query<Q: AsRef<str>>(self, query: Q) -> BoxFuture<Self>
Returns future that performs query. Result will be dropped.
source§fn prepare<Q: AsRef<str>>(self, query: Q) -> BoxFuture<Stmt<Self>>
fn prepare<Q: AsRef<str>>(self, query: Q) -> BoxFuture<Stmt<Self>>
Returns future that prepares statement.
source§fn prep_exec<Q, P>(
self,
query: Q,
params: P
) -> BoxFuture<QueryResult<Self, BinaryProtocol>>where
Q: AsRef<str>,
P: Into<Params>,
fn prep_exec<Q, P>(
self,
query: Q,
params: P
) -> BoxFuture<QueryResult<Self, BinaryProtocol>>where
Q: AsRef<str>,
P: Into<Params>,
Returns future that prepares and executes statement in one pass.
source§fn first_exec<Q, P, R>(self, query: Q, params: P) -> BoxFuture<(Self, Option<R>)>where
Q: AsRef<str>,
P: Into<Params>,
R: FromRow,
fn first_exec<Q, P, R>(self, query: Q, params: P) -> BoxFuture<(Self, Option<R>)>where
Q: AsRef<str>,
P: Into<Params>,
R: FromRow,
Returns future that resolves to a first row of result of a statement execution (if any). Read more
source§fn drop_exec<Q, P>(self, query: Q, params: P) -> BoxFuture<Self>where
Q: AsRef<str>,
P: Into<Params>,
fn drop_exec<Q, P>(self, query: Q, params: P) -> BoxFuture<Self>where
Q: AsRef<str>,
P: Into<Params>,
Returns future that prepares and executes statement. Result will be dropped.
source§fn batch_exec<Q, I, P>(self, query: Q, params_iter: I) -> BoxFuture<Self>where
Q: AsRef<str>,
I: IntoIterator<Item = P> + Send + 'static,
I::IntoIter: Send + 'static,
Params: From<P>,
P: Send + 'static,
fn batch_exec<Q, I, P>(self, query: Q, params_iter: I) -> BoxFuture<Self>where
Q: AsRef<str>,
I: IntoIterator<Item = P> + Send + 'static,
I::IntoIter: Send + 'static,
Params: From<P>,
P: Send + 'static,
Returns future that prepares statement and performs batch execution.
Results will be dropped. Read more
source§fn start_transaction(
self,
options: TransactionOptions
) -> BoxFuture<Transaction<Self>>
fn start_transaction(
self,
options: TransactionOptions
) -> BoxFuture<Transaction<Self>>
Returns future that starts transaction.