Skip to content
This repository was archived by the owner on Jul 15, 2021. It is now read-only.

Commit 0a70bcf

Browse files
committed
Allow target database name in VACUUM statement.
Specifying a target after the VACUUM statement appears to be an undocumented feature.
1 parent 1c58d92 commit 0a70bcf

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/grammar.pegjs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,12 +1012,23 @@ stmt_detach "DETACH Statement"
10121012
};
10131013
}
10141014

1015+
/**
1016+
* @note
1017+
* Specifying a target after the VACUUM statement appears to be an
1018+
* undocumented feature.
1019+
*/
10151020
stmt_vacuum "VACUUM Statement"
1016-
= v:( VACUUM ) o
1021+
= v:( VACUUM ) o t:( vacuum_target )?
10171022
{
1018-
return {
1023+
return Object.assign({
10191024
'type': 'statement',
10201025
'variant': 'vacuum'
1026+
}, t);
1027+
}
1028+
vacuum_target
1029+
= t:( id_database ) o {
1030+
return {
1031+
'target': t
10211032
};
10221033
}
10231034

@@ -1316,6 +1327,7 @@ select_source
13161327
};
13171328
}
13181329
return f;
1330+
}
13191331

13201332
source_loop_tail
13211333
= cl:( select_cross_clause / select_join_clause ) c:( join_condition )? {

0 commit comments

Comments
 (0)