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

sqlparser bug: Cannot resolve ColumnBuilder with .named() column #50

Closed
Mike278 opened this issue Jul 1, 2019 · 2 comments
Closed

sqlparser bug: Cannot resolve ColumnBuilder with .named() column #50

Mike278 opened this issue Jul 1, 2019 · 2 comments

Comments

@Mike278
Copy link
Contributor

Mike278 commented Jul 1, 2019

In the moor_flutter/example project, adding the query SELECT id FROM categories WHERE desc = ? fails to parse:

Error while trying to parse SELECT id FROM categories WHERE desc = ?: line 1, column 38: Error: Could not parse this expression}

1 │ SELECT id FROM categories WHERE desc = ?
  │                                      ^

Removing .named('desc') from the table declaration and updating the query to SELECT id FROM categories WHERE description = ? is a workaround.

@Mike278 Mike278 changed the title sqlparser: Cannot resolve ColumnBuilder with .named() column sqlparser bug: Cannot resolve ColumnBuilder with .named() column Jul 2, 2019
@Mike278
Copy link
Contributor Author

Mike278 commented Jul 2, 2019

Hah - this is probably because desc is ambiguous with the DESC keyword. Updating to .named('descr') parses correctly.

@Mike278 Mike278 closed this as completed Jul 2, 2019
@simolus3
Copy link
Owner

simolus3 commented Jul 2, 2019

Yup, fails because it's a keyword. You could also escape column name with double quotes though.

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