pub struct DeleteQuery {
pub with: With,
pub table: TableRef,
pub using: TableRef,
pub extra_using: Vec<TableRef>,
pub where_: Where,
pub returning: Returning,
}Expand description
A PostgreSQL DELETE.
From https://www.postgresql.org/docs/17/sql-delete.html:
[ WITH [ RECURSIVE ] with_query [, ...] ]
DELETE FROM [ ONLY ] table_name [ * ] [ [ AS ] alias ]
[ USING from_item [, ...] ]
[ WHERE condition | WHERE CURRENT OF cursor_name ]
[ RETURNING … ]USING is a FROM list under another keyword, which is why it is the
HasTableRef slot here and the deleted-from table is the
HasTargetTable one.
Fields§
§with: WithWITH ….
table: TableRefThe table rows are deleted from.
using: TableRefThe first USING item, with its joins.
extra_using: Vec<TableRef>Further comma-separated USING items.
where_: WhereWHERE ….
returning: ReturningRETURNING ….
Implementations§
Source§impl DeleteQuery
impl DeleteQuery
Sourcepub fn new() -> DeleteQuery
pub fn new() -> DeleteQuery
A DELETE with nothing set yet.
Sourcepub fn apply(&mut self, mods: impl Mod<DeleteQuery>)
pub fn apply(&mut self, mods: impl Mod<DeleteQuery>)
Apply more mods to an existing query.
Trait Implementations§
Source§impl Clone for DeleteQuery
impl Clone for DeleteQuery
Source§fn clone(&self) -> DeleteQuery
fn clone(&self) -> DeleteQuery
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 DeleteQuery
impl Debug for DeleteQuery
Source§impl Default for DeleteQuery
impl Default for DeleteQuery
Source§fn default() -> DeleteQuery
fn default() -> DeleteQuery
Returns the “default value” for a type. Read more
Source§impl Expression for DeleteQuery
impl Expression for DeleteQuery
Source§impl HasExtraTables for DeleteQuery
impl HasExtraTables for DeleteQuery
Source§fn extra_tables_mut(&mut self) -> &mut Vec<TableRef>
fn extra_tables_mut(&mut self) -> &mut Vec<TableRef>
The additional from-items to modify.
Source§impl HasJoins for DeleteQuery
impl HasJoins for DeleteQuery
Source§impl HasReturning for DeleteQuery
impl HasReturning for DeleteQuery
Source§fn returning_mut(&mut self) -> &mut Returning
fn returning_mut(&mut self) -> &mut Returning
The
RETURNING clause to modify.Source§impl HasTableRef for DeleteQuery
impl HasTableRef for DeleteQuery
Source§fn table_ref_mut(&mut self) -> &mut TableRef
fn table_ref_mut(&mut self) -> &mut TableRef
The table reference to modify.
Source§impl HasTargetTable for DeleteQuery
impl HasTargetTable for DeleteQuery
Source§fn target_table_mut(&mut self) -> &mut TableRef
fn target_table_mut(&mut self) -> &mut TableRef
The target table to modify.
Source§impl HasWhere for DeleteQuery
impl HasWhere for DeleteQuery
Source§impl HasWith for DeleteQuery
impl HasWith for DeleteQuery
Source§impl IntoExprList for DeleteQuery
impl IntoExprList for DeleteQuery
Source§fn into_expr_list(self) -> Vec<Expr>
fn into_expr_list(self) -> Vec<Expr>
Perform the conversion.
Source§impl Query for DeleteQuery
impl Query for DeleteQuery
Source§impl<H, L, M> QueryExtensions<H, L, M> for DeleteQuery
impl<H, L, M> QueryExtensions<H, L, M> for DeleteQuery
Auto Trait Implementations§
impl !RefUnwindSafe for DeleteQuery
impl !UnwindSafe for DeleteQuery
impl Freeze for DeleteQuery
impl Send for DeleteQuery
impl Sync for DeleteQuery
impl Unpin for DeleteQuery
impl UnsafeUnpin for DeleteQuery
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