pub struct DeleteStatement {
pub ctes: Vec<Cte>,
pub table: String,
pub only: bool,
pub alias: Option<String>,
pub where_: Option<Expr>,
pub order_limit: Option<Box<DmlOrderLimit>>,
pub returning: Option<Vec<SelectItem>>,
}Expand description
DELETE FROM <table> [WHERE cond]. v4.4 — removes matched rows
from the active catalog and prunes them from every index.
Fields§
§ctes: Vec<Cte>v7.37.43-T4.4 — leading WITH cte AS (…) clauses on a top-
level DELETE. Empty for a plain DELETE.
table: String§only: boolv7.39 (round 646) — DELETE FROM ONLY t, the sibling of UpdateStatement::only: apply
to t’s own rows and not to anything that descends from it.
Round 644 taught the FROM clause the keyword and left DML behind
because it needed a field here, and this struct carries a warning
that round 413 measured widening it in place overflowing the
parser’s nesting stack. That warning was about from_sources, a
struct wide enough to need boxing; a bool lands in the padding
already present — same as CreateTableStatement::temporary.
It also earns its keep beyond the spelling: the inheritance fan-out needs a way to say “the parent’s own rows” as a statement, or running one on the parent recurses forever.
alias: Option<String>v7.39 (round 241) — DELETE FROM t [AS] alias USING …: the name
the WHERE / RETURNING expressions refer to the target row by.
where_: Option<Expr>§order_limit: Option<Box<DmlOrderLimit>>v7.39 (round 432) — MySQL’s DELETE … [ORDER BY … [LIMIT n]], the
batched-cleanup idiom. Same clause and same meaning as the UPDATE
form (round 413), so it shares that payload — and it is boxed for
the same reason: a naked Vec<OrderBy> + Option<u32> on a DML
statement tipped the parser’s 512 KiB nesting stack.
returning: Option<Vec<SelectItem>>v7.9.4 — RETURNING <projection>.
Trait Implementations§
Source§impl Clone for DeleteStatement
impl Clone for DeleteStatement
Source§fn clone(&self) -> DeleteStatement
fn clone(&self) -> DeleteStatement
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more