nene/sql-parser-cst

Postgres support (queries)

nene opened this issue · 0 comments

nene commented

SELECT syntax

  • WITH clause
    • [NOT] MATERIALIZED
    • ( select | values | insert | update | delete ) in addition to just select
    • SEARCH {BREADTH | DEPTH} FIRST BY column_name [, ...] SET search_seq_col_name
    • CYCLE col [, ...] SET cycle_mark_col [TO cycle_mark_value DEFAULT cycle_mark_default] USING cycle_path_col
  • SELECT clause
    • DISTINCT ON (...)
    • empty select (no columns)
  • INTO clause
    • [TEMPORARY | TEMP | UNLOGGED] [TABLE] tablename
  • FROM clause
    • ONLY tablename
    • tablename *
    • AS alias (col1_alias, col2_alias, ...)
    • TABLESAMPLE sampling_method (...) [ REPEATABLE (seed) ]
    • LATERAL (select)
    • LATERAL table_func(..)
    • LATERAL ROWS FROM(..)
    • table function call
    • func(...) WITH ORDINALITY
    • func(...) AS (column_definition, ...)
    • basic ROWS FROM ( func(), ... )
    • ROWS FROM ( func() AS (column_definition, ... ), ... )
    • ROWS FROM ( ... ) [WITH ORDINALITY]
  • GROUP BY clause
    • ALL | DISTINCT
    • ( )
    • (expr1, expr2, ...)
    • ROLLUP (...)
    • CUBE (...)
    • GROUPING SETS (...)
  • WINDOW clause
  • ORDER BY
    • USING operator
    • NULLS {FIRST | LAST}
  • limiting
    • LIMIT count
    • LIMIT ALL
    • OFFSET start [ ROW | ROWS ]
    • FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } { ONLY | WITH TIES }
  • FOR clause
    • FOR { UPDATE | NO KEY UPDATE | SHARE | KEY SHARE }
    • OF table_name [, ...]
    • NOWAIT | SKIP LOCKED
  • TABLE clause
    • TABLE ONLY
    • table_name *
    • preceded by WITH
    • in UNION / INTERSECT / EXCEPT
    • followed by ORDER BY, LIMIT, OFFSET, FETCH
    • followed by FOR
  • VALUES clause
    • separate VALUES statement
    • Followed by ORDER BY, LIMIT, OFFSET, FETCH