pub trait Execute<'q, DB: Database>: Send + Sized {
    // Required methods
    fn sql(&self) -> &'q str;
    fn statement(&self) -> Option<&<DB as HasStatement<'q>>::Statement>;
    fn take_arguments(&mut self) -> Option<<DB as HasArguments<'q>>::Arguments>;
    fn persistent(&self) -> bool;
}
Expand description

A type that may be executed against a database connection.

Implemented for the following:

Required Methods§

source

fn sql(&self) -> &'q str

Gets the SQL that will be executed.

source

fn statement(&self) -> Option<&<DB as HasStatement<'q>>::Statement>

Gets the previously cached statement, if available.

source

fn take_arguments(&mut self) -> Option<<DB as HasArguments<'q>>::Arguments>

Returns the arguments to be bound against the query string.

Returning None for Arguments indicates to use a “simple” query protocol and to not prepare the query. Returning Some(Default::default()) is an empty arguments object that will be prepared (and cached) before execution.

source

fn persistent(&self) -> bool

Returns true if the statement should be cached.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'q, DB: Database> Execute<'q, DB> for &'q str

source§

fn sql(&self) -> &'q str

source§

fn statement(&self) -> Option<&<DB as HasStatement<'q>>::Statement>

source§

fn take_arguments(&mut self) -> Option<<DB as HasArguments<'q>>::Arguments>

source§

fn persistent(&self) -> bool

source§

impl<'q, DB: Database> Execute<'q, DB> for (&'q str, Option<<DB as HasArguments<'q>>::Arguments>)

source§

fn sql(&self) -> &'q str

source§

fn statement(&self) -> Option<&<DB as HasStatement<'q>>::Statement>

source§

fn take_arguments(&mut self) -> Option<<DB as HasArguments<'q>>::Arguments>

source§

fn persistent(&self) -> bool

Implementors§

source§

impl<'q, DB, A> Execute<'q, DB> for Query<'q, DB, A>
where DB: Database, A: Send + IntoArguments<'q, DB>,

source§

impl<'q, DB, F: Send, A> Execute<'q, DB> for Map<'q, DB, F, A>
where DB: Database, A: IntoArguments<'q, DB> + Send,

source§

impl<'q, DB, O: Send, A> Execute<'q, DB> for QueryAs<'q, DB, O, A>
where DB: Database, A: 'q + IntoArguments<'q, DB> + Send,

source§

impl<'q, DB: Database, O: Send, A> Execute<'q, DB> for QueryScalar<'q, DB, O, A>
where A: 'q + IntoArguments<'q, DB> + Send,