| sql_parse | R Documentation |
Parse SQL into an abstract syntax tree
sql_parse(sql, dialect = "generic")
sql |
A single character string with one or more SQL statements
(separated by |
dialect |
Dialect used for parsing. |
A polyglot_ast object: a list with elements
statements — a list with one nested-list AST per statement;
sql — the input SQL;
dialect — the dialect used.
Each AST node is a named list; the name of the outer element gives the
node kind (e.g. "select"). The structure follows the upstream
polyglot-sql JSON AST format and round-trips through sql_generate().
ast <- sql_parse("SELECT a, b FROM t WHERE x = 1")
ast
names(ast$statements[[1]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.