Expand description
SQL:1999 Parser crate.
Provides tokenization and parsing of SQL statements into the shared AST.
§Arena-allocated Parser
For performance-critical code paths, the arena_parser module provides
an arena-based parser that allocates AST nodes from a bump allocator.
§Arena Fallback Parsing
The parse_with_arena_fallback function provides optimized parsing by
using arena allocation for supported statement types (SELECT) while falling
back to standard heap allocation for other statements. This provides the
best of both worlds: arena performance where it helps most (complex queries)
and full feature support for all SQL statements.
use vibesql_parser::parse_with_arena_fallback;
let stmt = parse_with_arena_fallback("SELECT * FROM users").unwrap();
// Uses arena parsing internally, converts to standard StatementModules§
- arena_
parser - Arena-allocated SQL parser.
Structs§
- Lexer
- SQL Lexer - converts SQL text into tokens.
- Lexer
Error - Lexer error returned when tokenization fails.
- Parse
Error - Parser error
- Parser
- SQL Parser - converts tokens into AST
- Span
- Byte range span in the source text.
Enums§
Functions§
- parse_
with_ arena_ fallback - Parse SQL using arena allocation where supported, falling back to standard parsing.