@@ -117,6 +117,7 @@ declare var kw_when: any;
117117declare var kw_where : any ;
118118declare var kw_window : any ;
119119declare var kw_from : any ;
120+ declare var kw_lateral : any ;
120121declare var kw_as : any ;
121122declare var kw_join : any ;
122123declare var kw_on : any ;
@@ -217,6 +218,7 @@ declare var kw_collate: any;
217218declare var comma : any ;
218219declare var kw_create : any ;
219220declare var kw_unique : any ;
221+ declare var kw_concurrently : any ;
220222declare var kw_on : any ;
221223declare var kw_using : any ;
222224declare var kw_collate : any ;
@@ -280,6 +282,7 @@ declare var kw_as: any;
280282declare var kw_create : any ;
281283declare var kw_as : any ;
282284declare var comma : any ;
285+ declare var kw_to : any ;
283286declare var kw_union : any ;
284287declare var kw_all : any ;
285288declare var kw_as : any ;
@@ -588,6 +591,7 @@ const grammar: Grammar = {
588591 { "name" : "kw_nowait" , "symbols" : [ ( lexerAny . has ( "word" ) ? { type : "word" } : word ) ] , "postprocess" : notReservedKw ( 'nowait' ) } ,
589592 { "name" : "kw_skip" , "symbols" : [ ( lexerAny . has ( "word" ) ? { type : "word" } : word ) ] , "postprocess" : notReservedKw ( 'skip' ) } ,
590593 { "name" : "kw_locked" , "symbols" : [ ( lexerAny . has ( "word" ) ? { type : "word" } : word ) ] , "postprocess" : notReservedKw ( 'locked' ) } ,
594+ { "name" : "kw_within" , "symbols" : [ ( lexerAny . has ( "word" ) ? { type : "word" } : word ) ] , "postprocess" : notReservedKw ( 'within' ) } ,
591595 { "name" : "kw_ifnotexists" , "symbols" : [ "kw_if" , ( lexerAny . has ( "kw_not" ) ? { type : "kw_not" } : kw_not ) , "kw_exists" ] } ,
592596 { "name" : "kw_ifexists" , "symbols" : [ "kw_if" , "kw_exists" ] } ,
593597 { "name" : "kw_withordinality" , "symbols" : [ ( lexerAny . has ( "kw_with" ) ? { type : "kw_with" } : kw_with ) , "kw_ordinality" ] } ,
@@ -880,29 +884,36 @@ const grammar: Grammar = {
880884 } ) ,
881885 } ) ;
882886 } } ,
883- { "name" : "stb_statement" , "symbols" : [ "selection_paren" , "stb_opts" ] , "postprocess" : x => track ( x , {
887+ { "name" : "stb_statement$ebnf$1" , "symbols" : [ ( lexerAny . has ( "kw_lateral" ) ? { type : "kw_lateral" } : kw_lateral ) ] , "postprocess" : id } ,
888+ { "name" : "stb_statement$ebnf$1" , "symbols" : [ ] , "postprocess" : ( ) => null } ,
889+ { "name" : "stb_statement" , "symbols" : [ "stb_statement$ebnf$1" , "selection_paren" , "stb_opts" ] , "postprocess" : x => track ( x , {
884890 type : 'statement' ,
885- statement : unwrap ( x [ 0 ] ) ,
886- ...x [ 1 ] ,
891+ statement : unwrap ( x [ 1 ] ) ,
892+ ...x [ 0 ] && { lateral : true } ,
893+ ...x [ 2 ] ,
887894 } ) } ,
888895 { "name" : "select_values" , "symbols" : [ "kw_values" , "insert_values" ] , "postprocess" : x => track ( x , {
889896 type : 'values' ,
890897 values : x [ 1 ] ,
891898 } ) } ,
892- { "name" : "stb_call$ebnf$1" , "symbols" : [ "kw_withordinality" ] , "postprocess" : id } ,
899+ { "name" : "stb_call$ebnf$1" , "symbols" : [ ( lexerAny . has ( "kw_lateral" ) ? { type : "kw_lateral" } : kw_lateral ) ] , "postprocess" : id } ,
893900 { "name" : "stb_call$ebnf$1" , "symbols" : [ ] , "postprocess" : ( ) => null } ,
894- { "name" : "stb_call$ebnf$2" , "symbols" : [ "stb_call_alias " ] , "postprocess" : id } ,
901+ { "name" : "stb_call$ebnf$2" , "symbols" : [ "kw_withordinality " ] , "postprocess" : id } ,
895902 { "name" : "stb_call$ebnf$2" , "symbols" : [ ] , "postprocess" : ( ) => null } ,
896- { "name" : "stb_call" , "symbols" : [ "expr_function_call" , "stb_call$ebnf$1" , "stb_call$ebnf$2" ] , "postprocess" : x => {
897- const withOrdinality = x [ 1 ] ;
898- const alias = x [ 2 ] ;
903+ { "name" : "stb_call$ebnf$3" , "symbols" : [ "stb_call_alias" ] , "postprocess" : id } ,
904+ { "name" : "stb_call$ebnf$3" , "symbols" : [ ] , "postprocess" : ( ) => null } ,
905+ { "name" : "stb_call" , "symbols" : [ "stb_call$ebnf$1" , "expr_function_call" , "stb_call$ebnf$2" , "stb_call$ebnf$3" ] , "postprocess" : x => {
906+ const lateral = x [ 0 ] ;
907+ const withOrdinality = x [ 2 ] ;
908+ const alias = x [ 3 ] ;
899909
900910 if ( ! withOrdinality && ! alias ) {
901- return x [ 0 ] ;
911+ return x [ 1 ] ;
902912 }
903913
904914 return track ( x , {
905- ...x [ 0 ] ,
915+ ...x [ 1 ] ,
916+ ...lateral && { lateral : true } ,
906917 ... withOrdinality && { withOrdinality : true } ,
907918 alias : alias ? asNameWithColumns ( alias [ 0 ] , alias [ 1 ] ) : undefined ,
908919 } ) ;
@@ -1509,16 +1520,19 @@ const grammar: Grammar = {
15091520 { "name" : "expr_call$ebnf$4$subexpression$1" , "symbols" : [ "kw_filter" , "lparen" , ( lexerAny . has ( "kw_where" ) ? { type : "kw_where" } : kw_where ) , "expr" , "rparen" ] , "postprocess" : get ( 3 ) } ,
15101521 { "name" : "expr_call$ebnf$4" , "symbols" : [ "expr_call$ebnf$4$subexpression$1" ] , "postprocess" : id } ,
15111522 { "name" : "expr_call$ebnf$4" , "symbols" : [ ] , "postprocess" : ( ) => null } ,
1512- { "name" : "expr_call$ebnf$5" , "symbols" : [ "expr_call_over " ] , "postprocess" : id } ,
1523+ { "name" : "expr_call$ebnf$5" , "symbols" : [ "expr_call_within_group " ] , "postprocess" : id } ,
15131524 { "name" : "expr_call$ebnf$5" , "symbols" : [ ] , "postprocess" : ( ) => null } ,
1514- { "name" : "expr_call" , "symbols" : [ "expr_fn_name" , "lparen" , "expr_call$ebnf$1" , "expr_call$ebnf$2" , "expr_call$ebnf$3" , "rparen" , "expr_call$ebnf$4" , "expr_call$ebnf$5" ] , "postprocess" : x => track ( x , {
1525+ { "name" : "expr_call$ebnf$6" , "symbols" : [ "expr_call_over" ] , "postprocess" : id } ,
1526+ { "name" : "expr_call$ebnf$6" , "symbols" : [ ] , "postprocess" : ( ) => null } ,
1527+ { "name" : "expr_call" , "symbols" : [ "expr_fn_name" , "lparen" , "expr_call$ebnf$1" , "expr_call$ebnf$2" , "expr_call$ebnf$3" , "rparen" , "expr_call$ebnf$4" , "expr_call$ebnf$5" , "expr_call$ebnf$6" ] , "postprocess" : x => track ( x , {
15151528 type : 'call' ,
15161529 function : unwrap ( x [ 0 ] ) ,
15171530 ...x [ 2 ] && { distinct : toStr ( x [ 2 ] ) } ,
15181531 args : x [ 3 ] || [ ] ,
15191532 ...x [ 4 ] && { orderBy : x [ 4 ] } ,
15201533 ...x [ 6 ] && { filter : unwrap ( x [ 6 ] ) } ,
1521- ...x [ 7 ] && { over : unwrap ( x [ 7 ] ) } ,
1534+ ...x [ 7 ] && { withinGroup : x [ 7 ] } ,
1535+ ...x [ 8 ] && { over : unwrap ( x [ 8 ] ) } ,
15221536 } ) } ,
15231537 { "name" : "expr_call_over$ebnf$1$subexpression$1" , "symbols" : [ "kw_partition" , "kw_by" , "expr_list_raw" ] , "postprocess" : last } ,
15241538 { "name" : "expr_call_over$ebnf$1" , "symbols" : [ "expr_call_over$ebnf$1$subexpression$1" ] , "postprocess" : id } ,
@@ -1529,6 +1543,9 @@ const grammar: Grammar = {
15291543 ...x [ 2 ] && { partitionBy : x [ 2 ] } ,
15301544 ...x [ 3 ] && { orderBy : x [ 3 ] } ,
15311545 } ) } ,
1546+ { "name" : "expr_call_within_group$subexpression$1" , "symbols" : [ "kw_within" , ( lexerAny . has ( "kw_group" ) ? { type : "kw_group" } : kw_group ) ] } ,
1547+ { "name" : "expr_call_within_group$subexpression$2" , "symbols" : [ ( lexerAny . has ( "kw_order" ) ? { type : "kw_order" } : kw_order ) , "kw_by" ] } ,
1548+ { "name" : "expr_call_within_group" , "symbols" : [ "expr_call_within_group$subexpression$1" , "lparen" , "expr_call_within_group$subexpression$2" , "select_order_by_expr" , "rparen" ] , "postprocess" : x => track ( x , x [ 3 ] ) } ,
15321549 { "name" : "expr_extract$subexpression$1" , "symbols" : [ "word" ] , "postprocess" : kw ( 'extract' ) } ,
15331550 { "name" : "expr_extract" , "symbols" : [ "expr_extract$subexpression$1" , "lparen" , "word" , ( lexerAny . has ( "kw_from" ) ? { type : "kw_from" } : kw_from ) , "expr" , "rparen" ] , "postprocess" : x => track ( x , {
15341551 type : 'extract' ,
@@ -1839,30 +1856,33 @@ const grammar: Grammar = {
18391856 { "name" : "createtable_opts" , "symbols" : [ "createtable_opts$subexpression$1" , "lparen" , "createtable_opts$macrocall$1" , "rparen" ] , "postprocess" : x => track ( x , { inherits : x [ 2 ] } ) } ,
18401857 { "name" : "createindex_statement$ebnf$1" , "symbols" : [ ( lexerAny . has ( "kw_unique" ) ? { type : "kw_unique" } : kw_unique ) ] , "postprocess" : id } ,
18411858 { "name" : "createindex_statement$ebnf$1" , "symbols" : [ ] , "postprocess" : ( ) => null } ,
1842- { "name" : "createindex_statement$ebnf$2" , "symbols" : [ "kw_ifnotexists" ] , "postprocess" : id } ,
1859+ { "name" : "createindex_statement$ebnf$2" , "symbols" : [ ( lexerAny . has ( "kw_concurrently" ) ? { type : "kw_concurrently" } : kw_concurrently ) ] , "postprocess" : id } ,
18431860 { "name" : "createindex_statement$ebnf$2" , "symbols" : [ ] , "postprocess" : ( ) => null } ,
1844- { "name" : "createindex_statement$ebnf$3" , "symbols" : [ "word " ] , "postprocess" : id } ,
1861+ { "name" : "createindex_statement$ebnf$3" , "symbols" : [ "kw_ifnotexists " ] , "postprocess" : id } ,
18451862 { "name" : "createindex_statement$ebnf$3" , "symbols" : [ ] , "postprocess" : ( ) => null } ,
1846- { "name" : "createindex_statement$ebnf$4$subexpression$1" , "symbols" : [ ( lexerAny . has ( "kw_using" ) ? { type : "kw_using" } : kw_using ) , "ident" ] , "postprocess" : last } ,
1847- { "name" : "createindex_statement$ebnf$4" , "symbols" : [ "createindex_statement$ebnf$4$subexpression$1" ] , "postprocess" : id } ,
1863+ { "name" : "createindex_statement$ebnf$4" , "symbols" : [ "word" ] , "postprocess" : id } ,
18481864 { "name" : "createindex_statement$ebnf$4" , "symbols" : [ ] , "postprocess" : ( ) => null } ,
1849- { "name" : "createindex_statement$ebnf$5" , "symbols" : [ "createindex_with" ] , "postprocess" : id } ,
1865+ { "name" : "createindex_statement$ebnf$5$subexpression$1" , "symbols" : [ ( lexerAny . has ( "kw_using" ) ? { type : "kw_using" } : kw_using ) , "ident" ] , "postprocess" : last } ,
1866+ { "name" : "createindex_statement$ebnf$5" , "symbols" : [ "createindex_statement$ebnf$5$subexpression$1" ] , "postprocess" : id } ,
18501867 { "name" : "createindex_statement$ebnf$5" , "symbols" : [ ] , "postprocess" : ( ) => null } ,
1851- { "name" : "createindex_statement$ebnf$6" , "symbols" : [ "createindex_tblspace " ] , "postprocess" : id } ,
1868+ { "name" : "createindex_statement$ebnf$6" , "symbols" : [ "createindex_with " ] , "postprocess" : id } ,
18521869 { "name" : "createindex_statement$ebnf$6" , "symbols" : [ ] , "postprocess" : ( ) => null } ,
1853- { "name" : "createindex_statement$ebnf$7" , "symbols" : [ "createindex_predicate " ] , "postprocess" : id } ,
1870+ { "name" : "createindex_statement$ebnf$7" , "symbols" : [ "createindex_tblspace " ] , "postprocess" : id } ,
18541871 { "name" : "createindex_statement$ebnf$7" , "symbols" : [ ] , "postprocess" : ( ) => null } ,
1855- { "name" : "createindex_statement" , "symbols" : [ ( lexerAny . has ( "kw_create" ) ? { type : "kw_create" } : kw_create ) , "createindex_statement$ebnf$1" , "kw_index" , "createindex_statement$ebnf$2" , "createindex_statement$ebnf$3" , ( lexerAny . has ( "kw_on" ) ? { type : "kw_on" } : kw_on ) , "table_ref" , "createindex_statement$ebnf$4" , "lparen" , "createindex_expressions" , "rparen" , "createindex_statement$ebnf$5" , "createindex_statement$ebnf$6" , "createindex_statement$ebnf$7" ] , "postprocess" : x => track ( x , {
1872+ { "name" : "createindex_statement$ebnf$8" , "symbols" : [ "createindex_predicate" ] , "postprocess" : id } ,
1873+ { "name" : "createindex_statement$ebnf$8" , "symbols" : [ ] , "postprocess" : ( ) => null } ,
1874+ { "name" : "createindex_statement" , "symbols" : [ ( lexerAny . has ( "kw_create" ) ? { type : "kw_create" } : kw_create ) , "createindex_statement$ebnf$1" , "kw_index" , "createindex_statement$ebnf$2" , "createindex_statement$ebnf$3" , "createindex_statement$ebnf$4" , ( lexerAny . has ( "kw_on" ) ? { type : "kw_on" } : kw_on ) , "table_ref" , "createindex_statement$ebnf$5" , "lparen" , "createindex_expressions" , "rparen" , "createindex_statement$ebnf$6" , "createindex_statement$ebnf$7" , "createindex_statement$ebnf$8" ] , "postprocess" : x => track ( x , {
18561875 type : 'create index' ,
18571876 ...x [ 1 ] && { unique : true } ,
1858- ...x [ 3 ] && { ifNotExists : true } ,
1859- ...x [ 4 ] && { indexName : asName ( x [ 4 ] ) } ,
1860- table : x [ 6 ] ,
1861- ...x [ 7 ] && { using : asName ( x [ 7 ] ) } ,
1862- expressions : x [ 9 ] ,
1863- ...x [ 11 ] && { with : x [ 11 ] } ,
1864- ...x [ 12 ] && { tablespace : unwrap ( x [ 12 ] ) } ,
1865- ...x [ 13 ] && { where : unwrap ( x [ 13 ] ) } ,
1877+ ...x [ 3 ] && { concurrently : true } ,
1878+ ...x [ 4 ] && { ifNotExists : true } ,
1879+ ...x [ 5 ] && { indexName : asName ( x [ 5 ] ) } ,
1880+ table : x [ 7 ] ,
1881+ ...x [ 8 ] && { using : asName ( x [ 8 ] ) } ,
1882+ expressions : x [ 10 ] ,
1883+ ...x [ 12 ] && { with : x [ 12 ] } ,
1884+ ...x [ 13 ] && { tablespace : unwrap ( x [ 13 ] ) } ,
1885+ ...x [ 14 ] && { where : unwrap ( x [ 14 ] ) } ,
18661886 } ) } ,
18671887 { "name" : "createindex_expressions$ebnf$1" , "symbols" : [ ] } ,
18681888 { "name" : "createindex_expressions$ebnf$1$subexpression$1" , "symbols" : [ "comma" , "createindex_expression" ] , "postprocess" : last } ,
@@ -2564,6 +2584,27 @@ const grammar: Grammar = {
25642584 ...x [ 2 ] ? { collate : x [ 2 ] [ 1 ] } : { } ,
25652585 } )
25662586 } } ,
2587+ { "name" : "altertype_statement$subexpression$1" , "symbols" : [ "altertype_enum_add_value" ] } ,
2588+ { "name" : "altertype_statement$subexpression$1" , "symbols" : [ "altertype_enum_rename" ] } ,
2589+ { "name" : "altertype_statement" , "symbols" : [ "kw_alter" , "kw_type" , "qualified_name" , "altertype_statement$subexpression$1" ] , "postprocess" : x => track ( x , {
2590+ name : x [ 2 ] ,
2591+ ...unwrap ( x [ 3 ] ) ,
2592+ } ) } ,
2593+ { "name" : "altertype_enum_add_value" , "symbols" : [ "kw_add" , "kw_value" , "enum_additional_value" ] , "postprocess" : x => track ( x , {
2594+ type : 'alter enum' ,
2595+ change : {
2596+ type : 'add value' ,
2597+ add : x [ 2 ]
2598+ }
2599+ } ) } ,
2600+ { "name" : "enum_additional_value" , "symbols" : [ "string" ] , "postprocess" : x => track ( x , { value : toStr ( x ) } ) } ,
2601+ { "name" : "altertype_enum_rename" , "symbols" : [ "kw_rename" , ( lexerAny . has ( "kw_to" ) ? { type : "kw_to" } : kw_to ) , "word" ] , "postprocess" : x => track ( x , {
2602+ type : 'alter enum' ,
2603+ change : {
2604+ type : 'rename' ,
2605+ to : asName ( last ( x ) )
2606+ }
2607+ } ) } ,
25672608 { "name" : "union_left" , "symbols" : [ "select_statement" ] } ,
25682609 { "name" : "union_left" , "symbols" : [ "select_values" ] } ,
25692610 { "name" : "union_left" , "symbols" : [ "selection_paren" ] } ,
@@ -2865,6 +2906,7 @@ const grammar: Grammar = {
28652906 { "name" : "statement_noprep" , "symbols" : [ "alter_sequence_statement" ] } ,
28662907 { "name" : "statement_noprep" , "symbols" : [ "drop_statement" ] } ,
28672908 { "name" : "statement_noprep" , "symbols" : [ "createtype_statement" ] } ,
2909+ { "name" : "statement_noprep" , "symbols" : [ "altertype_statement" ] } ,
28682910 { "name" : "statement_noprep" , "symbols" : [ "create_view_statements" ] } ,
28692911 { "name" : "statement_noprep" , "symbols" : [ "refresh_view_statements" ] } ,
28702912 { "name" : "statement_noprep" , "symbols" : [ "create_schema" ] } ,
0 commit comments