sqlparser

    Extensible SQL Lexer and Parser in MoonBit

    sql
    parser
    lexer
    Download zip
    Version
    0.5.1
    License
    Apache-2.0
    Last updated
    13 days ago
    Downloads
    33

    #Extensible SQL Lexer and Parser for MoonBit

    A comprehensive SQL parser library for MoonBit that supports multiple SQL dialects and all major SQL language categories.

    #Example Usage

    // Parse a simple SELECT statement let sql = "SELECT name, age FROM users WHERE age > 18" let statements = parse_sql(sql) let pretty_output = statements.stmts[0] |> pretty_print println(pretty_output) // Parse complex queries with CTEs let complex_sql = """ WITH sales AS ( SELECT user_id, SUM(amount) as total FROM orders WHERE date > '2023-01-01' GROUP BY user_id ) SELECT u.name, s.total FROM users u JOIN sales s ON u.id = s.user_id ORDER BY s.total DESC LIMIT 10 """ let result = parse_sql(complex_sql) // Parse transaction control statements let tcl_sql = "BEGIN TRANSACTION; INSERT INTO users VALUES ('Alice'); COMMIT;" let tcl_statements = parse_sql(tcl_sql) // Parse data control statements let dcl_sql = "GRANT SELECT, INSERT ON users TO alice WITH GRANT OPTION" let dcl_result = parse_sql(dcl_sql) // Dialect-specific parsing let mysql_sql = "SHOW TABLES LIKE 'user%'" let mysql_result = parse_sql(dialect=MySQL::{}, mysql_sql)

    #Architecture

    The parser follows a modular design:

    • Lexer (lexer.mbt): Tokenizes SQL input with dialect-aware keyword recognition
    • Parser (parser.mbt): Main parsing logic with statement dispatching
    • AST (ast.mbt): Complete Abstract Syntax Tree definitions with pretty printing
    • Dialect Modules: Separate modules for each SQL dialect (mysql.mbt, postgres.mbt, etc.)
    • Language Modules:
      • dml.mbt: Data Manipulation Language parsing
      • ddl.mbt: Data Definition Language parsing
      • tcl.mbt: Transaction Control Language parsing
      • dcl.mbt: Data Control Language parsing

    #Testing

    The library includes comprehensive test coverage with 284+ tests covering:

    • All SQL statement types across all language categories
    • Dialect-specific features and syntax variations
    • Complex expressions and nested queries
    • Edge cases and error handling
    • Pretty printing accuracy

    Run tests with:
    moon test

    #Contributing

    The parser is designed for extensibility. To add new SQL features:

    1. Add keywords to keyword.mbt and lexer.mbt
    2. Define AST structures in ast.mbt
    3. Implement parsing logic in appropriate language module
    4. Add statement cases to parser.mbt

    #Contributing

    The parser is designed for extensibility. To add new SQL features:

    1. Add keywords to keyword.mbt and lexer.mbt
    2. Define AST structures in ast.mbt
    3. Implement parsing logic in appropriate language module
    4. Add statement cases to parser.mbt
    5. Write comprehensive tests

    See ROADMAP.md for planned features and implementation priorities.

    #License

    This project is licensed under the Apache 2.0 License.

    Dialect

    pub trait Dialect {
    fn supports_string_literal_backslash_escape(Self) -> Bool
    fn supports_boolean_literals(Self) -> Bool
    fn supports_filter_during_aggregation(Self) -> Bool
    fn supports_within_after_array_aggregation(Self) -> Bool
    fn requires_column_types_in_create_table(Self) -> Bool
    fn supports_if_not_exists(Self) -> Bool
    fn supports_double_quoted_identifiers(Self) -> Bool
    fn supports_array_syntax(Self) -> Bool
    fn supports_named_parameters(Self) -> Bool
    fn parse_expr(Self, tokens : ArrayView[Token]) -> (Expr, ArrayView[Token])? raise ParserError
    fn parse_statement(Self, parser : Parser, tokens : ArrayView[Token]) -> (Statement, ArrayView[Token])? raise ParserError
    fn read_keyword(Self, word : String) -> Keyword?
    }

    LexerError

    type LexerError derive(
    Debug
    )

    impl Show for LexerError

    LexerError::output

    fn LexerError::output(self : LexerError, logger : &Logger) -> Unit

    LexerError::to_string

    fn LexerError::to_string(self : LexerError) -> String

    ParserError

    type ParserError derive(
    Debug
    )

    impl Show for ParserError

    ParserError::output

    fn ParserError::output(self : ParserError, logger : &Logger) -> Unit

    ParserError::to_string

    fn ParserError::to_string(self : ParserError) -> String

    SqlParserError

    pub suberror SqlParserError {
    LexerError(LexerError)
    ParserError(ParserError)
    } derive(
    Debug
    )

    SqlParserError::output

    fn SqlParserError::output(self : SqlParserError, logger : &Logger) -> Unit

    SqlParserError::to_string

    fn SqlParserError::to_string(self : SqlParserError) -> String

    ANSI

    pub(all) struct ANSI {
    }

    ANSI SQL dialect - adheres to ANSI SQL standards
    impl Dialect for ANSI

    ANSI::parse_expr

    fn ANSI::parse_expr(_self : ANSI, _tokens : ArrayView[Token]) -> (Expr, ArrayView[Token])? raise ParserError

    ANSI::parse_statement

    fn ANSI::parse_statement(_self : ANSI, _parser : Parser, _tokens : ArrayView[Token]) -> (Statement, ArrayView[Token])? raise ParserError

    ANSI::read_keyword

    fn ANSI::read_keyword(_self : ANSI, _word : String) -> Keyword?

    ANSI::requires_column_types_in_create_table

    fn ANSI::requires_column_types_in_create_table(_self : ANSI) -> Bool

    ANSI::supports_array_syntax

    fn ANSI::supports_array_syntax(_self : ANSI) -> Bool

    ANSI::supports_boolean_literals

    fn ANSI::supports_boolean_literals(_self : ANSI) -> Bool

    ANSI::supports_double_quoted_identifiers

    fn ANSI::supports_double_quoted_identifiers(_self : ANSI) -> Bool

    ANSI::supports_filter_during_aggregation

    fn ANSI::supports_filter_during_aggregation(_self : ANSI) -> Bool

    ANSI::supports_if_not_exists

    fn ANSI::supports_if_not_exists(_self : ANSI) -> Bool

    ANSI::supports_named_parameters

    fn ANSI::supports_named_parameters(_self : ANSI) -> Bool

    ANSI::supports_string_literal_backslash_escape

    fn ANSI::supports_string_literal_backslash_escape(_self : ANSI) -> Bool

    ANSI::supports_within_after_array_aggregation

    fn ANSI::supports_within_after_array_aggregation(_self : ANSI) -> Bool

    AccessExpr

    pub(all) enum AccessExpr {
    Dot(Expr)
    Subscript(Subscript)
    } derive(Eq,
    Debug
    )

    Access expression for array indexing, slicing, and field access
    impl Show for AccessExpr

    AccessExpr::equal

    fn AccessExpr::equal(AccessExpr, AccessExpr) -> Bool

    AccessExpr::not_equal

    fn AccessExpr::not_equal(x : AccessExpr, y : AccessExpr) -> Bool

    AccessExpr::output

    fn AccessExpr::output(self : AccessExpr, logger : &Logger) -> Unit

    AccessExpr::to_string

    fn AccessExpr::to_string(self : AccessExpr) -> String

    AlterIndexOperation

    pub(all) enum AlterIndexOperation {
    RenameTo(String)
    SetTablespace(String)
    Reset(Array[String])
    Set(Array[IndexParameter])
    } derive(Eq,
    Debug
    )

    ALTER INDEX operations

    AlterIndexOperation::equal

    AlterIndexOperation::not_equal

    AlterIndexOperation::output

    fn AlterIndexOperation::output(self : AlterIndexOperation, logger : &Logger) -> Unit

    AlterIndexOperation::to_string

    fn AlterIndexOperation::to_string(self : AlterIndexOperation) -> String

    AlterIndexStmt

    pub(all) struct AlterIndexStmt {
    name : String
    if_exists : Bool
    operation : AlterIndexOperation
    } derive(Eq,
    Debug
    )

    ALTER INDEX statement

    AlterIndexStmt::equal

    AlterIndexStmt::not_equal

    fn AlterIndexStmt::not_equal(x : AlterIndexStmt, y : AlterIndexStmt) -> Bool

    AlterIndexStmt::output

    fn AlterIndexStmt::output(self : AlterIndexStmt, logger : &Logger) -> Unit

    AlterIndexStmt::to_string

    fn AlterIndexStmt::to_string(self : AlterIndexStmt) -> String

    AlterTableOperation

    pub(all) enum AlterTableOperation {
    DropColumn(String, Bool)
    } derive(Eq,
    Debug
    )

    AlterTableOperation::equal

    AlterTableOperation::not_equal

    AlterTableOperation::output

    fn AlterTableOperation::output(self : AlterTableOperation, logger : &Logger) -> Unit

    AlterTableOperation::to_string

    fn AlterTableOperation::to_string(self : AlterTableOperation) -> String

    AlterTableStmt

    pub(all) struct AlterTableStmt {
    table_name : ObjectName
    if_exists : Bool
    operation : AlterTableOperation
    } derive(Eq,
    Debug
    )

    AlterTableStmt::equal

    AlterTableStmt::not_equal

    fn AlterTableStmt::not_equal(x : AlterTableStmt, y : AlterTableStmt) -> Bool

    AlterTableStmt::output

    fn AlterTableStmt::output(self : AlterTableStmt, logger : &Logger) -> Unit

    AlterTableStmt::to_string

    fn AlterTableStmt::to_string(self : AlterTableStmt) -> String

    ArrayExpr

    pub(all) struct ArrayExpr {
    elem : Array[Expr]
    named : Bool
    } derive(Eq,
    Debug
    )

    PostgreSQL array expression
    impl Show for ArrayExpr

    ArrayExpr::equal

    fn ArrayExpr::equal(ArrayExpr, ArrayExpr) -> Bool

    ArrayExpr::not_equal

    fn ArrayExpr::not_equal(x : ArrayExpr, y : ArrayExpr) -> Bool

    ArrayExpr::output

    fn ArrayExpr::output(self : ArrayExpr, logger : &Logger) -> Unit

    ArrayExpr::to_string

    fn ArrayExpr::to_string(self : ArrayExpr) -> String

    Assignment

    pub(all) struct Assignment {
    column : String
    value : Expr
    } derive(Eq,
    Debug
    )

    impl Show for Assignment

    Assignment::equal

    fn Assignment::equal(Assignment, Assignment) -> Bool

    Assignment::not_equal

    fn Assignment::not_equal(x : Assignment, y : Assignment) -> Bool

    Assignment::output

    fn Assignment::output(self : Assignment, logger : &Logger) -> Unit

    Assignment::to_string

    fn Assignment::to_string(self : Assignment) -> String

    BeginStmt

    pub(all) struct BeginStmt {
    work : Bool
    transaction : Bool
    } derive(Eq,
    Debug
    )

    impl Show for BeginStmt

    BeginStmt::equal

    fn BeginStmt::equal(BeginStmt, BeginStmt) -> Bool

    BeginStmt::not_equal

    fn BeginStmt::not_equal(x : BeginStmt, y : BeginStmt) -> Bool

    BeginStmt::output

    fn BeginStmt::output(self : BeginStmt, logger : &Logger) -> Unit

    BeginStmt::to_string

    fn BeginStmt::to_string(self : BeginStmt) -> String

    BigQuery

    pub(all) struct BigQuery {
    }

    BigQuery dialect - supports Google BigQuery specific syntax
    impl Dialect for BigQuery

    BigQuery::parse_expr

    fn BigQuery::parse_expr(_self : BigQuery, _tokens : ArrayView[Token]) -> (Expr, ArrayView[Token])? raise ParserError

    BigQuery::parse_statement

    fn BigQuery::parse_statement(_self : BigQuery, _parser : Parser, _tokens : ArrayView[Token]) -> (Statement, ArrayView[Token])? raise ParserError

    BigQuery::read_keyword

    fn BigQuery::read_keyword(_self : BigQuery, _word : String) -> Keyword?

    BigQuery::requires_column_types_in_create_table

    fn BigQuery::requires_column_types_in_create_table(_self : BigQuery) -> Bool

    BigQuery::supports_array_syntax

    fn BigQuery::supports_array_syntax(_self : BigQuery) -> Bool

    BigQuery::supports_boolean_literals

    fn BigQuery::supports_boolean_literals(_self : BigQuery) -> Bool

    BigQuery::supports_double_quoted_identifiers

    fn BigQuery::supports_double_quoted_identifiers(_self : BigQuery) -> Bool

    BigQuery::supports_filter_during_aggregation

    fn BigQuery::supports_filter_during_aggregation(_self : BigQuery) -> Bool

    BigQuery::supports_if_not_exists

    fn BigQuery::supports_if_not_exists(_self : BigQuery) -> Bool

    BigQuery::supports_named_parameters

    fn BigQuery::supports_named_parameters(_self : BigQuery) -> Bool

    BigQuery::supports_string_literal_backslash_escape

    fn BigQuery::supports_string_literal_backslash_escape(_self : BigQuery) -> Bool

    BigQuery::supports_within_after_array_aggregation

    fn BigQuery::supports_within_after_array_aggregation(_self : BigQuery) -> Bool

    BinaryOperator

    pub(all) enum BinaryOperator {
    Eq
    Neq
    Lt
    Gt
    LtEq
    GtEq
    Spaceship
    Plus
    Minus
    Mul
    Div
    IntegerDiv
    Mod
    And
    Or
    JsonExtract
    JsonExtractText
    JsonExtractPath
    JsonExtractPathText
    JsonContains
    JsonContainedIn
    } derive(Eq,
    Debug
    )

    BinaryOperator::equal

    BinaryOperator::get_precedence

    fn BinaryOperator::get_precedence(self : BinaryOperator) -> Precedence

    BinaryOperator::not_equal

    fn BinaryOperator::not_equal(x : BinaryOperator, y : BinaryOperator) -> Bool

    BinaryOperator::output

    fn BinaryOperator::output(self : BinaryOperator, logger : &Logger) -> Unit

    BinaryOperator::to_string

    fn BinaryOperator::to_string(self : BinaryOperator) -> String

    CaseExpr

    pub(all) struct CaseExpr {
    operand : Expr?
    when_then_clauses : Array[(Expr, Expr)]
    else_expr : Expr?
    } derive(Eq,
    Debug
    )

    CASE [operand] WHEN THEN [...] [ELSE ] END
    impl Show for CaseExpr

    CaseExpr::equal

    fn CaseExpr::equal(CaseExpr, CaseExpr) -> Bool

    CaseExpr::not_equal

    fn CaseExpr::not_equal(x : CaseExpr, y : CaseExpr) -> Bool

    CaseExpr::output

    fn CaseExpr::output(self : CaseExpr, logger : &Logger) -> Unit

    CaseExpr::to_repr

    CaseExpr::to_string

    fn CaseExpr::to_string(self : CaseExpr) -> String

    ClickHouse

    pub(all) struct ClickHouse {
    }

    ClickHouse dialect - supports ClickHouse specific syntax

    ClickHouse::parse_expr

    fn ClickHouse::parse_expr(_self : ClickHouse, _tokens : ArrayView[Token]) -> (Expr, ArrayView[Token])? raise ParserError

    ClickHouse::parse_statement

    fn ClickHouse::parse_statement(_self : ClickHouse, _parser : Parser, _tokens : ArrayView[Token]) -> (Statement, ArrayView[Token])? raise ParserError

    ClickHouse::read_keyword

    fn ClickHouse::read_keyword(_self : ClickHouse, _word : String) -> Keyword?

    ClickHouse::requires_column_types_in_create_table

    fn ClickHouse::requires_column_types_in_create_table(_self : ClickHouse) -> Bool

    ClickHouse::supports_array_syntax

    fn ClickHouse::supports_array_syntax(_self : ClickHouse) -> Bool

    ClickHouse::supports_boolean_literals

    fn ClickHouse::supports_boolean_literals(_self : ClickHouse) -> Bool

    ClickHouse::supports_double_quoted_identifiers

    fn ClickHouse::supports_double_quoted_identifiers(_self : ClickHouse) -> Bool

    ClickHouse::supports_filter_during_aggregation

    fn ClickHouse::supports_filter_during_aggregation(_self : ClickHouse) -> Bool

    ClickHouse::supports_if_not_exists

    fn ClickHouse::supports_if_not_exists(_self : ClickHouse) -> Bool

    ClickHouse::supports_named_parameters

    fn ClickHouse::supports_named_parameters(_self : ClickHouse) -> Bool

    ClickHouse::supports_string_literal_backslash_escape

    fn ClickHouse::supports_string_literal_backslash_escape(_self : ClickHouse) -> Bool

    ClickHouse::supports_within_after_array_aggregation

    fn ClickHouse::supports_within_after_array_aggregation(_self : ClickHouse) -> Bool

    ColumnDef

    pub(all) struct ColumnDef {
    name : String
    data_type : DataType
    options : Array[ColumnDefOption]
    } derive(Eq,
    Debug
    )

    impl Show for ColumnDef

    ColumnDef::equal

    fn ColumnDef::equal(ColumnDef, ColumnDef) -> Bool

    ColumnDef::not_equal

    fn ColumnDef::not_equal(x : ColumnDef, y : ColumnDef) -> Bool

    ColumnDef::output

    fn ColumnDef::output(self : ColumnDef, logger : &Logger) -> Unit

    ColumnDef::to_string

    fn ColumnDef::to_string(self : ColumnDef) -> String

    ColumnDefOption

    pub(all) enum ColumnDefOption {
    NotNull
    Unique
    Default(Expr)
    PrimaryKey
    } derive(Eq,
    Debug
    )

    ColumnDefOption::equal

    ColumnDefOption::not_equal

    fn ColumnDefOption::not_equal(x : ColumnDefOption, y : ColumnDefOption) -> Bool

    ColumnDefOption::output

    fn ColumnDefOption::output(self : ColumnDefOption, logger : &Logger) -> Unit

    ColumnDefOption::to_string

    fn ColumnDefOption::to_string(self : ColumnDefOption) -> String

    CommitStmt

    pub(all) struct CommitStmt {
    work : Bool
    transaction : Bool
    } derive(Eq,
    Debug
    )

    impl Show for CommitStmt

    CommitStmt::equal

    fn CommitStmt::equal(CommitStmt, CommitStmt) -> Bool

    CommitStmt::not_equal

    fn CommitStmt::not_equal(x : CommitStmt, y : CommitStmt) -> Bool

    CommitStmt::output

    fn CommitStmt::output(self : CommitStmt, logger : &Logger) -> Unit

    CommitStmt::to_string

    fn CommitStmt::to_string(self : CommitStmt) -> String

    ConflictAction

    pub(all) enum ConflictAction {
    DoNothing
    DoUpdate(Array[Assignment], Expr?)
    } derive(Eq,
    Debug
    )

    Action to take when conflict occurs

    ConflictAction::equal

    ConflictAction::not_equal

    fn ConflictAction::not_equal(x : ConflictAction, y : ConflictAction) -> Bool

    ConflictAction::output

    fn ConflictAction::output(self : ConflictAction, logger : &Logger) -> Unit

    ConflictAction::to_string

    fn ConflictAction::to_string(self : ConflictAction) -> String

    ConflictTarget

    pub(all) enum ConflictTarget {
    Columns(Array[String])
    OnConstraint(String)
    OnExpression(Expr, Expr?)
    } derive(Eq,
    Debug
    )

    Conflict target specification

    ConflictTarget::equal

    ConflictTarget::not_equal

    fn ConflictTarget::not_equal(x : ConflictTarget, y : ConflictTarget) -> Bool

    ConflictTarget::output

    fn ConflictTarget::output(self : ConflictTarget, logger : &Logger) -> Unit

    ConflictTarget::to_string

    fn ConflictTarget::to_string(self : ConflictTarget) -> String

    CopyDirection

    pub(all) enum CopyDirection {
    To
    From
    } derive(Eq,
    Debug
    )

    Direction of COPY operation

    CopyDirection::equal

    CopyDirection::not_equal

    fn CopyDirection::not_equal(x : CopyDirection, y : CopyDirection) -> Bool

    CopyDirection::output

    fn CopyDirection::output(self : CopyDirection, logger : &Logger) -> Unit

    CopyDirection::to_string

    fn CopyDirection::to_string(self : CopyDirection) -> String

    CopyForceQuote

    pub(all) enum CopyForceQuote {
    All
    Columns(Array[String])
    } derive(Eq,
    Debug
    )

    FORCE_QUOTE specification

    CopyForceQuote::equal

    CopyForceQuote::not_equal

    fn CopyForceQuote::not_equal(x : CopyForceQuote, y : CopyForceQuote) -> Bool

    CopyForceQuote::output

    fn CopyForceQuote::output(self : CopyForceQuote, logger : &Logger) -> Unit

    CopyForceQuote::to_string

    fn CopyForceQuote::to_string(self : CopyForceQuote) -> String

    CopyFormat

    pub(all) enum CopyFormat {
    Csv
    Text
    Binary
    } derive(Eq,
    Debug
    )

    COPY format specification
    impl Show for CopyFormat

    CopyFormat::equal

    fn CopyFormat::equal(CopyFormat, CopyFormat) -> Bool

    CopyFormat::not_equal

    fn CopyFormat::not_equal(x : CopyFormat, y : CopyFormat) -> Bool

    CopyFormat::output

    fn CopyFormat::output(self : CopyFormat, logger : &Logger) -> Unit

    CopyFormat::to_string

    fn CopyFormat::to_string(self : CopyFormat) -> String

    CopyOption

    pub(all) enum CopyOption {
    Format(CopyFormat)
    Delimiter(String)
    Null(String)
    Header(Bool?)
    Quote(String)
    Escape(String)
    ForceQuote(CopyForceQuote)
    ForceNotNull(Array[String])
    ForceNull(Array[String])
    Encoding(String)
    } derive(Eq,
    Debug
    )

    COPY statement options
    impl Show for CopyOption

    CopyOption::equal

    fn CopyOption::equal(CopyOption, CopyOption) -> Bool

    CopyOption::not_equal

    fn CopyOption::not_equal(x : CopyOption, y : CopyOption) -> Bool

    CopyOption::output

    fn CopyOption::output(self : CopyOption, logger : &Logger) -> Unit

    CopyOption::to_string

    fn CopyOption::to_string(self : CopyOption) -> String

    CopySource

    pub(all) enum CopySource {
    Table(ObjectName, Array[String]?)
    Query(QueryStmt)
    } derive(Eq,
    Debug
    )

    Source specification for COPY statement
    impl Show for CopySource

    CopySource::equal

    fn CopySource::equal(CopySource, CopySource) -> Bool

    CopySource::not_equal

    fn CopySource::not_equal(x : CopySource, y : CopySource) -> Bool

    CopySource::output

    fn CopySource::output(self : CopySource, logger : &Logger) -> Unit

    CopySource::to_string

    fn CopySource::to_string(self : CopySource) -> String

    CopyStmt

    pub(all) struct CopyStmt {
    source : CopySource
    direction : CopyDirection
    target : CopyTarget
    format_options : Array[CopyOption]
    } derive(Eq,
    Debug
    )

    COPY statement for bulk data import/export operations
    impl Show for CopyStmt

    CopyStmt::equal

    fn CopyStmt::equal(CopyStmt, CopyStmt) -> Bool

    CopyStmt::not_equal

    fn CopyStmt::not_equal(x : CopyStmt, y : CopyStmt) -> Bool

    CopyStmt::output

    fn CopyStmt::output(self : CopyStmt, logger : &Logger) -> Unit

    CopyStmt::to_repr

    CopyStmt::to_string

    fn CopyStmt::to_string(self : CopyStmt) -> String

    CopyTarget

    pub(all) enum CopyTarget {
    File(String)
    Stdin
    Stdout
    Program(String)
    } derive(Eq,
    Debug
    )

    Target specification for COPY statement
    impl Show for CopyTarget

    CopyTarget::equal

    fn CopyTarget::equal(CopyTarget, CopyTarget) -> Bool

    CopyTarget::not_equal

    fn CopyTarget::not_equal(x : CopyTarget, y : CopyTarget) -> Bool

    CopyTarget::output

    fn CopyTarget::output(self : CopyTarget, logger : &Logger) -> Unit

    CopyTarget::to_string

    fn CopyTarget::to_string(self : CopyTarget) -> String

    CreateDatabaseStmt

    pub(all) struct CreateDatabaseStmt {
    name : String
    if_not_exists : Bool
    character_set : String?
    collate : String?
    } derive(Eq,
    Debug
    )

    CREATE DATABASE statement

    CreateDatabaseStmt::equal

    CreateDatabaseStmt::not_equal

    CreateDatabaseStmt::output

    fn CreateDatabaseStmt::output(self : CreateDatabaseStmt, logger : &Logger) -> Unit

    CreateDatabaseStmt::to_string

    fn CreateDatabaseStmt::to_string(self : CreateDatabaseStmt) -> String

    CreateFunctionStmt

    pub(all) struct CreateFunctionStmt {
    name : String
    parameters : Array[FunctionParameter]
    return_type : DataType?
    language : String?
    body : String?
    deterministic : Bool
    if_not_exists : Bool
    } derive(Eq,
    Debug
    )

    CREATE FUNCTION statement

    CreateFunctionStmt::equal

    CreateFunctionStmt::not_equal

    CreateFunctionStmt::output

    fn CreateFunctionStmt::output(self : CreateFunctionStmt, logger : &Logger) -> Unit

    CreateFunctionStmt::to_string

    fn CreateFunctionStmt::to_string(self : CreateFunctionStmt) -> String

    CreateIndexStmt

    pub(all) struct CreateIndexStmt {
    unique : Bool
    concurrently : Bool
    if_not_exists : Bool
    name : String
    table_name : ObjectName
    index_method : IndexMethod?
    columns : Array[IndexColumn]
    where_clause : Expr?
    } derive(Eq,
    Debug
    )

    CREATE INDEX statement

    CreateIndexStmt::equal

    CreateIndexStmt::not_equal

    fn CreateIndexStmt::not_equal(x : CreateIndexStmt, y : CreateIndexStmt) -> Bool

    CreateIndexStmt::output

    fn CreateIndexStmt::output(self : CreateIndexStmt, logger : &Logger) -> Unit

    CreateIndexStmt::to_string

    fn CreateIndexStmt::to_string(self : CreateIndexStmt) -> String

    CreateProcedureStmt

    pub(all) struct CreateProcedureStmt {
    name : String
    parameters : Array[FunctionParameter]
    language : String?
    body : String?
    if_not_exists : Bool
    } derive(Eq,
    Debug
    )

    CREATE PROCEDURE statement

    CreateProcedureStmt::equal

    CreateProcedureStmt::not_equal

    CreateProcedureStmt::output

    fn CreateProcedureStmt::output(self : CreateProcedureStmt, logger : &Logger) -> Unit

    CreateProcedureStmt::to_string

    fn CreateProcedureStmt::to_string(self : CreateProcedureStmt) -> String

    CreateSchemaStmt

    pub(all) struct CreateSchemaStmt {
    name : String
    if_not_exists : Bool
    authorization : String?
    } derive(Eq,
    Debug
    )

    CREATE SCHEMA statement (synonym for CREATE DATABASE in many dialects)

    CreateSchemaStmt::equal

    CreateSchemaStmt::not_equal

    fn CreateSchemaStmt::not_equal(x : CreateSchemaStmt, y : CreateSchemaStmt) -> Bool

    CreateSchemaStmt::output

    fn CreateSchemaStmt::output(self : CreateSchemaStmt, logger : &Logger) -> Unit

    CreateSchemaStmt::to_string

    fn CreateSchemaStmt::to_string(self : CreateSchemaStmt) -> String

    CreateSequenceStmt

    pub(all) struct CreateSequenceStmt {
    name : String
    if_not_exists : Bool
    temporary : Bool
    increment : Int?
    minvalue : SequenceLimit?
    maxvalue : SequenceLimit?
    start_with : Int?
    cache : Int?
    cycle : Bool?
    owned_by : SequenceOwnedBy?
    } derive(Eq,
    Debug
    )

    CREATE SEQUENCE statement

    CreateSequenceStmt::equal

    CreateSequenceStmt::not_equal

    CreateSequenceStmt::output

    fn CreateSequenceStmt::output(self : CreateSequenceStmt, logger : &Logger) -> Unit

    CreateSequenceStmt::to_string

    fn CreateSequenceStmt::to_string(self : CreateSequenceStmt) -> String

    CreateTableDefinition

    pub(all) enum CreateTableDefinition {
    Columns(Array[ColumnDef], Array[TableConstraint])
    AsQuery(QueryStmt)
    } derive(Eq,
    Debug
    )

    CreateTableDefinition::equal

    CreateTableDefinition::not_equal

    CreateTableDefinition::output

    fn CreateTableDefinition::output(self : CreateTableDefinition, logger : &Logger) -> Unit

    CreateTableDefinition::to_string

    fn CreateTableDefinition::to_string(self : CreateTableDefinition) -> String

    CreateTableStmt

    pub(all) struct CreateTableStmt {
    name : String
    if_not_exists : Bool
    definition : CreateTableDefinition
    } derive(Eq,
    Debug
    )

    CreateTableStmt::equal

    CreateTableStmt::not_equal

    fn CreateTableStmt::not_equal(x : CreateTableStmt, y : CreateTableStmt) -> Bool

    CreateTableStmt::output

    fn CreateTableStmt::output(self : CreateTableStmt, logger : &Logger) -> Unit

    CreateTableStmt::to_string

    fn CreateTableStmt::to_string(self : CreateTableStmt) -> String

    CreateViewStmt

    type CreateViewStmt derive(Eq,
    Debug
    )

    CreateViewStmt::equal

    CreateViewStmt::not_equal

    fn CreateViewStmt::not_equal(x : CreateViewStmt, y : CreateViewStmt) -> Bool

    CreateViewStmt::output

    fn CreateViewStmt::output(self : CreateViewStmt, logger : &Logger) -> Unit

    CreateViewStmt::to_string

    fn CreateViewStmt::to_string(self : CreateViewStmt) -> String

    Cte

    pub(all) struct Cte {
    name : String
    query : QueryStmt
    columns : Array[String]?
    } derive(Eq,
    Debug
    )

    Common Table Expression (CTE) for WITH clauses
    impl Show for Cte

    Cte::equal

    fn Cte::equal(Cte, Cte) -> Bool

    Cte::not_equal

    fn Cte::not_equal(x : Cte, y : Cte) -> Bool

    Cte::output

    fn Cte::output(self : Cte, logger : &Logger) -> Unit

    Cte::to_repr

    Cte::to_string

    fn Cte::to_string(self : Cte) -> String

    DataType

    pub(all) enum DataType {
    Integer
    Smallint
    Bigint
    Float(Int?)
    Real
    Double
    Char(Int)
    Varchar(Int)
    Text
    Boolean
    Timestamp
    Blob
    } derive(Eq,
    Debug
    )

    impl Show for DataType

    DataType::equal

    fn DataType::equal(DataType, DataType) -> Bool

    DataType::not_equal

    fn DataType::not_equal(x : DataType, y : DataType) -> Bool

    DataType::output

    fn DataType::output(self : DataType, logger : &Logger) -> Unit

    DataType::to_repr

    DataType::to_string

    fn DataType::to_string(self : DataType) -> String

    DatetimeUnit

    pub(all) enum DatetimeUnit {
    Year
    Month
    Day
    Hour
    Minute
    Second
    } derive(Eq,
    Debug
    )

    DatetimeUnit::equal

    DatetimeUnit::not_equal

    fn DatetimeUnit::not_equal(x : DatetimeUnit, y : DatetimeUnit) -> Bool

    DatetimeUnit::output

    fn DatetimeUnit::output(self : DatetimeUnit, logger : &Logger) -> Unit

    DatetimeUnit::to_string

    fn DatetimeUnit::to_string(self : DatetimeUnit) -> String

    DeallocateStmt

    pub(all) struct DeallocateStmt {
    name : String
    prepare : Bool
    } derive(Eq,
    Debug
    )

    DEALLOCATE statement Syntax: DEALLOCATE [PREPARE] name

    DeallocateStmt::equal

    DeallocateStmt::not_equal

    fn DeallocateStmt::not_equal(x : DeallocateStmt, y : DeallocateStmt) -> Bool

    DeallocateStmt::output

    fn DeallocateStmt::output(self : DeallocateStmt, logger : &Logger) -> Unit

    DeallocateStmt::to_string

    fn DeallocateStmt::to_string(self : DeallocateStmt) -> String

    DeleteStmt

    pub(all) struct DeleteStmt {
    table_name : ObjectName
    where_clause : Expr?
    } derive(Eq,
    Debug
    )

    impl Show for DeleteStmt

    DeleteStmt::equal

    fn DeleteStmt::equal(DeleteStmt, DeleteStmt) -> Bool

    DeleteStmt::not_equal

    fn DeleteStmt::not_equal(x : DeleteStmt, y : DeleteStmt) -> Bool

    DeleteStmt::output

    fn DeleteStmt::output(self : DeleteStmt, logger : &Logger) -> Unit

    DeleteStmt::to_string

    fn DeleteStmt::to_string(self : DeleteStmt) -> String

    DropIndexStmt

    pub(all) struct DropIndexStmt {
    name : String
    if_exists : Bool
    concurrently : Bool
    table_name : ObjectName?
    } derive(Eq,
    Debug
    )

    DropIndexStmt::equal

    DropIndexStmt::not_equal

    fn DropIndexStmt::not_equal(x : DropIndexStmt, y : DropIndexStmt) -> Bool

    DropIndexStmt::output

    fn DropIndexStmt::output(self : DropIndexStmt, logger : &Logger) -> Unit

    DropIndexStmt::to_string

    fn DropIndexStmt::to_string(self : DropIndexStmt) -> String

    DropTableStmt

    pub(all) struct DropTableStmt {
    table_name : ObjectName
    if_exists : Bool
    } derive(Eq,
    Debug
    )

    DropTableStmt::equal

    DropTableStmt::not_equal

    fn DropTableStmt::not_equal(x : DropTableStmt, y : DropTableStmt) -> Bool

    DropTableStmt::output

    fn DropTableStmt::output(self : DropTableStmt, logger : &Logger) -> Unit

    DropTableStmt::to_string

    fn DropTableStmt::to_string(self : DropTableStmt) -> String

    DropViewStmt

    pub(all) struct DropViewStmt {
    name : String
    } derive(Eq,
    Debug
    )

    DropViewStmt::equal

    DropViewStmt::not_equal

    fn DropViewStmt::not_equal(x : DropViewStmt, y : DropViewStmt) -> Bool

    DropViewStmt::output

    fn DropViewStmt::output(self : DropViewStmt, logger : &Logger) -> Unit

    DropViewStmt::to_string

    fn DropViewStmt::to_string(self : DropViewStmt) -> String

    DuckDB

    pub(all) struct DuckDB {
    }

    DuckDB dialect - supports DuckDB specific syntax
    impl Dialect for DuckDB

    DuckDB::parse_expr

    fn DuckDB::parse_expr(_self : DuckDB, _tokens : ArrayView[Token]) -> (Expr, ArrayView[Token])? raise ParserError

    DuckDB::parse_statement

    fn DuckDB::parse_statement(_self : DuckDB, _parser : Parser, _tokens : ArrayView[Token]) -> (Statement, ArrayView[Token])? raise ParserError

    DuckDB::read_keyword

    fn DuckDB::read_keyword(_self : DuckDB, _word : String) -> Keyword?

    DuckDB::requires_column_types_in_create_table

    fn DuckDB::requires_column_types_in_create_table(_self : DuckDB) -> Bool

    DuckDB::supports_array_syntax

    fn DuckDB::supports_array_syntax(_self : DuckDB) -> Bool

    DuckDB::supports_boolean_literals

    fn DuckDB::supports_boolean_literals(_self : DuckDB) -> Bool

    DuckDB::supports_double_quoted_identifiers

    fn DuckDB::supports_double_quoted_identifiers(_self : DuckDB) -> Bool

    DuckDB::supports_filter_during_aggregation

    fn DuckDB::supports_filter_during_aggregation(_self : DuckDB) -> Bool

    DuckDB::supports_if_not_exists

    fn DuckDB::supports_if_not_exists(_self : DuckDB) -> Bool

    DuckDB::supports_named_parameters

    fn DuckDB::supports_named_parameters(_self : DuckDB) -> Bool

    DuckDB::supports_string_literal_backslash_escape

    fn DuckDB::supports_string_literal_backslash_escape(_self : DuckDB) -> Bool

    DuckDB::supports_within_after_array_aggregation

    fn DuckDB::supports_within_after_array_aggregation(_self : DuckDB) -> Bool

    DuplicateTreatment

    pub(all) enum DuplicateTreatment {
    Distinct
    All
    } derive(Eq,
    Debug
    )

    DuplicateTreatment::equal

    DuplicateTreatment::not_equal

    DuplicateTreatment::output

    fn DuplicateTreatment::output(self : DuplicateTreatment, logger : &Logger) -> Unit

    DuplicateTreatment::to_string

    fn DuplicateTreatment::to_string(self : DuplicateTreatment) -> String

    ExecuteStmt

    pub(all) struct ExecuteStmt {
    name : ObjectName?
    parameters : Array[Expr]
    has_parentheses : Bool
    into : Array[String]
    using_exprs : Array[Expr]
    } derive(Eq,
    Debug
    )

    EXECUTE statement Syntax: EXECUTE name [(param [, ...])] EXECUTE name USING expr [, ...] EXECUTE IMMEDIATE 'sql_string' [INTO var [, ...]] [USING expr [, ...]]
    impl Show for ExecuteStmt

    ExecuteStmt::equal

    fn ExecuteStmt::equal(ExecuteStmt, ExecuteStmt) -> Bool

    ExecuteStmt::not_equal

    fn ExecuteStmt::not_equal(x : ExecuteStmt, y : ExecuteStmt) -> Bool

    ExecuteStmt::output

    fn ExecuteStmt::output(self : ExecuteStmt, logger : &Logger) -> Unit

    ExecuteStmt::to_string

    fn ExecuteStmt::to_string(self : ExecuteStmt) -> String

    Expr

    pub(all) enum Expr {
    Identifier(String)
    CompoundIdentifier(Array[String])
    Literal(Literal)
    BinaryOperation(Expr, BinaryOperator, Expr)
    UnaryOperation(UnaryOperator, Expr)
    FunctionCall(String, DuplicateTreatment?, Array[Expr], Expr?)
    Wildcard
    Datetime(String)
    Interval(String, IntervalQualifier)
    Like(positive~ : Bool, Expr, Expr)
    ILike(positive~ : Bool, Expr, Expr)
    SubQuery(QueryStmt)
    Exists(positive~ : Bool, QueryStmt)
    Between(positive~ : Bool, Expr, Expr, Expr)
    Extract(PrimaryDatetimeField, Expr)
    Case(CaseExpr)
    InList(positive~ : Bool, Expr, Array[Expr])
    InSubQuery(positive~ : Bool, Expr, QueryStmt)
    Substring(Expr, Expr?, Expr?)
    Placeholder(String)
    Array(ArrayExpr)
    CompoundFieldAccess(Expr, Array[AccessExpr])
    WindowFunction(String, DuplicateTreatment?, Array[Expr], WindowSpec)
    } derive(Eq,
    Debug
    )

    impl Show for Expr

    Expr::equal

    fn Expr::equal(Expr, Expr) -> Bool

    Expr::not_equal

    fn Expr::not_equal(x : Expr, y : Expr) -> Bool

    Expr::output

    fn Expr::output(self : Expr, logger : &Logger) -> Unit

    Expr::to_repr

    Expr::to_string

    fn Expr::to_string(self : Expr) -> String

    FunctionParameter

    pub(all) struct FunctionParameter {
    name : String
    param_type : DataType
    mode : ParameterMode?
    } derive(Eq,
    Debug
    )

    Function parameter definition

    FunctionParameter::equal

    FunctionParameter::not_equal

    fn FunctionParameter::not_equal(x : FunctionParameter, y : FunctionParameter) -> Bool

    FunctionParameter::output

    fn FunctionParameter::output(self : FunctionParameter, logger : &Logger) -> Unit

    FunctionParameter::to_string

    fn FunctionParameter::to_string(self : FunctionParameter) -> String

    Generic

    pub(all) struct Generic {
    }

    Generic SQL dialect that supports the union of all other dialects This is the most permissive dialect, useful for parsing various SQL statements from different sources without strict dialect requirements
    impl Dialect for Generic

    Generic::parse_expr

    fn Generic::parse_expr(_self : Generic, _tokens : ArrayView[Token]) -> (Expr, ArrayView[Token])? raise ParserError

    Generic::parse_statement

    fn Generic::parse_statement(_self : Generic, _parser : Parser, _tokens : ArrayView[Token]) -> (Statement, ArrayView[Token])? raise ParserError

    Generic::read_keyword

    fn Generic::read_keyword(_self : Generic, _word : String) -> Keyword?

    Generic::requires_column_types_in_create_table

    fn Generic::requires_column_types_in_create_table(_self : Generic) -> Bool

    Generic::supports_array_syntax

    fn Generic::supports_array_syntax(_self : Generic) -> Bool

    Generic::supports_boolean_literals

    fn Generic::supports_boolean_literals(_self : Generic) -> Bool

    Generic::supports_double_quoted_identifiers

    fn Generic::supports_double_quoted_identifiers(_self : Generic) -> Bool

    Generic::supports_filter_during_aggregation

    fn Generic::supports_filter_during_aggregation(_self : Generic) -> Bool

    Generic::supports_if_not_exists

    fn Generic::supports_if_not_exists(_self : Generic) -> Bool

    Generic::supports_named_parameters

    fn Generic::supports_named_parameters(_self : Generic) -> Bool

    Generic::supports_string_literal_backslash_escape

    fn Generic::supports_string_literal_backslash_escape(_self : Generic) -> Bool

    Generic::supports_within_after_array_aggregation

    fn Generic::supports_within_after_array_aggregation(_self : Generic) -> Bool

    GrantStmt

    pub(all) struct GrantStmt {
    privileges : Array[Privilege]
    objects : Array[ObjectName]
    grantees : Array[String]
    with_grant_option : Bool
    } derive(Eq,
    Debug
    )

    impl Show for GrantStmt

    GrantStmt::equal

    fn GrantStmt::equal(GrantStmt, GrantStmt) -> Bool

    GrantStmt::not_equal

    fn GrantStmt::not_equal(x : GrantStmt, y : GrantStmt) -> Bool

    GrantStmt::output

    fn GrantStmt::output(self : GrantStmt, logger : &Logger) -> Unit

    GrantStmt::to_string

    fn GrantStmt::to_string(self : GrantStmt) -> String

    IndexColumn

    pub(all) struct IndexColumn {
    name : Expr
    asc : Bool?
    nulls_first : Bool?
    } derive(Eq,
    Debug
    )

    Index column specification
    impl Show for IndexColumn

    IndexColumn::equal

    fn IndexColumn::equal(IndexColumn, IndexColumn) -> Bool

    IndexColumn::not_equal

    fn IndexColumn::not_equal(x : IndexColumn, y : IndexColumn) -> Bool

    IndexColumn::output

    fn IndexColumn::output(self : IndexColumn, logger : &Logger) -> Unit

    IndexColumn::to_string

    fn IndexColumn::to_string(self : IndexColumn) -> String

    IndexMethod

    pub(all) enum IndexMethod {
    Btree
    Hash
    Gin
    Gist
    Spgist
    Brin
    } derive(Eq,
    Debug
    )

    Index creation method
    impl Show for IndexMethod

    IndexMethod::equal

    fn IndexMethod::equal(IndexMethod, IndexMethod) -> Bool

    IndexMethod::not_equal

    fn IndexMethod::not_equal(x : IndexMethod, y : IndexMethod) -> Bool

    IndexMethod::output

    fn IndexMethod::output(self : IndexMethod, logger : &Logger) -> Unit

    IndexMethod::to_string

    fn IndexMethod::to_string(self : IndexMethod) -> String

    IndexParameter

    pub(all) struct IndexParameter {
    name : String
    value : String
    } derive(Eq,
    Debug
    )

    Index parameter for SET operations

    IndexParameter::equal

    IndexParameter::not_equal

    fn IndexParameter::not_equal(x : IndexParameter, y : IndexParameter) -> Bool

    IndexParameter::output

    fn IndexParameter::output(self : IndexParameter, logger : &Logger) -> Unit

    IndexParameter::to_string

    fn IndexParameter::to_string(self : IndexParameter) -> String

    InsertSource

    pub(all) enum InsertSource {
    Values(Array[Array[Expr]])
    Query(QueryStmt)
    } derive(Eq,
    Debug
    )

    InsertSource::equal

    InsertSource::not_equal

    fn InsertSource::not_equal(x : InsertSource, y : InsertSource) -> Bool

    InsertSource::output

    fn InsertSource::output(self : InsertSource, logger : &Logger) -> Unit

    InsertSource::to_string

    fn InsertSource::to_string(self : InsertSource) -> String

    InsertStmt

    pub(all) struct InsertStmt {
    table_name : ObjectName
    columns : Array[String]
    source : InsertSource
    or : SqliteOnConflict?
    on : OnInsert?
    } derive(Eq,
    Debug
    )

    impl Show for InsertStmt

    InsertStmt::equal

    fn InsertStmt::equal(InsertStmt, InsertStmt) -> Bool

    InsertStmt::not_equal

    fn InsertStmt::not_equal(x : InsertStmt, y : InsertStmt) -> Bool

    InsertStmt::output

    fn InsertStmt::output(self : InsertStmt, logger : &Logger) -> Unit

    InsertStmt::to_string

    fn InsertStmt::to_string(self : InsertStmt) -> String

    IntervalQualifier

    pub(all) enum IntervalQualifier {
    Single(PrimaryDatetimeField)
    Range(PrimaryDatetimeField, PrimaryDatetimeField)
    } derive(Eq,
    Debug
    )

    IntervalQualifier::equal

    IntervalQualifier::not_equal

    fn IntervalQualifier::not_equal(x : IntervalQualifier, y : IntervalQualifier) -> Bool

    IntervalQualifier::output

    fn IntervalQualifier::output(self : IntervalQualifier, logger : &Logger) -> Unit

    IntervalQualifier::to_string

    fn IntervalQualifier::to_string(self : IntervalQualifier) -> String

    Join

    pub(all) struct Join {
    table_ref : TableRef
    join_operator : JoinOperator
    } derive(Eq,
    Debug
    )

    impl Show for Join

    Join::equal

    fn Join::equal(Join, Join) -> Bool

    Join::not_equal

    fn Join::not_equal(x : Join, y : Join) -> Bool

    Join::output

    fn Join::output(self : Join, logger : &Logger) -> Unit

    Join::to_repr

    Join::to_string

    fn Join::to_string(self : Join) -> String

    JoinConstraint

    pub(all) enum JoinConstraint {
    On(Expr)
    Using(Array[String])
    Non
    } derive(Eq,
    Debug
    )

    JoinConstraint::equal

    JoinConstraint::not_equal

    fn JoinConstraint::not_equal(x : JoinConstraint, y : JoinConstraint) -> Bool

    JoinConstraint::output

    fn JoinConstraint::output(self : JoinConstraint, logger : &Logger) -> Unit

    JoinConstraint::to_string

    fn JoinConstraint::to_string(self : JoinConstraint) -> String

    JoinOperator

    pub(all) enum JoinOperator {
    Join(JoinConstraint)
    Left(JoinConstraint)
    LeftOuter(JoinConstraint)
    Right(JoinConstraint)
    RightOuter(JoinConstraint)
    Full(JoinConstraint)
    FullOuter(JoinConstraint)
    Inner(JoinConstraint)
    Cross
    } derive(Eq,
    Debug
    )

    JoinOperator::equal

    JoinOperator::not_equal

    fn JoinOperator::not_equal(x : JoinOperator, y : JoinOperator) -> Bool

    JoinOperator::output

    fn JoinOperator::output(self : JoinOperator, logger : &Logger) -> Unit

    JoinOperator::to_string

    fn JoinOperator::to_string(self : JoinOperator) -> String

    Keyword

    pub(all) enum Keyword {
    Select
    From
    Where
    As
    Group
    Order
    By
    Asc
    Desc
    Nulls
    First
    Last
    Year
    Month
    Day
    Hour
    Minute
    Second
    Date
    Interval
    To
    Like
    Not
    ILike
    Exists
    Between
    And
    Or
    Extract
    Filter
    Case
    When
    Matched
    Target
    Then
    Else
    Having
    End
    In
    Join
    Left
    Right
    Full
    Outer
    Inner
    Cross
    On
    Using
    Limit
    Offset
    Create
    Table
    Integer
    Int
    Smallint
    Bigint
    Real
    Double
    Precision
    Char
    Character
    Collate
    Authorization
    Varchar
    Varing
    Text
    Time
    Boolean
    Float
    Timestamp
    Blob
    Null
    Default
    Unique
    View
    Drop
    Distinct
    All
    Substring
    For
    Primary
    Key
    Foreign
    References
    Check
    Union
    Intersect
    Except
    Top
    Insert
    Into
    Values
    Merge
    If
    Delete
    Update
    Set
    Replace
    Rollback
    Abort
    Fail
    Ignore
    Truncate
    Alter
    Column
    Show
    Tables
    Columns
    Status
    Databases
    Database
    Div
    Lock
    Unlock
    Listen
    Notify
    Schemas
    Schema
    Variables
    Processlist
    Grants
    Functions
    Function
    Extended
    Global
    Session
    Procedure
    Returns
    Language
    Deterministic
    Event
    Trigger
    Duplicate
    Conflict
    Do
    Nothing
    Constraint
    Array
    With
    Begin
    Start
    Transaction
    Commit
    Savepoint
    Release
    Work
    Grant
    Revoke
    Privileges
    Usage
    Use
    Execute
    Prepare
    Deallocate
    Immediate
    Connect
    Temporary
    Temp
    Option
    Restrict
    Cascade
    Index
    Copy
    Format
    Stdin
    Stdout
    Program
    Header
    ForceQuote
    ForceNotNull
    ForceNull
    Encoding
    Load
    Data
    Local
    Infile
    Fields
    Lines
    Terminated
    Enclosed
    Escaped
    Starting
    Optionally
    Rename
    Tablespace
    Reset
    Btree
    Hash
    Gin
    Gist
    Spgist
    Brin
    Concurrently
    Over
    Window
    Partition
    Rows
    Range
    Preceding
    Following
    Current
    Unbounded
    Row
    Out
    InOut
    Sequence
    Increment
    Minvalue
    Maxvalue
    Cache
    Cycle
    Owned
    No
    } derive(Eq,
    Debug
    )

    impl Show for Keyword

    Keyword::equal

    fn Keyword::equal(Keyword, Keyword) -> Bool

    Keyword::not_equal

    fn Keyword::not_equal(x : Keyword, y : Keyword) -> Bool

    Keyword::output

    fn Keyword::output(self : Keyword, logger : &Logger) -> Unit

    Keyword::to_repr

    Keyword::to_string

    fn Keyword::to_string(self : Keyword) -> String

    Literal

    pub(all) enum Literal {
    Integer(Int)
    Double(Double)
    String(String)
    Boolean(Bool)
    Null
    } derive(Eq,
    Debug
    )

    impl Show for Literal

    Literal::equal

    fn Literal::equal(Literal, Literal) -> Bool

    Literal::not_equal

    fn Literal::not_equal(x : Literal, y : Literal) -> Bool

    Literal::output

    fn Literal::output(self : Literal, logger : &Logger) -> Unit

    Literal::to_repr

    Literal::to_string

    fn Literal::to_string(self : Literal) -> String

    LoadDataDuplicateHandling

    pub(all) enum LoadDataDuplicateHandling {
    Replace
    Ignore
    } derive(Eq,
    Debug
    )

    Duplicate handling for LOAD DATA

    LoadDataDuplicateHandling::equal

    LoadDataDuplicateHandling::not_equal

    LoadDataDuplicateHandling::output

    fn LoadDataDuplicateHandling::output(self : LoadDataDuplicateHandling, logger : &Logger) -> Unit

    LoadDataDuplicateHandling::to_string

    LoadDataFieldsOptions

    pub(all) struct LoadDataFieldsOptions {
    terminated_by : String?
    enclosed_by : String?
    optionally_enclosed : Bool
    escaped_by : String?
    } derive(Eq,
    Debug
    )

    FIELDS options for LOAD DATA

    LoadDataFieldsOptions::equal

    LoadDataFieldsOptions::not_equal

    LoadDataFieldsOptions::output

    fn LoadDataFieldsOptions::output(self : LoadDataFieldsOptions, logger : &Logger) -> Unit

    LoadDataFieldsOptions::to_string

    fn LoadDataFieldsOptions::to_string(self : LoadDataFieldsOptions) -> String

    LoadDataLinesOptions

    pub(all) struct LoadDataLinesOptions {
    starting_by : String?
    terminated_by : String?
    } derive(Eq,
    Debug
    )

    LINES options for LOAD DATA

    LoadDataLinesOptions::equal

    LoadDataLinesOptions::not_equal

    LoadDataLinesOptions::output

    fn LoadDataLinesOptions::output(self : LoadDataLinesOptions, logger : &Logger) -> Unit

    LoadDataLinesOptions::to_string

    fn LoadDataLinesOptions::to_string(self : LoadDataLinesOptions) -> String

    LoadDataStmt

    pub(all) struct LoadDataStmt {
    is_local : Bool
    filename : String
    duplicate_handling : LoadDataDuplicateHandling?
    table_name : ObjectName
    character_set : String?
    fields_options : LoadDataFieldsOptions?
    lines_options : LoadDataLinesOptions?
    ignore_lines : Int?
    columns : Array[String]?
    set_assignments : Array[Assignment]?
    } derive(Eq,
    Debug
    )

    LOAD DATA statement for MySQL-style bulk data loading

    LoadDataStmt::equal

    LoadDataStmt::not_equal

    fn LoadDataStmt::not_equal(x : LoadDataStmt, y : LoadDataStmt) -> Bool

    LoadDataStmt::output

    fn LoadDataStmt::output(self : LoadDataStmt, logger : &Logger) -> Unit

    LoadDataStmt::to_string

    fn LoadDataStmt::to_string(self : LoadDataStmt) -> String

    MergeAction

    pub(all) enum MergeAction {
    Insert(Array[String], Array[Expr])
    Update(Array[Assignment])
    Delete
    } derive(Eq,
    Debug
    )

    Actions that can be performed in MERGE
    impl Show for MergeAction

    MergeAction::equal

    fn MergeAction::equal(MergeAction, MergeAction) -> Bool

    MergeAction::not_equal

    fn MergeAction::not_equal(x : MergeAction, y : MergeAction) -> Bool

    MergeAction::output

    fn MergeAction::output(self : MergeAction, logger : &Logger) -> Unit

    MergeAction::to_string

    fn MergeAction::to_string(self : MergeAction) -> String

    MergeMatchType

    pub(all) enum MergeMatchType {
    Matched
    NotMatched
    } derive(Eq,
    Debug
    )

    Match type for WHEN clause

    MergeMatchType::equal

    MergeMatchType::not_equal

    fn MergeMatchType::not_equal(x : MergeMatchType, y : MergeMatchType) -> Bool

    MergeMatchType::output

    fn MergeMatchType::output(self : MergeMatchType, logger : &Logger) -> Unit

    MergeMatchType::to_string

    fn MergeMatchType::to_string(self : MergeMatchType) -> String

    MergeSource

    pub(all) enum MergeSource {
    Table(ObjectName)
    Query(QueryStmt)
    } derive(Eq,
    Debug
    )

    Source for MERGE statement
    impl Show for MergeSource

    MergeSource::equal

    fn MergeSource::equal(MergeSource, MergeSource) -> Bool

    MergeSource::not_equal

    fn MergeSource::not_equal(x : MergeSource, y : MergeSource) -> Bool

    MergeSource::output

    fn MergeSource::output(self : MergeSource, logger : &Logger) -> Unit

    MergeSource::to_string

    fn MergeSource::to_string(self : MergeSource) -> String

    MergeStmt

    pub(all) struct MergeStmt {
    target_table : ObjectName
    target_alias : String?
    source : MergeSource
    source_alias : String?
    join_condition : Expr
    when_clauses : Array[MergeWhenClause]
    } derive(Eq,
    Debug
    )

    MERGE statement for conditional INSERT/UPDATE/DELETE operations
    impl Show for MergeStmt

    MergeStmt::equal

    fn MergeStmt::equal(MergeStmt, MergeStmt) -> Bool

    MergeStmt::not_equal

    fn MergeStmt::not_equal(x : MergeStmt, y : MergeStmt) -> Bool

    MergeStmt::output

    fn MergeStmt::output(self : MergeStmt, logger : &Logger) -> Unit

    MergeStmt::to_string

    fn MergeStmt::to_string(self : MergeStmt) -> String

    MergeWhenClause

    pub(all) struct MergeWhenClause {
    match_type : MergeMatchType
    condition : Expr?
    action : MergeAction
    } derive(Eq,
    Debug
    )

    WHEN clause in MERGE statement

    MergeWhenClause::equal

    MergeWhenClause::not_equal

    fn MergeWhenClause::not_equal(x : MergeWhenClause, y : MergeWhenClause) -> Bool

    MergeWhenClause::output

    fn MergeWhenClause::output(self : MergeWhenClause, logger : &Logger) -> Unit

    MergeWhenClause::to_string

    fn MergeWhenClause::to_string(self : MergeWhenClause) -> String

    MySQL

    pub(all) struct MySQL {
    }

    impl Dialect for MySQL

    MySQL::parse_expr

    fn MySQL::parse_expr(_self : MySQL, _tokens : ArrayView[Token]) -> (Expr, ArrayView[Token])? raise ParserError

    MySQL::parse_statement

    fn MySQL::parse_statement(_self : MySQL, parser : Parser, tokens : ArrayView[Token]) -> (Statement, ArrayView[Token])? raise ParserError

    MySQL::read_keyword

    fn MySQL::read_keyword(_self : MySQL, word : String) -> Keyword?

    MySQL::requires_column_types_in_create_table

    fn MySQL::requires_column_types_in_create_table(_self : MySQL) -> Bool

    MySQL::supports_array_syntax

    fn MySQL::supports_array_syntax(_self : MySQL) -> Bool

    MySQL::supports_boolean_literals

    fn MySQL::supports_boolean_literals(_self : MySQL) -> Bool

    MySQL::supports_double_quoted_identifiers

    fn MySQL::supports_double_quoted_identifiers(_self : MySQL) -> Bool

    MySQL::supports_filter_during_aggregation

    fn MySQL::supports_filter_during_aggregation(_self : MySQL) -> Bool

    MySQL::supports_if_not_exists

    fn MySQL::supports_if_not_exists(_self : MySQL) -> Bool

    MySQL::supports_named_parameters

    fn MySQL::supports_named_parameters(_self : MySQL) -> Bool

    MySQL::supports_string_literal_backslash_escape

    fn MySQL::supports_string_literal_backslash_escape(_self : MySQL) -> Bool

    MySQL::supports_within_after_array_aggregation

    fn MySQL::supports_within_after_array_aggregation(_self : MySQL) -> Bool

    ObjectName

    pub(all) struct ObjectName {
    parts : Array[String]
    } derive(Eq,
    Debug
    )

    impl Show for ObjectName

    ObjectName::equal

    fn ObjectName::equal(ObjectName, ObjectName) -> Bool

    ObjectName::not_equal

    fn ObjectName::not_equal(x : ObjectName, y : ObjectName) -> Bool

    ObjectName::output

    fn ObjectName::output(self : ObjectName, logger : &Logger) -> Unit

    ObjectName::to_string

    fn ObjectName::to_string(self : ObjectName) -> String

    OnConflictClause

    pub(all) struct OnConflictClause {
    conflict_target : ConflictTarget?
    conflict_action : ConflictAction
    } derive(Eq,
    Debug
    )

    PostgreSQL ON CONFLICT clause for advanced conflict resolution Syntax: ON CONFLICT [ conflict_target ] conflict_action

    OnConflictClause::equal

    OnConflictClause::not_equal

    fn OnConflictClause::not_equal(x : OnConflictClause, y : OnConflictClause) -> Bool

    OnConflictClause::output

    fn OnConflictClause::output(self : OnConflictClause, logger : &Logger) -> Unit

    OnConflictClause::to_string

    fn OnConflictClause::to_string(self : OnConflictClause) -> String

    OnInsert

    pub(all) enum OnInsert {
    DuplicateKeyUpdate(Array[Assignment])
    OnConflict(OnConflictClause)
    } derive(Eq,
    Debug
    )

    MySQL ON DUPLICATE KEY UPDATE or PostgreSQL ON CONFLICT
    impl Show for OnInsert

    OnInsert::equal

    fn OnInsert::equal(OnInsert, OnInsert) -> Bool

    OnInsert::not_equal

    fn OnInsert::not_equal(x : OnInsert, y : OnInsert) -> Bool

    OnInsert::output

    fn OnInsert::output(self : OnInsert, logger : &Logger) -> Unit

    OnInsert::to_repr

    OnInsert::to_string

    fn OnInsert::to_string(self : OnInsert) -> String

    OrderByExpr

    pub(all) struct OrderByExpr {
    expr : Expr
    asc : Bool?
    nulls_first : Bool?
    } derive(Eq,
    Debug
    )

    impl Show for OrderByExpr

    OrderByExpr::equal

    fn OrderByExpr::equal(OrderByExpr, OrderByExpr) -> Bool

    OrderByExpr::not_equal

    fn OrderByExpr::not_equal(x : OrderByExpr, y : OrderByExpr) -> Bool

    OrderByExpr::output

    fn OrderByExpr::output(self : OrderByExpr, logger : &Logger) -> Unit

    OrderByExpr::to_string

    fn OrderByExpr::to_string(self : OrderByExpr) -> String

    ParameterMode

    pub(all) enum ParameterMode {
    In
    Out
    InOut
    } derive(Eq,
    Debug
    )

    Parameter mode for functions/procedures

    ParameterMode::equal

    ParameterMode::not_equal

    fn ParameterMode::not_equal(x : ParameterMode, y : ParameterMode) -> Bool

    ParameterMode::output

    fn ParameterMode::output(self : ParameterMode, logger : &Logger) -> Unit

    ParameterMode::to_string

    fn ParameterMode::to_string(self : ParameterMode) -> String

    Parser

    pub struct Parser {
    dialect : &Dialect
    }

    Postgres

    pub(all) struct Postgres {
    }

    impl Dialect for Postgres

    Postgres::parse_expr

    fn Postgres::parse_expr(_self : Postgres, tokens : ArrayView[Token]) -> (Expr, ArrayView[Token])? raise ParserError

    Postgres::parse_statement

    fn Postgres::parse_statement(_self : Postgres, _parser : Parser, tokens : ArrayView[Token]) -> (Statement, ArrayView[Token])? raise ParserError

    Postgres::read_keyword

    fn Postgres::read_keyword(_self : Postgres, _word : String) -> Keyword?

    Postgres::requires_column_types_in_create_table

    fn Postgres::requires_column_types_in_create_table(_self : Postgres) -> Bool

    Postgres::supports_array_syntax

    fn Postgres::supports_array_syntax(_self : Postgres) -> Bool

    Postgres::supports_boolean_literals

    fn Postgres::supports_boolean_literals(_self : Postgres) -> Bool

    Postgres::supports_double_quoted_identifiers

    fn Postgres::supports_double_quoted_identifiers(_self : Postgres) -> Bool

    Postgres::supports_filter_during_aggregation

    fn Postgres::supports_filter_during_aggregation(_self : Postgres) -> Bool

    Postgres::supports_if_not_exists

    fn Postgres::supports_if_not_exists(_self : Postgres) -> Bool

    Postgres::supports_named_parameters

    fn Postgres::supports_named_parameters(_self : Postgres) -> Bool

    Postgres::supports_string_literal_backslash_escape

    fn Postgres::supports_string_literal_backslash_escape(_self : Postgres) -> Bool

    Postgres::supports_within_after_array_aggregation

    fn Postgres::supports_within_after_array_aggregation(_self : Postgres) -> Bool

    Precedence

    pub(all) enum Precedence {
    PlusMinus
    MulDivMod
    Eq
    Like
    And
    Or
    Between
    UnaryNot
    JsonOperator
    }

    Precedence::value

    fn Precedence::value(self : Precedence) -> Int

    PrepareStmt

    pub(all) struct PrepareStmt {
    name : String
    data_types : Array[DataType]
    statement : Statement
    } derive(Eq,
    Debug
    )

    PREPARE statement Syntax: PREPARE name [(data_type [, ...])] AS statement
    impl Show for PrepareStmt

    PrepareStmt::equal

    fn PrepareStmt::equal(PrepareStmt, PrepareStmt) -> Bool

    PrepareStmt::not_equal

    fn PrepareStmt::not_equal(x : PrepareStmt, y : PrepareStmt) -> Bool

    PrepareStmt::output

    fn PrepareStmt::output(self : PrepareStmt, logger : &Logger) -> Unit

    PrepareStmt::to_string

    fn PrepareStmt::to_string(self : PrepareStmt) -> String

    PrimaryDatetimeField

    type PrimaryDatetimeField derive(Eq,
    Debug
    )

    PrimaryDatetimeField::equal

    PrimaryDatetimeField::not_equal

    PrimaryDatetimeField::output

    fn PrimaryDatetimeField::output(self : PrimaryDatetimeField, logger : &Logger) -> Unit

    PrimaryDatetimeField::to_string

    fn PrimaryDatetimeField::to_string(self : PrimaryDatetimeField) -> String

    Privilege

    pub(all) enum Privilege {
    Select(Array[String]?)
    Insert(Array[String]?)
    Update(Array[String]?)
    Delete
    References(Array[String]?)
    Create
    Drop
    Alter
    Index
    All
    Usage
    Execute
    Connect
    Temporary
    } derive(Eq,
    Debug
    )

    impl Show for Privilege

    Privilege::equal

    fn Privilege::equal(Privilege, Privilege) -> Bool

    Privilege::not_equal

    fn Privilege::not_equal(x : Privilege, y : Privilege) -> Bool

    Privilege::output

    fn Privilege::output(self : Privilege, logger : &Logger) -> Unit

    Privilege::to_string

    fn Privilege::to_string(self : Privilege) -> String

    Projection

    pub(all) enum Projection {
    Wildcard
    UnamedExpr(Expr)
    AliasedExpr(Expr, String)
    } derive(Eq,
    Debug
    )

    impl Show for Projection

    Projection::equal

    fn Projection::equal(Projection, Projection) -> Bool

    Projection::not_equal

    fn Projection::not_equal(x : Projection, y : Projection) -> Bool

    Projection::output

    fn Projection::output(self : Projection, logger : &Logger) -> Unit

    Projection::to_string

    fn Projection::to_string(self : Projection) -> String

    QueryStmt

    pub(all) struct QueryStmt {
    with_clause : Array[Cte]?
    body : SetExpr
    order_by : Array[OrderByExpr]
    limit : Expr?
    offset : Expr?
    } derive(Eq,
    Debug
    )

    impl Show for QueryStmt

    QueryStmt::equal

    fn QueryStmt::equal(QueryStmt, QueryStmt) -> Bool

    QueryStmt::not_equal

    fn QueryStmt::not_equal(x : QueryStmt, y : QueryStmt) -> Bool

    QueryStmt::output

    fn QueryStmt::output(self : QueryStmt, logger : &Logger) -> Unit

    QueryStmt::to_string

    fn QueryStmt::to_string(self : QueryStmt) -> String

    Redshift

    pub(all) struct Redshift {
    }

    Redshift dialect - supports Amazon Redshift specific syntax
    impl Dialect for Redshift

    Redshift::parse_expr

    fn Redshift::parse_expr(_self : Redshift, _tokens : ArrayView[Token]) -> (Expr, ArrayView[Token])? raise ParserError

    Redshift::parse_statement

    fn Redshift::parse_statement(_self : Redshift, _parser : Parser, _tokens : ArrayView[Token]) -> (Statement, ArrayView[Token])? raise ParserError

    Redshift::read_keyword

    fn Redshift::read_keyword(_self : Redshift, _word : String) -> Keyword?

    Redshift::requires_column_types_in_create_table

    fn Redshift::requires_column_types_in_create_table(_self : Redshift) -> Bool

    Redshift::supports_array_syntax

    fn Redshift::supports_array_syntax(_self : Redshift) -> Bool

    Redshift::supports_boolean_literals

    fn Redshift::supports_boolean_literals(_self : Redshift) -> Bool

    Redshift::supports_double_quoted_identifiers

    fn Redshift::supports_double_quoted_identifiers(_self : Redshift) -> Bool

    Redshift::supports_filter_during_aggregation

    fn Redshift::supports_filter_during_aggregation(_self : Redshift) -> Bool

    Redshift::supports_if_not_exists

    fn Redshift::supports_if_not_exists(_self : Redshift) -> Bool

    Redshift::supports_named_parameters

    fn Redshift::supports_named_parameters(_self : Redshift) -> Bool

    Redshift::supports_string_literal_backslash_escape

    fn Redshift::supports_string_literal_backslash_escape(_self : Redshift) -> Bool

    Redshift::supports_within_after_array_aggregation

    fn Redshift::supports_within_after_array_aggregation(_self : Redshift) -> Bool

    ReleaseSavepointStmt

    pub(all) struct ReleaseSavepointStmt {
    savepoint_keyword : Bool
    name : String
    } derive(Eq,
    Debug
    )

    ReleaseSavepointStmt::equal

    ReleaseSavepointStmt::not_equal

    ReleaseSavepointStmt::output

    fn ReleaseSavepointStmt::output(self : ReleaseSavepointStmt, logger : &Logger) -> Unit

    ReleaseSavepointStmt::to_string

    fn ReleaseSavepointStmt::to_string(self : ReleaseSavepointStmt) -> String

    RevokeOption

    pub(all) enum RevokeOption {
    Restrict
    Cascade
    } derive(Eq,
    Debug
    )

    RevokeOption::equal

    RevokeOption::not_equal

    fn RevokeOption::not_equal(x : RevokeOption, y : RevokeOption) -> Bool

    RevokeOption::output

    fn RevokeOption::output(self : RevokeOption, logger : &Logger) -> Unit

    RevokeOption::to_string

    fn RevokeOption::to_string(self : RevokeOption) -> String

    RevokeStmt

    pub(all) struct RevokeStmt {
    grant_option_for : Bool
    privileges : Array[Privilege]
    objects : Array[ObjectName]
    grantees : Array[String]
    cascade : RevokeOption?
    } derive(Eq,
    Debug
    )

    impl Show for RevokeStmt

    RevokeStmt::equal

    fn RevokeStmt::equal(RevokeStmt, RevokeStmt) -> Bool

    RevokeStmt::not_equal

    fn RevokeStmt::not_equal(x : RevokeStmt, y : RevokeStmt) -> Bool

    RevokeStmt::output

    fn RevokeStmt::output(self : RevokeStmt, logger : &Logger) -> Unit

    RevokeStmt::to_string

    fn RevokeStmt::to_string(self : RevokeStmt) -> String

    RollbackStmt

    pub(all) struct RollbackStmt {
    work : Bool
    transaction : Bool
    savepoint : String?
    } derive(Eq,
    Debug
    )

    RollbackStmt::equal

    RollbackStmt::not_equal

    fn RollbackStmt::not_equal(x : RollbackStmt, y : RollbackStmt) -> Bool

    RollbackStmt::output

    fn RollbackStmt::output(self : RollbackStmt, logger : &Logger) -> Unit

    RollbackStmt::to_string

    fn RollbackStmt::to_string(self : RollbackStmt) -> String

    SQLite

    pub(all) struct SQLite {
    }

    impl Dialect for SQLite

    SQLite::parse_expr

    fn SQLite::parse_expr(_self : SQLite, _tokens : ArrayView[Token]) -> (Expr, ArrayView[Token])? raise ParserError

    SQLite::parse_statement

    fn SQLite::parse_statement(_self : SQLite, _parser : Parser, _tokens : ArrayView[Token]) -> (Statement, ArrayView[Token])? raise ParserError

    SQLite::read_keyword

    fn SQLite::read_keyword(_self : SQLite, _word : String) -> Keyword?

    SQLite::requires_column_types_in_create_table

    fn SQLite::requires_column_types_in_create_table(_self : SQLite) -> Bool

    SQLite::supports_array_syntax

    fn SQLite::supports_array_syntax(_self : SQLite) -> Bool

    SQLite::supports_boolean_literals

    fn SQLite::supports_boolean_literals(_self : SQLite) -> Bool

    SQLite::supports_double_quoted_identifiers

    fn SQLite::supports_double_quoted_identifiers(_self : SQLite) -> Bool

    SQLite::supports_filter_during_aggregation

    fn SQLite::supports_filter_during_aggregation(_self : SQLite) -> Bool

    SQLite::supports_if_not_exists

    fn SQLite::supports_if_not_exists(_self : SQLite) -> Bool

    SQLite::supports_named_parameters

    fn SQLite::supports_named_parameters(_self : SQLite) -> Bool

    SQLite::supports_string_literal_backslash_escape

    fn SQLite::supports_string_literal_backslash_escape(_self : SQLite) -> Bool

    SQLite::supports_within_after_array_aggregation

    fn SQLite::supports_within_after_array_aggregation(_self : SQLite) -> Bool

    SavepointStmt

    pub(all) struct SavepointStmt {
    name : String
    } derive(Eq,
    Debug
    )

    SavepointStmt::equal

    SavepointStmt::not_equal

    fn SavepointStmt::not_equal(x : SavepointStmt, y : SavepointStmt) -> Bool

    SavepointStmt::output

    fn SavepointStmt::output(self : SavepointStmt, logger : &Logger) -> Unit

    SavepointStmt::to_string

    fn SavepointStmt::to_string(self : SavepointStmt) -> String

    SelectStmt

    type SelectStmt derive(Eq,
    Debug
    )

    impl Show for SelectStmt

    SelectStmt::equal

    fn SelectStmt::equal(SelectStmt, SelectStmt) -> Bool

    SelectStmt::not_equal

    fn SelectStmt::not_equal(x : SelectStmt, y : SelectStmt) -> Bool

    SelectStmt::output

    fn SelectStmt::output(self : SelectStmt, logger : &Logger) -> Unit

    SelectStmt::to_string

    fn SelectStmt::to_string(self : SelectStmt) -> String

    SequenceLimit

    pub(all) enum SequenceLimit {
    Value(Int)
    NoLimit
    } derive(Eq,
    Debug
    )

    Sequence limit specification

    SequenceLimit::equal

    SequenceLimit::not_equal

    fn SequenceLimit::not_equal(x : SequenceLimit, y : SequenceLimit) -> Bool

    SequenceLimit::output

    fn SequenceLimit::output(self : SequenceLimit, logger : &Logger) -> Unit

    SequenceLimit::to_string

    fn SequenceLimit::to_string(self : SequenceLimit) -> String

    SequenceOwnedBy

    pub(all) enum SequenceOwnedBy {
    Column(ObjectName, String)
    ByNone
    } derive(Eq,
    Debug
    )

    OWNED BY specification for sequences

    SequenceOwnedBy::equal

    SequenceOwnedBy::not_equal

    fn SequenceOwnedBy::not_equal(x : SequenceOwnedBy, y : SequenceOwnedBy) -> Bool

    SequenceOwnedBy::output

    fn SequenceOwnedBy::output(self : SequenceOwnedBy, logger : &Logger) -> Unit

    SequenceOwnedBy::to_string

    fn SequenceOwnedBy::to_string(self : SequenceOwnedBy) -> String

    SetAssignment

    pub(all) struct SetAssignment {
    variable : String
    value : Expr
    } derive(Eq,
    Debug
    )

    SetAssignment::equal

    SetAssignment::not_equal

    fn SetAssignment::not_equal(x : SetAssignment, y : SetAssignment) -> Bool

    SetAssignment::output

    fn SetAssignment::output(self : SetAssignment, logger : &Logger) -> Unit

    SetAssignment::to_string

    fn SetAssignment::to_string(self : SetAssignment) -> String

    SetExpr

    impl Show for SetExpr

    SetExpr::equal

    fn SetExpr::equal(SetExpr, SetExpr) -> Bool

    SetExpr::not_equal

    fn SetExpr::not_equal(x : SetExpr, y : SetExpr) -> Bool

    SetExpr::output

    fn SetExpr::output(self : SetExpr, logger : &Logger) -> Unit

    SetExpr::to_repr

    SetExpr::to_string

    fn SetExpr::to_string(self : SetExpr) -> String

    SetOperator

    type SetOperator derive(Eq,
    Debug
    )

    impl Show for SetOperator

    SetOperator::equal

    fn SetOperator::equal(SetOperator, SetOperator) -> Bool

    SetOperator::not_equal

    fn SetOperator::not_equal(x : SetOperator, y : SetOperator) -> Bool

    SetOperator::output

    fn SetOperator::output(self : SetOperator, logger : &Logger) -> Unit

    SetOperator::to_string

    fn SetOperator::to_string(self : SetOperator) -> String

    SetScope

    pub(all) enum SetScope {
    Global
    Session
    UserVar
    Local
    } derive(Eq,
    Debug
    )

    impl Show for SetScope

    SetScope::equal

    fn SetScope::equal(SetScope, SetScope) -> Bool

    SetScope::not_equal

    fn SetScope::not_equal(x : SetScope, y : SetScope) -> Bool

    SetScope::output

    fn SetScope::output(self : SetScope, logger : &Logger) -> Unit

    SetScope::to_repr

    SetScope::to_string

    fn SetScope::to_string(self : SetScope) -> String

    SetStmt

    pub(all) struct SetStmt {
    scope : SetScope
    assignments : Array[SetAssignment]
    } derive(Eq,
    Debug
    )

    impl Show for SetStmt

    SetStmt::equal

    fn SetStmt::equal(SetStmt, SetStmt) -> Bool

    SetStmt::not_equal

    fn SetStmt::not_equal(x : SetStmt, y : SetStmt) -> Bool

    SetStmt::output

    fn SetStmt::output(self : SetStmt, logger : &Logger) -> Unit

    SetStmt::to_repr

    SetStmt::to_string

    fn SetStmt::to_string(self : SetStmt) -> String

    ShowFilter

    pub(all) enum ShowFilter {
    Like(String)
    Where(Expr)
    } derive(Eq,
    Debug
    )

    impl Show for ShowFilter

    ShowFilter::equal

    fn ShowFilter::equal(ShowFilter, ShowFilter) -> Bool

    ShowFilter::not_equal

    fn ShowFilter::not_equal(x : ShowFilter, y : ShowFilter) -> Bool

    ShowFilter::output

    fn ShowFilter::output(self : ShowFilter, logger : &Logger) -> Unit

    ShowFilter::to_string

    fn ShowFilter::to_string(self : ShowFilter) -> String

    ShowStmt

    pub(all) struct ShowStmt {
    show_type : ShowType
    object : ObjectName?
    filter : ShowFilter?
    extended : Bool
    full : Bool
    global_scope : Bool
    } derive(Eq,
    Debug
    )

    MySQL SHOW statement
    impl Show for ShowStmt

    ShowStmt::equal

    fn ShowStmt::equal(ShowStmt, ShowStmt) -> Bool

    ShowStmt::not_equal

    fn ShowStmt::not_equal(x : ShowStmt, y : ShowStmt) -> Bool

    ShowStmt::output

    fn ShowStmt::output(self : ShowStmt, logger : &Logger) -> Unit

    ShowStmt::to_repr

    ShowStmt::to_string

    fn ShowStmt::to_string(self : ShowStmt) -> String

    ShowType

    pub(all) enum ShowType {
    Tables
    Columns
    Status
    Databases
    Schemas
    Variables
    Processlist
    Grants
    Functions
    CreateTable
    CreateView
    CreateFunction
    CreateProcedure
    CreateEvent
    CreateTrigger
    } derive(Eq,
    Debug
    )

    impl Show for ShowType

    ShowType::equal

    fn ShowType::equal(ShowType, ShowType) -> Bool

    ShowType::not_equal

    fn ShowType::not_equal(x : ShowType, y : ShowType) -> Bool

    ShowType::output

    fn ShowType::output(self : ShowType, logger : &Logger) -> Unit

    ShowType::to_repr

    ShowType::to_string

    fn ShowType::to_string(self : ShowType) -> String

    Snowflake

    pub(all) struct Snowflake {
    }

    Snowflake dialect - supports Snowflake specific syntax

    Snowflake::parse_expr

    fn Snowflake::parse_expr(_self : Snowflake, _tokens : ArrayView[Token]) -> (Expr, ArrayView[Token])? raise ParserError

    Snowflake::parse_statement

    fn Snowflake::parse_statement(_self : Snowflake, _parser : Parser, _tokens : ArrayView[Token]) -> (Statement, ArrayView[Token])? raise ParserError

    Snowflake::read_keyword

    fn Snowflake::read_keyword(_self : Snowflake, _word : String) -> Keyword?

    Snowflake::requires_column_types_in_create_table

    fn Snowflake::requires_column_types_in_create_table(_self : Snowflake) -> Bool

    Snowflake::supports_array_syntax

    fn Snowflake::supports_array_syntax(_self : Snowflake) -> Bool

    Snowflake::supports_boolean_literals

    fn Snowflake::supports_boolean_literals(_self : Snowflake) -> Bool

    Snowflake::supports_double_quoted_identifiers

    fn Snowflake::supports_double_quoted_identifiers(_self : Snowflake) -> Bool

    Snowflake::supports_filter_during_aggregation

    fn Snowflake::supports_filter_during_aggregation(_self : Snowflake) -> Bool

    Snowflake::supports_if_not_exists

    fn Snowflake::supports_if_not_exists(_self : Snowflake) -> Bool

    Snowflake::supports_named_parameters

    fn Snowflake::supports_named_parameters(_self : Snowflake) -> Bool

    Snowflake::supports_string_literal_backslash_escape

    fn Snowflake::supports_string_literal_backslash_escape(_self : Snowflake) -> Bool

    Snowflake::supports_within_after_array_aggregation

    fn Snowflake::supports_within_after_array_aggregation(_self : Snowflake) -> Bool

    SqliteOnConflict

    pub(all) enum SqliteOnConflict {
    Rollback
    Abort
    Fail
    Ignore
    Replace
    } derive(Eq,
    Debug
    )

    SQLite-style conflict resolution for INSERT statements See: https://sqlite.org/lang_conflict.html

    SqliteOnConflict::equal

    SqliteOnConflict::not_equal

    fn SqliteOnConflict::not_equal(x : SqliteOnConflict, y : SqliteOnConflict) -> Bool

    SqliteOnConflict::output

    fn SqliteOnConflict::output(self : SqliteOnConflict, logger : &Logger) -> Unit

    SqliteOnConflict::to_string

    fn SqliteOnConflict::to_string(self : SqliteOnConflict) -> String

    Statement

    pub(all) enum Statement {
    Query(QueryStmt)
    CreateTable(CreateTableStmt)
    CreateView(CreateViewStmt)
    CreateIndex(CreateIndexStmt)
    CreateDatabase(CreateDatabaseStmt)
    CreateSchema(CreateSchemaStmt)
    CreateFunction(CreateFunctionStmt)
    CreateProcedure(CreateProcedureStmt)
    CreateSequence(CreateSequenceStmt)
    DropView(DropViewStmt)
    DropTable(DropTableStmt)
    DropIndex(DropIndexStmt)
    Insert(InsertStmt)
    Delete(DeleteStmt)
    Update(UpdateStmt)
    Merge(MergeStmt)
    Truncate(TruncateStmt)
    AlterTable(AlterTableStmt)
    AlterIndex(AlterIndexStmt)
    Show(ShowStmt)
    Set(SetStmt)
    Use(UseStmt)
    Copy(CopyStmt)
    LoadData(LoadDataStmt)
    Prepare(PrepareStmt)
    Execute(ExecuteStmt)
    Deallocate(DeallocateStmt)
    LockTables(Array[ObjectName])
    UnlockTables
    Listen(String)
    Notify(String, String?)
    Begin(BeginStmt)
    Commit(CommitStmt)
    Rollback(RollbackStmt)
    Savepoint(SavepointStmt)
    ReleaseSavepoint(ReleaseSavepointStmt)
    Grant(GrantStmt)
    Revoke(RevokeStmt)
    } derive(Eq,
    Debug
    )

    impl Show for Statement

    Statement::equal

    fn Statement::equal(Statement, Statement) -> Bool

    Statement::not_equal

    fn Statement::not_equal(x : Statement, y : Statement) -> Bool

    Statement::output

    fn Statement::output(self : Statement, logger : &Logger) -> Unit

    Statement::to_string

    fn Statement::to_string(self : Statement) -> String

    Statements

    pub(all) struct Statements {
    stmts : Array[Statement]
    } derive(Eq,
    Debug
    )

    impl Show for Statements

    Statements::equal

    fn Statements::equal(Statements, Statements) -> Bool

    Statements::get

    #alias("_[_]")
    fn Statements::get(self : Statements, index : Int) -> Statement

    Statements::not_equal

    fn Statements::not_equal(x : Statements, y : Statements) -> Bool

    Statements::output

    fn Statements::output(self : Statements, logger : &Logger) -> Unit

    Statements::to_string

    fn Statements::to_string(self : Statements) -> String

    Subscript

    pub(all) enum Subscript {
    Index(Expr)
    Slice(Expr?, Expr?, Expr?)
    } derive(Eq,
    Debug
    )

    Subscript expression for array indexing and slicing
    impl Show for Subscript

    Subscript::equal

    fn Subscript::equal(Subscript, Subscript) -> Bool

    Subscript::not_equal

    fn Subscript::not_equal(x : Subscript, y : Subscript) -> Bool

    Subscript::output

    fn Subscript::output(self : Subscript, logger : &Logger) -> Unit

    Subscript::to_string

    fn Subscript::to_string(self : Subscript) -> String

    TableAlias

    pub(all) struct TableAlias {
    name : String
    columns : Array[String]
    } derive(Eq,
    Debug
    )

    impl Show for TableAlias

    TableAlias::equal

    fn TableAlias::equal(TableAlias, TableAlias) -> Bool

    TableAlias::not_equal

    fn TableAlias::not_equal(x : TableAlias, y : TableAlias) -> Bool

    TableAlias::output

    fn TableAlias::output(self : TableAlias, logger : &Logger) -> Unit

    TableAlias::to_string

    fn TableAlias::to_string(self : TableAlias) -> String

    TableConstraint

    pub(all) enum TableConstraint {
    Unique(Array[OrderByExpr])
    PrimaryKey(Array[OrderByExpr])
    ForeignKey(columns~ : Array[OrderByExpr], foreign_table~ : ObjectName, foreign_columns~ : Array[String])
    Check(Expr)
    } derive(Eq,
    Debug
    )

    TableConstraint::equal

    TableConstraint::not_equal

    fn TableConstraint::not_equal(x : TableConstraint, y : TableConstraint) -> Bool

    TableConstraint::output

    fn TableConstraint::output(self : TableConstraint, logger : &Logger) -> Unit

    TableConstraint::to_string

    fn TableConstraint::to_string(self : TableConstraint) -> String

    TableFactor

    pub(all) enum TableFactor {
    Column(ObjectName, TableAlias?)
    SubQuery(QueryStmt, TableAlias?)
    } derive(Eq,
    Debug
    )

    impl Show for TableFactor

    TableFactor::equal

    fn TableFactor::equal(TableFactor, TableFactor) -> Bool

    TableFactor::not_equal

    fn TableFactor::not_equal(x : TableFactor, y : TableFactor) -> Bool

    TableFactor::output

    fn TableFactor::output(self : TableFactor, logger : &Logger) -> Unit

    TableFactor::to_string

    fn TableFactor::to_string(self : TableFactor) -> String

    TableRef

    pub(all) struct TableRef {
    factor : TableFactor
    joins : Array[Join]
    } derive(Eq,
    Debug
    )

    impl Show for TableRef

    TableRef::equal

    fn TableRef::equal(TableRef, TableRef) -> Bool

    TableRef::not_equal

    fn TableRef::not_equal(x : TableRef, y : TableRef) -> Bool

    TableRef::output

    fn TableRef::output(self : TableRef, logger : &Logger) -> Unit

    TableRef::to_repr

    TableRef::to_string

    fn TableRef::to_string(self : TableRef) -> String

    Token

    pub(all) enum Token {
    Keyword(Keyword)
    Identifier(String)
    Number(String)
    StringLiteral(String)
    Boolean(Bool)
    Comma
    Semicolon
    Colon
    Eq
    DoubleEq
    Neq
    Lt
    Gt
    LtEq
    GtEq
    Spaceship
    Plus
    Minus
    Mul
    Div
    Mod
    LBracket
    RBracket
    LBrace
    RBrace
    LParen
    RParen
    Period
    Placeholder(String)
    JsonExtract
    JsonExtractText
    JsonExtractPath
    JsonExtractPathText
    JsonContains
    JsonContainedIn
    Unknown(Char)
    Eof
    } derive(Eq,
    Debug
    )

    impl Show for Token

    Token::equal

    fn Token::equal(Token, Token) -> Bool

    Token::not_equal

    fn Token::not_equal(x : Token, y : Token) -> Bool

    Token::output

    fn Token::output(self : Token, logger : &Logger) -> Unit

    Token::to_repr

    Token::to_string

    fn Token::to_string(self : Token) -> String

    Top

    pub(all) enum Top {
    Constant(Int)
    Expr(Expr)
    } derive(Eq,
    Debug
    )

    impl Show for Top

    Top::equal

    fn Top::equal(Top, Top) -> Bool

    Top::not_equal

    fn Top::not_equal(x : Top, y : Top) -> Bool

    Top::output

    fn Top::output(self : Top, logger : &Logger) -> Unit

    Top::to_repr

    Top::to_string

    fn Top::to_string(self : Top) -> String

    TruncateStmt

    pub(all) struct TruncateStmt {
    table_name : ObjectName
    } derive(Eq,
    Debug
    )

    TruncateStmt::equal

    TruncateStmt::not_equal

    fn TruncateStmt::not_equal(x : TruncateStmt, y : TruncateStmt) -> Bool

    TruncateStmt::output

    fn TruncateStmt::output(self : TruncateStmt, logger : &Logger) -> Unit

    TruncateStmt::to_string

    fn TruncateStmt::to_string(self : TruncateStmt) -> String

    UnaryOperator

    pub(all) enum UnaryOperator {
    Plus
    Minus
    Not
    } derive(Eq,
    Debug
    )

    UnaryOperator::equal

    UnaryOperator::not_equal

    fn UnaryOperator::not_equal(x : UnaryOperator, y : UnaryOperator) -> Bool

    UnaryOperator::output

    fn UnaryOperator::output(self : UnaryOperator, logger : &Logger) -> Unit

    UnaryOperator::to_string

    fn UnaryOperator::to_string(self : UnaryOperator) -> String

    UpdateStmt

    pub(all) struct UpdateStmt {
    table_name : ObjectName
    assignments : Array[Assignment]
    where_clause : Expr?
    } derive(Eq,
    Debug
    )

    impl Show for UpdateStmt

    UpdateStmt::equal

    fn UpdateStmt::equal(UpdateStmt, UpdateStmt) -> Bool

    UpdateStmt::not_equal

    fn UpdateStmt::not_equal(x : UpdateStmt, y : UpdateStmt) -> Bool

    UpdateStmt::output

    fn UpdateStmt::output(self : UpdateStmt, logger : &Logger) -> Unit

    UpdateStmt::to_string

    fn UpdateStmt::to_string(self : UpdateStmt) -> String

    UseStmt

    pub(all) struct UseStmt {
    database_name : ObjectName
    } derive(Eq,
    Debug
    )

    USE database statement for database switching
    impl Show for UseStmt

    UseStmt::equal

    fn UseStmt::equal(UseStmt, UseStmt) -> Bool

    UseStmt::not_equal

    fn UseStmt::not_equal(x : UseStmt, y : UseStmt) -> Bool

    UseStmt::output

    fn UseStmt::output(self : UseStmt, logger : &Logger) -> Unit

    UseStmt::to_repr

    UseStmt::to_string

    fn UseStmt::to_string(self : UseStmt) -> String

    ViewColumnDef

    pub(all) struct ViewColumnDef {
    name : String
    } derive(Eq,
    Debug
    )

    ViewColumnDef::equal

    ViewColumnDef::not_equal

    fn ViewColumnDef::not_equal(x : ViewColumnDef, y : ViewColumnDef) -> Bool

    ViewColumnDef::output

    fn ViewColumnDef::output(self : ViewColumnDef, logger : &Logger) -> Unit

    ViewColumnDef::to_string

    fn ViewColumnDef::to_string(self : ViewColumnDef) -> String

    WindowFrameBound

    pub(all) enum WindowFrameBound {
    UnboundedPreceding
    UnboundedFollowing
    CurrentRow
    Preceding(Expr)
    Following(Expr)
    } derive(Eq,
    Debug
    )

    Window frame bound

    WindowFrameBound::equal

    WindowFrameBound::not_equal

    fn WindowFrameBound::not_equal(x : WindowFrameBound, y : WindowFrameBound) -> Bool

    WindowFrameBound::output

    fn WindowFrameBound::output(self : WindowFrameBound, logger : &Logger) -> Unit

    WindowFrameBound::to_string

    fn WindowFrameBound::to_string(self : WindowFrameBound) -> String

    WindowFrameClause

    pub(all) struct WindowFrameClause {
    frame_units : WindowFrameUnits
    frame_start : WindowFrameBound
    frame_end : WindowFrameBound?
    } derive(Eq,
    Debug
    )

    Window frame clause

    WindowFrameClause::equal

    WindowFrameClause::not_equal

    fn WindowFrameClause::not_equal(x : WindowFrameClause, y : WindowFrameClause) -> Bool

    WindowFrameClause::output

    fn WindowFrameClause::output(self : WindowFrameClause, logger : &Logger) -> Unit

    WindowFrameClause::to_string

    fn WindowFrameClause::to_string(self : WindowFrameClause) -> String

    WindowFrameUnits

    pub(all) enum WindowFrameUnits {
    Rows
    Range
    } derive(Eq,
    Debug
    )

    Window frame units

    WindowFrameUnits::equal

    WindowFrameUnits::not_equal

    fn WindowFrameUnits::not_equal(x : WindowFrameUnits, y : WindowFrameUnits) -> Bool

    WindowFrameUnits::output

    fn WindowFrameUnits::output(self : WindowFrameUnits, logger : &Logger) -> Unit

    WindowFrameUnits::to_string

    fn WindowFrameUnits::to_string(self : WindowFrameUnits) -> String

    WindowSpec

    pub(all) struct WindowSpec {
    partition_by : Array[Expr]
    order_by : Array[OrderByExpr]
    frame_clause : WindowFrameClause?
    } derive(Eq,
    Debug
    )

    Window function specification: OVER ([PARTITION BY ...] [ORDER BY ...] [frame_clause])
    impl Show for WindowSpec

    WindowSpec::equal

    fn WindowSpec::equal(WindowSpec, WindowSpec) -> Bool

    WindowSpec::not_equal

    fn WindowSpec::not_equal(x : WindowSpec, y : WindowSpec) -> Bool

    WindowSpec::output

    fn WindowSpec::output(self : WindowSpec, logger : &Logger) -> Unit

    WindowSpec::to_string

    fn WindowSpec::to_string(self : WindowSpec) -> String

    parse

    fn parse(tokens : ArrayView[Token], dialect? : &Dialect) -> Array[Statement] raise ParserError

    parse_sql

    fn parse_sql(dialect? : &Dialect, input : String) -> Statements raise SqlParserError

    pretty_print

    fn[T :
    Pretty
    ] pretty_print(obj : T) -> String

    structural_print

    fn[T : Show] structural_print(obj : T) -> String

    tokenize

    fn tokenize(dialect? : &Dialect, input : String) -> Array[Token] raise LexerError