Crate vibesql_parser

Crate vibesql_parser 

Source
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 Statement

Modules§

arena_parser
Arena-allocated SQL parser.

Structs§

Lexer
SQL Lexer - converts SQL text into tokens.
LexerError
Lexer error returned when tokenization fails.
ParseError
Parser error
Parser
SQL Parser - converts tokens into AST
Span
Byte range span in the source text.

Enums§

Keyword
SQL Keywords supported by the parser.
Token
SQL Token produced by the lexer.

Functions§

parse_with_arena_fallback
Parse SQL using arena allocation where supported, falling back to standard parsing.