pub struct DeleteDyn<Table> { /* private fields */ }Expand description
A dynamic DELETE statement builder using string-based column names.
For compile-time validated queries, use Delete from builder::typed.
Uses the typestate pattern to ensure that:
build()is only available when table is specifiedwhere_clause()is only available after table is specified
Implementations§
Source§impl DeleteDyn<HasTable>
impl DeleteDyn<HasTable>
Sourcepub fn where_clause(self, expr: ExprBuilder) -> Self
pub fn where_clause(self, expr: ExprBuilder) -> Self
Adds a WHERE clause.
Important: DELETE without WHERE deletes all rows!
Consider using where_clause_required() for safety.
Sourcepub fn build(self) -> (String, Vec<SqlValue>)
pub fn build(self) -> (String, Vec<SqlValue>)
Builds the DELETE statement and returns SQL with parameters.
Warning: If no WHERE clause is specified, this will delete ALL rows.
Sourcepub const fn has_where_clause(&self) -> bool
pub const fn has_where_clause(&self) -> bool
Returns true if a WHERE clause is specified.
Trait Implementations§
Auto Trait Implementations§
impl<Table> Freeze for DeleteDyn<Table>
impl<Table> RefUnwindSafe for DeleteDyn<Table>where
Table: RefUnwindSafe,
impl<Table> Send for DeleteDyn<Table>where
Table: Send,
impl<Table> Sync for DeleteDyn<Table>where
Table: Sync,
impl<Table> Unpin for DeleteDyn<Table>where
Table: Unpin,
impl<Table> UnwindSafe for DeleteDyn<Table>where
Table: UnwindSafe,
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