risinglight 0.2.0

An OLAP database system for educational purpose
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Copyright 2022 RisingLight Project Authors. Licensed under Apache-2.0.

//! The parser module directly uses the [`sqlparser`] crate
//! and re-exports its AST types.

pub use sqlparser::ast::*;
use sqlparser::dialect::PostgreSqlDialect;
use sqlparser::parser::Parser;
pub use sqlparser::parser::ParserError;

/// Parse the SQL string into a list of ASTs.
pub fn parse(sql: &str) -> Result<Vec<Statement>, ParserError> {
    let dialect = PostgreSqlDialect {};
    Parser::parse_sql(&dialect, sql)
}