@@ -979,7 +979,6 @@ module.exports = grammar({
979979 $ . table_partition ,
980980 $ . stored_as ,
981981 $ . storage_location ,
982- $ . table_sort ,
983982 $ . row_format ,
984983 seq ( $ . keyword_tblproperties , paren_list ( $ . table_option , true ) ) ,
985984 seq ( $ . keyword_without , $ . keyword_oids ) ,
@@ -2551,10 +2550,6 @@ module.exports = grammar({
25512550 )
25522551 ) ,
25532552
2554- // todo(@juleswritescode): does this exist in postgresql?
2555- table_sort : ( $ ) =>
2556- seq ( $ . keyword_sort , $ . keyword_by , paren_list ( $ . any_identifier , true ) ) ,
2557-
25582553 table_partition : ( $ ) =>
25592554 seq (
25602555 choice (
@@ -2627,12 +2622,7 @@ module.exports = grammar({
26272622 ) ,
26282623
26292624 column_definitions : ( $ ) =>
2630- seq (
2631- "(" ,
2632- comma_list ( $ . column_definition , true ) ,
2633- optional ( $ . constraints ) ,
2634- ")"
2635- ) ,
2625+ seq ( "(" , comma_list ( $ . column_definition , true ) , ")" ) ,
26362626
26372627 column_definition : ( $ ) =>
26382628 seq (
@@ -2663,8 +2653,7 @@ module.exports = grammar({
26632653 seq (
26642654 $ . keyword_set ,
26652655 choice ( $ . keyword_null , $ . keyword_default ) ,
2666- // todo(@juleswritescode): are these columns?
2667- optional ( paren_list ( $ . any_identifier , true ) )
2656+ optional ( paren_list ( $ . mentioned_column_identifier , true ) )
26682657 )
26692658 )
26702659 )
@@ -2708,16 +2697,6 @@ module.exports = grammar({
27082697 alias ( $ . implicit_cast , $ . cast )
27092698 ) ,
27102699
2711- constraints : ( $ ) => seq ( "," , $ . constraint , repeat ( seq ( "," , $ . constraint ) ) ) ,
2712-
2713- constraint : ( $ ) =>
2714- choice (
2715- $ . _constraint_literal ,
2716- $ . _key_constraint ,
2717- $ . _primary_key_constraint ,
2718- $ . _check_constraint
2719- ) ,
2720-
27212700 _constraint_literal : ( $ ) =>
27222701 seq (
27232702 $ . keyword_constraint ,
@@ -2727,59 +2706,6 @@ module.exports = grammar({
27272706
27282707 _primary_key_constraint : ( $ ) => seq ( $ . _primary_key , $ . ordered_columns ) ,
27292708
2730- _key_constraint : ( $ ) =>
2731- seq (
2732- choice (
2733- seq (
2734- $ . keyword_unique ,
2735- optional (
2736- choice (
2737- $ . keyword_index ,
2738- $ . keyword_key ,
2739- seq (
2740- $ . keyword_nulls ,
2741- optional ( $ . keyword_not ) ,
2742- $ . keyword_distinct
2743- )
2744- )
2745- )
2746- ) ,
2747- seq (
2748- optional ( $ . keyword_foreign ) ,
2749- $ . keyword_key ,
2750- optional ( $ . _if_not_exists )
2751- ) ,
2752- $ . keyword_index
2753- ) ,
2754- optional ( field ( "name" , $ . any_identifier ) ) ,
2755- $ . ordered_columns ,
2756- optional (
2757- seq (
2758- $ . keyword_references ,
2759- $ . object_reference ,
2760- // todo(@juleswritescode): are these columns?
2761- paren_list ( $ . any_identifier , true ) ,
2762- repeat (
2763- seq (
2764- $ . keyword_on ,
2765- choice ( $ . keyword_delete , $ . keyword_update ) ,
2766- choice (
2767- seq ( $ . keyword_no , $ . keyword_action ) ,
2768- $ . keyword_restrict ,
2769- $ . keyword_cascade ,
2770- seq (
2771- $ . keyword_set ,
2772- choice ( $ . keyword_null , $ . keyword_default ) ,
2773- // todo(@juleswritescode): are these columns?
2774- optional ( paren_list ( $ . any_identifier , true ) )
2775- )
2776- )
2777- )
2778- )
2779- )
2780- )
2781- ) ,
2782-
27832709 ordered_columns : ( $ ) => paren_list ( alias ( $ . ordered_column , $ . column ) , true ) ,
27842710
27852711 ordered_column : ( $ ) => seq ( field ( "name" , $ . _column ) , optional ( $ . direction ) ) ,
@@ -3042,7 +2968,6 @@ module.exports = grammar({
30422968 seq (
30432969 $ . keyword_as ,
30442970 field ( "alias" , $ . any_identifier ) ,
3045- // todo(@juleswritescode): are these columns?
30462971 paren_list ( $ . any_identifier , false )
30472972 )
30482973 )
@@ -3517,6 +3442,7 @@ module.exports = grammar({
35173442
35183443 any_identifier : ( $ ) => $ . _any_identifier ,
35193444 column_identifier : ( $ ) => $ . _any_identifier ,
3445+ mentioned_column_identifier : ( $ ) => $ . _any_identifier ,
35203446
35213447 _any_identifier : ( $ ) =>
35223448 choice (
0 commit comments