[−][src]Trait sqlx::Executor
Encapsulates query execution on the database.
Implemented primarily by crate::Pool.
Associated Types
Loading content...Required methods
fn send<'e, 'q>(
&'e mut self,
command: &'q str
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'e + Send>> where
'q: 'e,
&'e mut self,
command: &'q str
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'e + Send>> where
'q: 'e,
Send a raw SQL command to the database.
This is intended for queries that cannot or should not be prepared (ex. BEGIN
).
Does not support fetching results.
fn execute<'e, 'q>(
&'e mut self,
query: &'q str,
args: <Self::Database as Database>::Arguments
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + 'e + Send>> where
'q: 'e,
&'e mut self,
query: &'q str,
args: <Self::Database as Database>::Arguments
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + 'e + Send>> where
'q: 'e,
Execute the query, returning the number of rows affected.
fn fetch<'e, 'q>(
&'e mut self,
query: &'q str,
args: <Self::Database as Database>::Arguments
) -> Pin<Box<dyn Stream<Item = Result<<Self::Database as Database>::Row, Error>> + 'e + Send>> where
'q: 'e,
&'e mut self,
query: &'q str,
args: <Self::Database as Database>::Arguments
) -> Pin<Box<dyn Stream<Item = Result<<Self::Database as Database>::Row, Error>> + 'e + Send>> where
'q: 'e,
Executes the query and returns a [Stream] of Row.
Provided methods
fn fetch_optional<'e, 'q>(
&'e mut self,
query: &'q str,
args: <Self::Database as Database>::Arguments
) -> Pin<Box<dyn Future<Output = Result<Option<<Self::Database as Database>::Row>, Error>> + 'e + Send>> where
'q: 'e,
&'e mut self,
query: &'q str,
args: <Self::Database as Database>::Arguments
) -> Pin<Box<dyn Future<Output = Result<Option<<Self::Database as Database>::Row>, Error>> + 'e + Send>> where
'q: 'e,
Executes the query and returns up to resulting record.
- crate::Error::FoundMoreThanOne will be returned if the query produced more than 1 row.
fn fetch_one<'e, 'q>(
&'e mut self,
query: &'q str,
args: <Self::Database as Database>::Arguments
) -> Pin<Box<dyn Future<Output = Result<<Self::Database as Database>::Row, Error>> + 'e + Send>> where
'q: 'e,
&'e mut self,
query: &'q str,
args: <Self::Database as Database>::Arguments
) -> Pin<Box<dyn Future<Output = Result<<Self::Database as Database>::Row, Error>> + 'e + Send>> where
'q: 'e,
Execute the query and return at most one resulting record.
Implementations on Foreign Types
impl<T> Executor for Transaction<T> where
T: Connection,
[src]
T: Connection,
type Database = <T as Executor>::Database
fn send<'e, 'q>(
&'e mut self,
commands: &'q str
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'e + Send>> where
'q: 'e,
[src]
&'e mut self,
commands: &'q str
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'e + Send>> where
'q: 'e,
fn execute<'e, 'q>(
&'e mut self,
query: &'q str,
args: <<Transaction<T> as Executor>::Database as Database>::Arguments
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + 'e + Send>> where
'q: 'e,
[src]
&'e mut self,
query: &'q str,
args: <<Transaction<T> as Executor>::Database as Database>::Arguments
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + 'e + Send>> where
'q: 'e,
fn fetch<'e, 'q>(
&'e mut self,
query: &'q str,
args: <<Transaction<T> as Executor>::Database as Database>::Arguments
) -> Pin<Box<dyn Stream<Item = Result<<<Transaction<T> as Executor>::Database as Database>::Row, Error>> + 'e + Send>> where
'q: 'e,
[src]
&'e mut self,
query: &'q str,
args: <<Transaction<T> as Executor>::Database as Database>::Arguments
) -> Pin<Box<dyn Stream<Item = Result<<<Transaction<T> as Executor>::Database as Database>::Row, Error>> + 'e + Send>> where
'q: 'e,
fn fetch_optional<'e, 'q>(
&'e mut self,
query: &'q str,
args: <<Transaction<T> as Executor>::Database as Database>::Arguments
) -> Pin<Box<dyn Future<Output = Result<Option<<<Transaction<T> as Executor>::Database as Database>::Row>, Error>> + 'e + Send>> where
'q: 'e,
[src]
&'e mut self,
query: &'q str,
args: <<Transaction<T> as Executor>::Database as Database>::Arguments
) -> Pin<Box<dyn Future<Output = Result<Option<<<Transaction<T> as Executor>::Database as Database>::Row>, Error>> + 'e + Send>> where
'q: 'e,
fn describe<'e, 'q>(
&'e mut self,
query: &'q str
) -> Pin<Box<dyn Future<Output = Result<Describe<<Transaction<T> as Executor>::Database>, Error>> + 'e + Send>> where
'q: 'e,
[src]
&'e mut self,
query: &'q str
) -> Pin<Box<dyn Future<Output = Result<Describe<<Transaction<T> as Executor>::Database>, Error>> + 'e + Send>> where
'q: 'e,
Implementors
impl Executor for MySqlConnection
[src]
type Database = MySql
fn send<'e, 'q>(
&'e mut self,
query: &'q str
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'e + Send>> where
'q: 'e,
[src]
&'e mut self,
query: &'q str
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'e + Send>> where
'q: 'e,
fn execute<'e, 'q>(
&'e mut self,
query: &'q str,
args: MySqlArguments
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + 'e + Send>> where
'q: 'e,
[src]
&'e mut self,
query: &'q str,
args: MySqlArguments
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + 'e + Send>> where
'q: 'e,
fn fetch<'e, 'q>(
&'e mut self,
query: &'q str,
args: MySqlArguments
) -> Pin<Box<dyn Stream<Item = Result<MySqlRow, Error>> + 'e + Send>> where
'q: 'e,
[src]
&'e mut self,
query: &'q str,
args: MySqlArguments
) -> Pin<Box<dyn Stream<Item = Result<MySqlRow, Error>> + 'e + Send>> where
'q: 'e,
fn describe<'e, 'q>(
&'e mut self,
query: &'q str
) -> Pin<Box<dyn Future<Output = Result<Describe<<MySqlConnection as Executor>::Database>, Error>> + 'e + Send>> where
'q: 'e,
[src]
&'e mut self,
query: &'q str
) -> Pin<Box<dyn Future<Output = Result<Describe<<MySqlConnection as Executor>::Database>, Error>> + 'e + Send>> where
'q: 'e,
impl Executor for PgConnection
[src]
type Database = Postgres
fn send<'e, 'q>(
&'e mut self,
query: &'q str
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'e + Send>> where
'q: 'e,
[src]
&'e mut self,
query: &'q str
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'e + Send>> where
'q: 'e,
fn execute<'e, 'q>(
&'e mut self,
query: &'q str,
args: PgArguments
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + 'e + Send>> where
'q: 'e,
[src]
&'e mut self,
query: &'q str,
args: PgArguments
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + 'e + Send>> where
'q: 'e,
fn fetch<'e, 'q>(
&'e mut self,
query: &'q str,
args: PgArguments
) -> Pin<Box<dyn Stream<Item = Result<PgRow, Error>> + 'e + Send>> where
'q: 'e,
[src]
&'e mut self,
query: &'q str,
args: PgArguments
) -> Pin<Box<dyn Stream<Item = Result<PgRow, Error>> + 'e + Send>> where
'q: 'e,
fn describe<'e, 'q>(
&'e mut self,
query: &'q str
) -> Pin<Box<dyn Future<Output = Result<Describe<<PgConnection as Executor>::Database>, Error>> + 'e + Send>> where
'q: 'e,
[src]
&'e mut self,
query: &'q str
) -> Pin<Box<dyn Future<Output = Result<Describe<<PgConnection as Executor>::Database>, Error>> + 'e + Send>> where
'q: 'e,
impl<'_, C> Executor for &'_ Pool<C> where
C: Connection + Connect<Connection = C>,
[src]
C: Connection + Connect<Connection = C>,
type Database = <C as Executor>::Database
fn send<'e, 'q>(
&'e mut self,
commands: &'q str
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'e + Send>> where
'q: 'e,
[src]
&'e mut self,
commands: &'q str
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'e + Send>> where
'q: 'e,
fn execute<'e, 'q>(
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + 'e + Send>> where
'q: 'e,
[src]
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + 'e + Send>> where
'q: 'e,
fn fetch<'e, 'q>(
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> Pin<Box<dyn Stream<Item = Result<<<C as Executor>::Database as Database>::Row, Error>> + 'e + Send>> where
'q: 'e,
[src]
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> Pin<Box<dyn Stream<Item = Result<<<C as Executor>::Database as Database>::Row, Error>> + 'e + Send>> where
'q: 'e,
fn fetch_optional<'e, 'q>(
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> Pin<Box<dyn Future<Output = Result<Option<<<C as Executor>::Database as Database>::Row>, Error>> + 'e + Send>> where
'q: 'e,
[src]
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> Pin<Box<dyn Future<Output = Result<Option<<<C as Executor>::Database as Database>::Row>, Error>> + 'e + Send>> where
'q: 'e,
fn describe<'e, 'q>(
&'e mut self,
query: &'q str
) -> Pin<Box<dyn Future<Output = Result<Describe<<&'_ Pool<C> as Executor>::Database>, Error>> + 'e + Send>> where
'q: 'e,
[src]
&'e mut self,
query: &'q str
) -> Pin<Box<dyn Future<Output = Result<Describe<<&'_ Pool<C> as Executor>::Database>, Error>> + 'e + Send>> where
'q: 'e,
impl<C> Executor for PoolConnection<C> where
C: Connection + Connect<Connection = C>,
[src]
C: Connection + Connect<Connection = C>,
type Database = <C as Executor>::Database
fn send<'e, 'q>(
&'e mut self,
commands: &'q str
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'e + Send>> where
'q: 'e,
[src]
&'e mut self,
commands: &'q str
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'e + Send>> where
'q: 'e,
fn execute<'e, 'q>(
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + 'e + Send>> where
'q: 'e,
[src]
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + 'e + Send>> where
'q: 'e,
fn fetch<'e, 'q>(
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> Pin<Box<dyn Stream<Item = Result<<<C as Executor>::Database as Database>::Row, Error>> + 'e + Send>> where
'q: 'e,
[src]
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> Pin<Box<dyn Stream<Item = Result<<<C as Executor>::Database as Database>::Row, Error>> + 'e + Send>> where
'q: 'e,
fn fetch_optional<'e, 'q>(
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> Pin<Box<dyn Future<Output = Result<Option<<<C as Executor>::Database as Database>::Row>, Error>> + 'e + Send>> where
'q: 'e,
[src]
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> Pin<Box<dyn Future<Output = Result<Option<<<C as Executor>::Database as Database>::Row>, Error>> + 'e + Send>> where
'q: 'e,
fn describe<'e, 'q>(
&'e mut self,
query: &'q str
) -> Pin<Box<dyn Future<Output = Result<Describe<<PoolConnection<C> as Executor>::Database>, Error>> + 'e + Send>> where
'q: 'e,
[src]
&'e mut self,
query: &'q str
) -> Pin<Box<dyn Future<Output = Result<Describe<<PoolConnection<C> as Executor>::Database>, Error>> + 'e + Send>> where
'q: 'e,
impl<C> Executor for Pool<C> where
C: Connection + Connect<Connection = C>,
[src]
C: Connection + Connect<Connection = C>,
type Database = <C as Executor>::Database
fn send<'e, 'q>(
&'e mut self,
commands: &'q str
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'e + Send>> where
'q: 'e,
[src]
&'e mut self,
commands: &'q str
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'e + Send>> where
'q: 'e,
fn execute<'e, 'q>(
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + 'e + Send>> where
'q: 'e,
[src]
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + 'e + Send>> where
'q: 'e,
fn fetch<'e, 'q>(
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> Pin<Box<dyn Stream<Item = Result<<<C as Executor>::Database as Database>::Row, Error>> + 'e + Send>> where
'q: 'e,
[src]
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> Pin<Box<dyn Stream<Item = Result<<<C as Executor>::Database as Database>::Row, Error>> + 'e + Send>> where
'q: 'e,
fn fetch_optional<'e, 'q>(
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> Pin<Box<dyn Future<Output = Result<Option<<<C as Executor>::Database as Database>::Row>, Error>> + 'e + Send>> where
'q: 'e,
[src]
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> Pin<Box<dyn Future<Output = Result<Option<<<C as Executor>::Database as Database>::Row>, Error>> + 'e + Send>> where
'q: 'e,
fn describe<'e, 'q>(
&'e mut self,
query: &'q str
) -> Pin<Box<dyn Future<Output = Result<Describe<<Pool<C> as Executor>::Database>, Error>> + 'e + Send>> where
'q: 'e,
[src]
&'e mut self,
query: &'q str
) -> Pin<Box<dyn Future<Output = Result<Describe<<Pool<C> as Executor>::Database>, Error>> + 'e + Send>> where
'q: 'e,