mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-07 10:14:21 +01:00
sqlite3-parser: box everything in Attach
This commit is contained in:
@@ -78,11 +78,11 @@ pub enum Stmt {
|
||||
Attach {
|
||||
/// filename
|
||||
// TODO distinction between ATTACH and ATTACH DATABASE
|
||||
expr: Expr,
|
||||
expr: Box<Expr>,
|
||||
/// schema name
|
||||
db_name: Expr,
|
||||
db_name: Box<Expr>,
|
||||
/// password
|
||||
key: Option<Expr>,
|
||||
key: Option<Box<Expr>>,
|
||||
},
|
||||
/// `BEGIN`: tx type, tx name
|
||||
Begin(Option<TransactionType>, Option<Name>),
|
||||
|
||||
@@ -1276,7 +1276,7 @@ cmd ::= DROP TRIGGER ifexists(NOERR) fullname(X). {
|
||||
//////////////////////// ATTACH DATABASE file AS name /////////////////////////
|
||||
%ifndef SQLITE_OMIT_ATTACH
|
||||
cmd ::= ATTACH database_kw_opt expr(F) AS expr(D) key_opt(K). {
|
||||
self.ctx.stmt = Some(Stmt::Attach{ expr: F, db_name: D, key: K });
|
||||
self.ctx.stmt = Some(Stmt::Attach{ expr: Box::new(F), db_name: Box::new(D), key: K.map(Box::new) });
|
||||
}
|
||||
cmd ::= DETACH database_kw_opt expr(D). {
|
||||
self.ctx.stmt = Some(Stmt::Detach(D));
|
||||
|
||||
Reference in New Issue
Block a user