sqlite3-parser: separate boxed Delete struct

This commit is contained in:
Jussi Saurio
2025-02-09 12:59:08 +02:00
parent 40a8dc14cd
commit 32887518ce
5 changed files with 59 additions and 44 deletions

View File

@@ -761,14 +761,14 @@ limit_opt(A) ::= LIMIT expr(X) COMMA expr(Y).
cmd ::= with(C) DELETE FROM xfullname(X) indexed_opt(I) where_opt_ret(W)
orderby_opt(O) limit_opt(L). {
let (where_clause, returning) = W;
self.ctx.stmt = Some(Stmt::Delete{ with: C, tbl_name: X, indexed: I, where_clause: where_clause.map(Box::new), returning,
order_by: O, limit: L });
self.ctx.stmt = Some(Stmt::Delete(Box::new(Delete{ with: C, tbl_name: X, indexed: I, where_clause: where_clause.map(Box::new), returning,
order_by: O, limit: L })));
}
%else
cmd ::= with(C) DELETE FROM xfullname(X) indexed_opt(I) where_opt_ret(W). {
let (where_clause, returning) = W;
self.ctx.stmt = Some(Stmt::Delete{ with: C, tbl_name: X, indexed: I, where_clause: where_clause.map(Box::new), returning,
order_by: None, limit: None });
self.ctx.stmt = Some(Stmt::Delete(Box::new(Delete{ with: C, tbl_name: X, indexed: I, where_clause: where_clause.map(Box::new), returning,
order_by: None, limit: None })));
}
%endif