pub struct MySqlConnection {
    pub stream: DropBox<MySqlStream>,
    pub cache_statement: StatementCache<(u32, MySqlStatementMetadata)>,
}
Expand description

A connection to a MySQL database.

Fields§

§stream: DropBox<MySqlStream>§cache_statement: StatementCache<(u32, MySqlStatementMetadata)>

Implementations§

source§

impl MySqlConnection

source

pub async fn execute(&mut self, sql: &str) -> Result<Option<MySqlRow>, Error>

source

pub fn fetch_many( &mut self, query: MysqlQuery ) -> BoxStream<'_, Result<Either<MySqlQueryResult, MySqlRow>, Error>>

source

pub fn fetch_optional( &mut self, query: MysqlQuery ) -> BoxFuture<'_, Result<Option<MySqlRow>, Error>>

source

pub fn prepare_with<'e>( &'e mut self, sql: &'e str, _: &'e [MySqlTypeInfo] ) -> BoxFuture<'e, Result<MySqlStatement, Error>>

Trait Implementations§

source§

impl Connection for MySqlConnection

source§

fn get_rows( &mut self, sql: &str, params: Vec<Value> ) -> BoxFuture<'_, Result<Vec<Box<dyn Row>>, Error>>

Execute a query that is expected to return a result set, such as a SELECT statement
source§

fn exec( &mut self, sql: &str, params: Vec<Value> ) -> BoxFuture<'_, Result<ExecResult, Error>>

Execute a query that is expected to update some rows.
source§

fn close(&mut self) -> BoxFuture<'_, Result<(), Error>>

close connection
source§

fn ping(&mut self) -> BoxFuture<'_, Result<(), Error>>

ping
source§

fn get_values( &mut self, sql: &str, params: Vec<Value, Global> ) -> Pin<Box<dyn Future<Output = Result<Vec<Value, Global>, Error>> + Send, Global>>

Execute a query that is expected to return a result set, such as a SELECT statement
source§

impl Debug for MySqlConnection

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V