Crate partiql_parser

Source
Expand description

Provides a parser for the PartiQL query language.

§Usage

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)`");

Structs§

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

Type Aliases§

LexicalError
std::error::Error type for errors in the lexical structure for the PartiQL parser.
ParseError
std::error::Error type for errors in the syntactic structure for the PartiQL parser.
ParserResult
General Result type for the PartiQL Parser.