pub struct Delete<'a> { /* private fields */ }
Expand description
A struct for building DELETE
queries.
Implementations§
Source§impl<'a> Delete<'a>
impl<'a> Delete<'a>
Sourcepub fn where_(self, where_: Where<'a>) -> Delete<'a>
pub fn where_(self, where_: Where<'a>) -> Delete<'a>
Add a WHERE
clause to your DELETE
query.
If called multiple times, the conditions are joined using AND
.
Sourcepub fn where_raw(
self,
statement: impl Into<String>,
params: Vec<&'a (dyn ToSql + Sync)>,
) -> Delete<'a>
pub fn where_raw( self, statement: impl Into<String>, params: Vec<&'a (dyn ToSql + Sync)>, ) -> Delete<'a>
Add a raw WHERE
clause to your query.
You can reference the params
by using the ?
placeholder in your statement.
Note: you need to pass the exact types Postgres is expecting. Failure to do so will result in (sometimes confusing) runtime errors.
Otherwise this behaves exactly like where_
.
§Example
ⓘ
Book::select()
.where_(Book::id.neq(&3))
.where_raw("complex_function(book.title, ?, ?)", vec![&true, &"Foobar"])
.await?;
Trait Implementations§
Source§impl<'a> IntoFuture for Delete<'a>
impl<'a> IntoFuture for Delete<'a>
Source§type IntoFuture = Pin<Box<dyn Future<Output = <Delete<'a> as IntoFuture>::Output> + 'a>>
type IntoFuture = Pin<Box<dyn Future<Output = <Delete<'a> as IntoFuture>::Output> + 'a>>
Which kind of future are we turning this into?
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
Auto Trait Implementations§
impl<'a> Freeze for Delete<'a>
impl<'a> !RefUnwindSafe for Delete<'a>
impl<'a> Send for Delete<'a>
impl<'a> Sync for Delete<'a>
impl<'a> Unpin for Delete<'a>
impl<'a> !UnwindSafe for Delete<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more