Skip to content

Parse errors should show location of error in input sql string #301

Open
@DerSaidin

Description

@DerSaidin

When rust compiler finds a problem, it shows me exactly where to look:

error[E0308]: mismatched types
  --> src/main.rs:73:12
   |
72 | fn foo() -> String {
   |             ------ expected `std::string::String` because of return type
73 |     return 42;
   |            ^^
   |            |
   |            expected struct `std::string::String`, found integer
   |            help: try using a conversion method: `42.to_string()`

When Parser::parse_sql(...) fails, it does not tell the user what part of the input caused the error:

sql parser error: Expected end of statement, found: ENGINE

The error should provide a position in the input sql string. Bonus points if it has nice presentation like the rust compiler error messages.

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