Skip to main content

parse_statement_list

Function parse_statement_list 

Source
fn parse_statement_list<T>(
    sql_statements: &[String],
    parser: fn(Statement<Raw>) -> Result<T, ()>,
) -> Result<Vec<T>, ()>
Expand description

Parse a list of SQL strings and downcast each to a specific statement type.

Each string is parsed via parse_one_statement, then passed through parser to extract the expected AST variant (e.g., CreateIndexStatement). Returns Err(()) if any string fails to parse or has the wrong statement type.