Skip to content

Commit

Permalink
fix: types definition
Browse files Browse the repository at this point in the history
  • Loading branch information
taozhi8833998 committed May 8, 2024
1 parent 7d065a2 commit 77db53a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions ast/postgresql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1145,6 +1145,10 @@ export type column_ref_array_index = column_ref;

export type primary = cast_expr | or_and_where_expr | var_decl | { type: 'origin'; value: string; };

export type unary_expr_or_primary = primary | unary_expr;

export type unary_operator = "!" | "-" | "+" | "~";

export type string_constants_escape = { type: 'origin'; value: string; };


Expand Down Expand Up @@ -1246,7 +1250,7 @@ type KW_SUM_MAX_MIN_AVG = never;

export type aggr_fun_count = { type: 'aggr_func'; name: 'COUNT' | 'GROUP_CONCAT'; args:count_arg; over: over_partition } | { type: 'aggr_func'; name: 'PERCENTILE_CONT' | 'PERCENTILE_DISC'; args: literal_numeric | literal_array; within_group_orderby: order_by_clause; over?: over_partition } | { type: 'aggr_func'; name: 'MODE'; args: literal_numeric | literal_array; within_group_orderby: order_by_clause; over?: over_partition };

export type concat_separator = { keyword: string | null; value: literal_string; };
export type concat_separator = { symbol: ','; delimiter: literal_string; };



Expand All @@ -1258,7 +1262,7 @@ export type distinct_args = { distinct: 'DISTINCT'; expr: expr; orderby?: order_

export type count_arg = { expr: star_expr } | distinct_args;

export type aggr_array_agg = { type: 'aggr_func'; args:count_arg; name: 'ARRAY_AGG'; orderby?: order_by_clause };
export type aggr_array_agg = { type: 'aggr_func'; args:count_arg; name: 'ARRAY_AGG' | 'STRING_AGG'; };



Expand Down Expand Up @@ -1503,6 +1507,8 @@ type KW_ARRAY = never;

type KW_ARRAY_AGG = never;

type KW_STRING_AGG = never;

type KW_COUNT = never;

type KW_GROUP_CONCAT = never;
Expand Down
2 changes: 1 addition & 1 deletion pegjs/postgresql.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -4121,7 +4121,7 @@ primary
unary_expr_or_primary
= primary
/ op:(unary_operator) tail:(__ unary_expr_or_primary) {
// if (op === '!') op = 'NOT'
// => unary_expr
return createUnaryExpr(op, tail[1])
}

Expand Down

0 comments on commit 77db53a

Please sign in to comment.