Module arena_parser

Module arena_parser 

Source
Expand description

Arena-allocated SQL parser.

This module provides a parser that allocates AST nodes from a bump arena for improved performance. All allocations are contiguous in memory and freed in a single operation when the arena is dropped.

§Usage

For arena-allocated AST (fastest, but requires arena lifetime management):

use bumpalo::Bump;
use vibesql_parser::arena_parser::ArenaParser;

let arena = Bump::new();
let result = ArenaParser::parse_sql("SELECT * FROM users", &arena);

For standard heap-allocated AST (convenient, with arena parsing benefits):

use vibesql_parser::arena_parser::parse_select_to_owned;

// Parse with arena internally, convert to owned SelectStmt
let stmt = parse_select_to_owned("SELECT * FROM users").unwrap();

Structs§

ArenaParser
Arena-based SQL parser.

Functions§

parse_delete_to_owned
Parse DELETE SQL and return a heap-allocated (owned) DeleteStmt.
parse_expression_to_owned
Parse an expression and return a heap-allocated (owned) Expression.
parse_insert_to_owned
Parse INSERT SQL and return a heap-allocated (owned) InsertStmt.
parse_select_to_owned
Parse SQL and return a heap-allocated (owned) SelectStmt.
parse_update_to_owned
Parse UPDATE SQL and return a heap-allocated (owned) UpdateStmt.