Module parser

Source
Expand description

SQL Parser

MacrosΒ§

maybe πŸ”’
parser_err πŸ”’

StructsΒ§

Parser πŸ”’
SQL Parser
ParserError
ParserStatementError
StatementParseResult
The result of successfully parsing a statement: both the AST and the SQL text that it corresponds to

EnumsΒ§

IsLateral πŸ”’
IsOptional πŸ”’
ParenthesizedFragment πŸ”’
Represents an expression or query (a β€œfragment”) with parentheses around it, when it is unknown whether the fragment belongs to a larger expression or query.
Precedence πŸ”’
Defines a number of precedence classes operators follow. Since this enum derives Ord, the precedence classes are ordered from weakest binding at the top to tightest binding at the bottom.
SetPrecedence πŸ”’

ConstantsΒ§

ANY_ALL_KEYWORDS πŸ”’
Keywords that indicate the start of an ANY or ALL subquery operation.
MAX_STATEMENT_BATCH_SIZE
Maximum allowed size for a batch of statements in bytes: 1MB.
QUERY_START_KEYWORDS πŸ”’
Keywords that indicate the start of a (sub)query.
RECURSION_LIMIT πŸ”’

TraitsΒ§

ParserStatementErrorMapper πŸ”’

FunctionsΒ§

parse_data_type
Parses a SQL string containing a single data type.
parse_expr
Parses a SQL string containing one SQL expression.
parse_statements
Parses a SQL string containing zero or more SQL statements.
parse_statements_with_limit
Parses a SQL string containing zero or more SQL statements. Statements larger than MAX_STATEMENT_BATCH_SIZE are rejected.
split_identifier_string
Parses a string containing a comma-separated list of identifiers and returns their underlying string values.