Trait sqlx::Execute

source ยท
pub trait Execute<'q, DB>: Sized + Send
where DB: Database,
{ // Required methods fn sql(&self) -> &'q str; fn statement(&self) -> Option<&<DB as Database>::Statement<'q>>; fn take_arguments( &mut self, ) -> Result<Option<<DB as Database>::Arguments<'q>>, Box<dyn Error + Send + Sync>>; 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 Database>::Statement<'q>>

Gets the previously cached statement, if available.

source

fn take_arguments( &mut self, ) -> Result<Option<<DB as Database>::Arguments<'q>>, Box<dyn Error + Send + Sync>>

Returns the arguments to be bound against the query string.

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

Returns Err if encoding any of the arguments failed.

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> Execute<'q, DB> for &'q str
where DB: Database,

sourceยง

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

sourceยง

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

sourceยง

fn take_arguments( &mut self, ) -> Result<Option<<DB as Database>::Arguments<'q>>, Box<dyn Error + Send + Sync>>

sourceยง

fn persistent(&self) -> bool

sourceยง

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

sourceยง

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

sourceยง

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

sourceยง

fn take_arguments( &mut self, ) -> Result<Option<<DB as Database>::Arguments<'q>>, Box<dyn Error + Send + Sync>>

sourceยง

fn persistent(&self) -> bool

Implementorsยง

sourceยง

impl<'q, DB> Execute<'q, DB> for RawSql<'q>
where DB: Database,

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, A> Execute<'q, DB> for Map<'q, DB, F, A>
where F: Send, A: Send + IntoArguments<'q, DB>, DB: Database,

sourceยง

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

sourceยง

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