Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DerSaidin opened this issue Mar 24, 2021 · 1 comment
Open

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

DerSaidin opened this issue Mar 24, 2021 · 1 comment

Comments

@DerSaidin
Copy link

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.

@maxcountryman
Copy link
Contributor

I believe the intent is to address this kind of thing in #189.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants