Skip to content

Parameterized queries #291

Description

@Jasperav

This fails to parse, but it can be successfully executed by SQLite (after providing a value for the parameter):

#[test]
fn go() {
    use sqlparser::dialect::SQLiteDialect;
    use sqlparser::parser::Parser;

    let sql = "select * from test_table where test_column = ?;";

    let dialect = SQLiteDialect {}; // or AnsiDialect, or your own dialect ...

    let ast = Parser::parse_sql(&dialect, sql).unwrap();

    println!("AST: {:#?}", ast);
}

Any idea why I get this error message?:

called Result::unwrap() on an Err value: ParserError("Expected an expression, found: ?")
thread 'dynamic_queries::go' panicked at 'called Result::unwrap() on an Err value: ParserError("Expected an expression, found: ?")',

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions