Skip to main content

Crate hawdb_sql_syntax

Crate hawdb_sql_syntax 

Source
Expand description

HawDB-owned PostgreSQL SQL/PGQ syntax frontend.

This crate owns tokens, byte spans, structured syntax errors, and syntax ASTs. Statement envelopes use a bounded token PEG with packrat memoization, composed SQL/PGQ rules, and transformation into the existing syntax AST. Expressions and graph patterns are recognized by PEG rules. Semantic binding and logical-plan lowering belong to hawdb-sql. The internal PEG machinery is also reused by hawdb-cypher, with its own lexer and PEG grammar; SQL tokenization rules do not apply to Cypher.

Database::query_sql* selects the relational PEG entry for SELECT and EXPLAIN SELECT. Relational DDL/DML import the same PEG expression rules and lower directly into HawDB IR. PGQ syntax acceptance alone does not qualify a statement family for production execution.

The SQL/PGQ specification defines the compatibility contract. The implementation and routing checklist tracks the remaining parser/binder differential coverage, catalog durability, and shared query-pipeline qualification required before enabling production routing. Parser selection must be explicit by statement family, never a retry after another parser fails.

Structs§

CreatePropertyGraph
EdgeEndpoint
EdgeTableDefinition
ElementExposure
ElementLabelExposure
ExpressionSyntax
GraphEdgePatternSyntax
GraphElementPatternSyntax
GraphPathFactorSyntax
GraphPathSyntax
GraphPatternQuantifier
GraphPatternSyntax
GraphTable
GraphTableColumn
Identifier
LabeledExpressionSyntax
LexerConfig
LockingClauseSyntax
OrderBySyntax
PostgresFromSyntax
PostgresJoinSyntax
PostgresSelectSyntax
QualifiedName
RelationTableSyntax
Span
SyntaxError
TableAlias
TableFunctionArgumentSyntax
Token
VertexTableDefinition

Enums§

BinaryOperatorSyntax
ElementLabel
ExpressionKindSyntax
GraphEdgeDirection
GraphPathPrimarySyntax
LiteralSyntax
LockStrengthSyntax
NullOrderSyntax
OrderDirectionSyntax
PgqStatement
PostgresFromItemSyntax
PostgresJoinKind
PostgresStatementSyntax
PropertyExposure
RelationalStatementSyntax
SyntaxErrorCode
TokenKind
UnaryOperatorSyntax

Functions§

first_token
Reads only the first non-comment token for explicit statement-family dispatch. The rest of the input is validated by the selected parser. The full-input byte limit applies to complete tokenization, not to statement dispatch.
parse_graph_table
parse_pgq_statement
parse_postgres_select
parse_postgres_statement
parse_relational_statement
Parses the executable relational SELECT and EXPLAIN SELECT families.
tokenize
tokenize_with_config