Crate partiql_parser

source ·
Expand description

Provides a parser for the PartiQL query language.


use partiql_parser::{Parser, ParserError, ParserResult};

let parser = Parser::default();

let parsed = parser.parse("SELECT g FROM data GROUP BY a").expect("successful parse");

let errs: ParserError = parser.parse("SELECT").expect_err("expected error");

let errs_at: ParserError =
    parser.parse("SELECT * FROM a AY a CROSS JOIN c AS c AT q").unwrap_err();
assert_eq!(errs_at.errors[0].to_string(), "Unexpected token `<a:UNQUOTED_IDENT>` at `(b19..b20)`");


  • The output of parsing PartiQL statement strings: an AST and auxiliary data.
  • A PartiQL parser from statement strings to AST.
  • The output of errors when parsing PartiQL statement strings: an errors and auxiliary data.

Type Definitions