Struct scooby::postgres::statements::DeleteFrom
source · pub struct DeleteFrom { /* private fields */ }
Expand description
DELETE FROM
statement, possibly with additional clauses.
Finalize and turn into String
by calling to_string
.
See delete_from
docs for more details and examples.
Implementations§
source§impl DeleteFrom
impl DeleteFrom
sourcepub fn where_(self, conditions: impl IntoIteratorOfSameType<Condition>) -> Self
pub fn where_(self, conditions: impl IntoIteratorOfSameType<Condition>) -> Self
Add one or more WHERE
conditions, AND
’ed together with themselves and existing conditions.
use scooby::postgres::delete_from;
let sql = delete_from("Dummy")
.where_(("x > 1", "y > 1"))
.where_("z > 1")
.to_string();
assert_eq!(sql, "DELETE FROM Dummy WHERE x > 1 AND y > 1 AND z > 1");
sourcepub fn returning(
self,
expressions: impl IntoIteratorOfSameType<OutputExpression>
) -> Self
pub fn returning( self, expressions: impl IntoIteratorOfSameType<OutputExpression> ) -> Self
Add one or more RETURNING
expressions.
use scooby::postgres::delete_from;
let sql = delete_from("Dummy")
.returning("id")
.returning(("width", "height"))
.to_string();
assert_eq!(sql, "DELETE FROM Dummy RETURNING id, width, height");
Trait Implementations§
source§impl Clone for DeleteFrom
impl Clone for DeleteFrom
source§fn clone(&self) -> DeleteFrom
fn clone(&self) -> DeleteFrom
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for DeleteFrom
impl Debug for DeleteFrom
Auto Trait Implementations§
impl RefUnwindSafe for DeleteFrom
impl Send for DeleteFrom
impl Sync for DeleteFrom
impl Unpin for DeleteFrom
impl UnwindSafe for DeleteFrom
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