File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 3434 ' FROM' : true ,
3535 ' FULL' : true ,
3636
37+ ' GENERATED' : true ,
3738 ' GROUP' : true ,
3839
3940 ' HAVING' : true ,
@@ -584,6 +585,9 @@ column_definition_opt
584585 / t :create_option_character_set_kw __ s :KW_ASSIGIN_EQUAL ? __ v :ident_without_kw_type {
585586 return { character_set: { type: t, value: v, symbol: s }}
586587 }
588+ / g :generated {
589+ return { generated: g }
590+ }
587591
588592column_definition_opt_list
589593 = head :column_definition_opt __ tail :(__ column_definition_opt )* {
@@ -643,6 +647,21 @@ default_expr
643647 value: ce
644648 }
645649 }
650+ generated_always
651+ = ga :('GENERATED' i __ 'ALWAYS' i ) {
652+ return ga .join (' ' ).toLowerCase ()
653+ }
654+
655+ generated
656+ = gn :(generated_always ? __ 'AS' i ) __ LPAREN __ expr :(literal / expr ) __ RPAREN __ st :('STORED' i / 'VIRTUAL' i )* {
657+ return {
658+ type: ' generated' ,
659+ expr: expr,
660+ value: gn .filter (s => typeof s === ' string' ).join (' ' ).toLowerCase (),
661+ storage_type: st && st[0 ] && st[0 ].toLowerCase ()
662+ }
663+ }
664+
646665analyze_stmt
647666 = a :KW_ANALYZE __ t :table_name __ {
648667 tableList .add (` ${ a} ::${ t .db } ::${ t .table } ` );
You can’t perform that action at this time.
0 commit comments