Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

式サポート #120

Draft
wants to merge 6 commits into
base: replace-parser-p
Choose a base branch
from
Draft

式サポート #120

wants to merge 6 commits into from

Conversation

lemonadern
Copy link
Collaborator

@lemonadern lemonadern commented Jan 31, 2025

ここで言う式とは、PostgreSQL の文法で 式として扱われているもののこと

c_expr

  • columnref
    • IDENT (シンプルな列名) b6e3f89
    • IDENT indirection
      • フィールドアクセス (e.g. a.b.c, a.*
      • 配列アクセス (e.g. a[1], a[1:4])
        • memo: tree-sitter-sql は非対応
  • AexprConst f783604, 4627c0b
    • Iconst (ICONST)
    • FCONST
    • Sconst (SCONST)
    • BCONST
    • XCONST
    • func_name Sconst
      • 型付きリテラル (e.g. complex_type '(1,2)
      • カスタム型はこちら、 date, time, interval 等の PostgreSQL組み込み型は ConstTypeName, ConstInterval で処理される
      • memo: 型付きリテラル系の構文はすべて tree-sitter-sql で非対応
    • func_name '(' func_arg_list opt_sort_clause ')' Sconst
      • type modifier 付きの型付きリテラル
      • varchar(50) 'hello'
    • ConstTypename Sconst
      • 組み込み型に対する型キャスト (timestamp, date, time)
      • timestamp 2024-03-21 12:34:56
    • ConstInterval Sconst opt_interval
      • interval
      • interval '3 days' (opt_interval なし)
      • interval '3' day (opt_interval あり)
    • ConstInterval '(' Iconst ')' Sconst
      • 精度指定つき interval
      • interval(3) '1.123 seconds'
    • TRUE_P
    • FALSE_P
    • NULL_P
  • PARAM opt_indirection
  • '(' a_expr ')' opt_indirection
  • case_expr
  • func_expr
    • 関数呼び出しの構文
    • window function や filter を含む
    • func_application
  • select_with_parens
  • select_with_parens indirection
  • EXISTS select_with_parens
  • ARRAY select_with_parens
  • ARRAY array_expr
  • explicit_row
  • implicit_row
  • GROUPING '(' expr_list ')'

b_expr

  • c_expr
  • b_expr TYPECAST Typename
  • '+' b_expr
  • '-' b_expr
  • b_expr '+' b_expr
  • b_expr '-' b_expr
  • b_expr '*' b_expr
  • b_expr '/' b_expr
  • b_expr '%' b_expr
  • b_expr '^' b_expr
  • b_expr '<' b_expr
  • b_expr '>' b_expr
  • b_expr '=' b_expr
  • b_expr LESS_EQUALS b_expr
  • b_expr GREATER_EQUALS b_expr
  • b_expr NOT_EQUALS b_expr
  • b_expr qual_Op b_expr
  • qual_Op b_expr
  • b_expr IS DISTINCT FROM b_expr
  • b_expr IS NOT DISTINCT FROM b_expr
  • b_expr IS DOCUMENT_P
  • b_expr IS NOT DOCUMENT_P

a_expr

  • c_expr
  • a_expr TYPECAST Typename
  • a_expr COLLATE any_name
  • a_expr AT TIME ZONE a_expr
  • a_expr AT LOCAL
  • '+' a_expr
  • '-' a_expr
  • a_expr '+' a_expr
  • a_expr '-' a_expr
  • a_expr '*' a_expr
  • a_expr '/' a_expr
  • a_expr '%' a_expr
  • a_expr '^' a_expr
  • a_expr '<' a_expr
  • a_expr '>' a_expr
  • a_expr '=' a_expr
  • a_expr LESS_EQUALS a_expr
  • a_expr GREATER_EQUALS a_expr
  • a_expr NOT_EQUALS a_expr
  • a_expr qual_Op a_expr
  • qual_Op a_expr
  • a_expr AND a_expr
  • a_expr OR a_expr
  • NOT a_expr
  • NOT_LA a_expr
  • a_expr LIKE a_expr
  • a_expr LIKE a_expr ESCAPE a_expr
  • a_expr NOT_LA LIKE a_expr
  • a_expr NOT_LA LIKE a_expr ESCAPE a_expr
  • a_expr ILIKE a_expr
  • a_expr ILIKE a_expr ESCAPE a_expr
  • a_expr NOT_LA ILIKE a_expr
  • a_expr NOT_LA ILIKE a_expr ESCAPE a_expr
  • a_expr SIMILAR TO a_expr
  • a_expr SIMILAR TO a_expr ESCAPE a_expr
  • a_expr NOT_LA SIMILAR TO a_expr
  • a_expr NOT_LA SIMILAR TO a_expr ESCAPE a_expr
  • a_expr IS NULL_P
  • a_expr ISNULL
  • a_expr IS NOT NULL_P
  • a_expr NOTNULL
  • row OVERLAPS row
  • a_expr IS TRUE_P
  • a_expr IS NOT TRUE_P
  • a_expr IS FALSE_P
  • a_expr IS NOT FALSE_P
  • a_expr IS UNKNOWN
  • a_expr IS NOT UNKNOWN
  • a_expr IS DISTINCT FROM a_expr
  • a_expr IS NOT DISTINCT FROM a_expr
  • a_expr BETWEEN opt_asymmetric b_expr AND a_expr
  • a_expr NOT_LA BETWEEN opt_asymmetric b_expr AND a_expr
  • a_expr BETWEEN SYMMETRIC b_expr AND a_expr
  • a_expr NOT_LA BETWEEN SYMMETRIC b_expr AND a_expr
  • a_expr IN_P in_expr
  • a_expr NOT_LA IN_P in_expr
  • a_expr subquery_Op sub_type select_with_parens
  • a_expr subquery_Op sub_type '(' a_expr ')'
  • UNIQUE opt_unique_null_treatment select_with_parens
  • a_expr IS DOCUMENT_P
  • a_expr IS NOT DOCUMENT_P
  • a_expr IS NORMALIZED
  • a_expr IS unicode_normal_form NORMALIZED
  • a_expr IS NOT NORMALIZED
  • a_expr IS NOT unicode_normal_form NORMALIZED
  • a_expr IS json_predicate_type_constraint json_key_uniqueness_constraint_opt
  • a_expr IS NOT json_predicate_type_constraint json_key_uniqueness_constraint_opt
  • DEFAULT

@lemonadern lemonadern reopened this Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant