Expand description
Deterministic SQL printer for the syntax tree.
to_sql and query_to_sql print clause per line with two-space indentation;
to_sql_compact and expr_to_sql print on one line. Parsing printed SQL gives back an
equal tree: parentheses are added only where precedence needs them, and every parenthesis the
source had is kept as an Expr::Nested.
Functionsยง
- data_
type_ to_ sql - A data type (
ARRAY<STRUCT<a INT64>>). - expr_
to_ sql - An expression on one line.
- ident_
to_ sql - An identifier as GoogleSQL needs it written: quoted when it was, or when it must be.
- object_
name_ to_ sql - A dotted name.
- query_
to_ sql - A query, laid out clause per line.
- query_
to_ sql_ compact - A query on one line.
- row_
pattern - A
MATCH_RECOGNIZEpattern as written: alternation binds loosest, then concatenation, then quantifiers. - statements_
to_ sql - Statements separated by
;and a blank line, ending with;. - table_
factor_ to_ sql - A table factor on one line (
`p.d.t` AS x). - to_sql
- A statement, laid out clause per line.
- to_
sql_ compact - A statement on one line.