sqlite3-parser: box large members of CreateTrigger

This commit is contained in:
Jussi Saurio
2025-02-08 18:05:49 +02:00
parent 0dba39b025
commit f341474fee
2 changed files with 4 additions and 4 deletions

View File

@@ -125,13 +125,13 @@ pub enum Stmt {
/// `BEFORE`/`AFTER`/`INSTEAD OF`
time: Option<TriggerTime>,
/// `DELETE`/`INSERT`/`UPDATE`
event: TriggerEvent,
event: Box<TriggerEvent>,
/// table name
tbl_name: QualifiedName,
/// `FOR EACH ROW`
for_each_row: bool,
/// `WHEN`
when_clause: Option<Expr>,
when_clause: Option<Box<Expr>>,
/// statements
commands: Vec<TriggerCmd>,
},

View File

@@ -1167,8 +1167,8 @@ minus_num(A) ::= MINUS number(X). {A = Expr::unary(UnaryOperator::Negative,
cmd ::= createkw temp(T) TRIGGER ifnotexists(NOERR) fullname(B) trigger_time(C) trigger_event(D)
ON fullname(E) foreach_clause(X) when_clause(G) BEGIN trigger_cmd_list(S) END. {
self.ctx.stmt = Some(Stmt::CreateTrigger{
temporary: T, if_not_exists: NOERR, trigger_name: B, time: C, event: D, tbl_name: E,
for_each_row: X, when_clause: G, commands: S
temporary: T, if_not_exists: NOERR, trigger_name: B, time: C, event: Box::new(D), tbl_name: E,
for_each_row: X, when_clause: G.map(Box::new), commands: S
});
}