[−][src]Trait sqlx_core::Executor
Encapsulates query execution on the database.
Implemented primarily by crate::Pool.
Associated Types
Loading content...Required methods
fn send<'e, 'q: 'e>(&'e mut self, command: &'q str) -> BoxFuture<'e, Result<()>>
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>(
&'e mut self,
query: &'q str,
args: <Self::Database as Database>::Arguments
) -> BoxFuture<'e, Result<u64>>
&'e mut self,
query: &'q str,
args: <Self::Database as Database>::Arguments
) -> BoxFuture<'e, Result<u64>>
Execute the query, returning the number of rows affected.
fn fetch<'e, 'q: 'e>(
&'e mut self,
query: &'q str,
args: <Self::Database as Database>::Arguments
) -> BoxStream<'e, Result<<Self::Database as Database>::Row>>
&'e mut self,
query: &'q str,
args: <Self::Database as Database>::Arguments
) -> BoxStream<'e, Result<<Self::Database as Database>::Row>>
Executes the query and returns a [Stream] of [Row].
Provided methods
fn fetch_optional<'e, 'q: 'e>(
&'e mut self,
query: &'q str,
args: <Self::Database as Database>::Arguments
) -> BoxFuture<'e, Result<Option<<Self::Database as Database>::Row>>>
&'e mut self,
query: &'q str,
args: <Self::Database as Database>::Arguments
) -> BoxFuture<'e, Result<Option<<Self::Database as Database>::Row>>>
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>(
&'e mut self,
query: &'q str,
args: <Self::Database as Database>::Arguments
) -> BoxFuture<'e, Result<<Self::Database as Database>::Row>>
&'e mut self,
query: &'q str,
args: <Self::Database as Database>::Arguments
) -> BoxFuture<'e, Result<<Self::Database as Database>::Row>>
Execute the query and return at most one resulting record.
Implementors
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>(
&'e mut self,
commands: &'q str
) -> BoxFuture<'e, Result<()>>
[src]
&'e mut self,
commands: &'q str
) -> BoxFuture<'e, Result<()>>
fn execute<'e, 'q: 'e>(
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> BoxFuture<'e, Result<u64>>
[src]
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> BoxFuture<'e, Result<u64>>
fn fetch<'e, 'q: 'e>(
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> BoxStream<'e, Result<<<C as Executor>::Database as Database>::Row>>
[src]
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> BoxStream<'e, Result<<<C as Executor>::Database as Database>::Row>>
fn fetch_optional<'e, 'q: 'e>(
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> BoxFuture<'e, Result<Option<<<C as Executor>::Database as Database>::Row>>>
[src]
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> BoxFuture<'e, Result<Option<<<C as Executor>::Database as Database>::Row>>>
fn describe<'e, 'q: 'e>(
&'e mut self,
query: &'q str
) -> BoxFuture<'e, Result<Describe<Self::Database>>>
[src]
&'e mut self,
query: &'q str
) -> BoxFuture<'e, Result<Describe<Self::Database>>>
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>(
&'e mut self,
commands: &'q str
) -> BoxFuture<'e, Result<()>>
[src]
&'e mut self,
commands: &'q str
) -> BoxFuture<'e, Result<()>>
fn execute<'e, 'q: 'e>(
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> BoxFuture<'e, Result<u64>>
[src]
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> BoxFuture<'e, Result<u64>>
fn fetch<'e, 'q: 'e>(
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> BoxStream<'e, Result<<<C as Executor>::Database as Database>::Row>>
[src]
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> BoxStream<'e, Result<<<C as Executor>::Database as Database>::Row>>
fn fetch_optional<'e, 'q: 'e>(
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> BoxFuture<'e, Result<Option<<<C as Executor>::Database as Database>::Row>>>
[src]
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> BoxFuture<'e, Result<Option<<<C as Executor>::Database as Database>::Row>>>
fn describe<'e, 'q: 'e>(
&'e mut self,
query: &'q str
) -> BoxFuture<'e, Result<Describe<Self::Database>>>
[src]
&'e mut self,
query: &'q str
) -> BoxFuture<'e, Result<Describe<Self::Database>>>
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>(
&'e mut self,
commands: &'q str
) -> BoxFuture<'e, Result<()>>
[src]
&'e mut self,
commands: &'q str
) -> BoxFuture<'e, Result<()>>
fn execute<'e, 'q: 'e>(
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> BoxFuture<'e, Result<u64>>
[src]
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> BoxFuture<'e, Result<u64>>
fn fetch<'e, 'q: 'e>(
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> BoxStream<'e, Result<<<C as Executor>::Database as Database>::Row>>
[src]
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> BoxStream<'e, Result<<<C as Executor>::Database as Database>::Row>>
fn fetch_optional<'e, 'q: 'e>(
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> BoxFuture<'e, Result<Option<<<C as Executor>::Database as Database>::Row>>>
[src]
&'e mut self,
query: &'q str,
args: <<C as Executor>::Database as Database>::Arguments
) -> BoxFuture<'e, Result<Option<<<C as Executor>::Database as Database>::Row>>>
fn describe<'e, 'q: 'e>(
&'e mut self,
query: &'q str
) -> BoxFuture<'e, Result<Describe<Self::Database>>>
[src]
&'e mut self,
query: &'q str
) -> BoxFuture<'e, Result<Describe<Self::Database>>>
impl<T> Executor for Transaction<T> where
T: Connection,
[src]
T: Connection,
type Database = T::Database
fn send<'e, 'q: 'e>(
&'e mut self,
commands: &'q str
) -> BoxFuture<'e, Result<()>>
[src]
&'e mut self,
commands: &'q str
) -> BoxFuture<'e, Result<()>>
fn execute<'e, 'q: 'e>(
&'e mut self,
query: &'q str,
args: <Self::Database as Database>::Arguments
) -> BoxFuture<'e, Result<u64>>
[src]
&'e mut self,
query: &'q str,
args: <Self::Database as Database>::Arguments
) -> BoxFuture<'e, Result<u64>>
fn fetch<'e, 'q: 'e>(
&'e mut self,
query: &'q str,
args: <Self::Database as Database>::Arguments
) -> BoxStream<'e, Result<<Self::Database as Database>::Row>>
[src]
&'e mut self,
query: &'q str,
args: <Self::Database as Database>::Arguments
) -> BoxStream<'e, Result<<Self::Database as Database>::Row>>
fn fetch_optional<'e, 'q: 'e>(
&'e mut self,
query: &'q str,
args: <Self::Database as Database>::Arguments
) -> BoxFuture<'e, Result<Option<<Self::Database as Database>::Row>>>
[src]
&'e mut self,
query: &'q str,
args: <Self::Database as Database>::Arguments
) -> BoxFuture<'e, Result<Option<<Self::Database as Database>::Row>>>
fn describe<'e, 'q: 'e>(
&'e mut self,
query: &'q str
) -> BoxFuture<'e, Result<Describe<Self::Database>>>
[src]
&'e mut self,
query: &'q str
) -> BoxFuture<'e, Result<Describe<Self::Database>>>