sqlite3-parser: separate boxed Update struct

This commit is contained in:
Jussi Saurio
2025-02-09 12:51:08 +02:00
parent 575b484740
commit af920a317c
4 changed files with 65 additions and 25 deletions

View File

@@ -790,15 +790,15 @@ where_opt_ret(A) ::= WHERE expr(X) RETURNING selcollist(Y).
cmd ::= with(C) UPDATE orconf(R) xfullname(X) indexed_opt(I) SET setlist(Y) from(F)
where_opt_ret(W) orderby_opt(O) limit_opt(L). {
let (where_clause, returning) = W;
self.ctx.stmt = Some(Stmt::Update { with: C, or_conflict: R, tbl_name: X, indexed: I, sets: Y, from: F,
where_clause: where_clause.map(Box::new), returning, order_by: O, limit: L });
self.ctx.stmt = Some(Stmt::Update(Box::new(Update{ with: C, or_conflict: R, tbl_name: X, indexed: I, sets: Y, from: F,
where_clause: where_clause.map(Box::new), returning, order_by: O, limit: L })));
}
%else
cmd ::= with(C) UPDATE orconf(R) xfullname(X) indexed_opt(I) SET setlist(Y) from(F)
where_opt_ret(W). {
let (where_clause, returning) = W;
self.ctx.stmt = Some(Stmt::Update { with: C, or_conflict: R, tbl_name: X, indexed: I, sets: Y, from: F,
where_clause: where_clause.map(Box::new), returning, order_by: None, limit: None });
self.ctx.stmt = Some(Stmt::Update(Box::new(Update{ with: C, or_conflict: R, tbl_name: X, indexed: I, sets: Y, from: F,
where_clause: where_clause.map(Box::new), returning, order_by: None, limit: None })));
}
%endif