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

SELECT DISTINCT syntax no longer works #5172

Closed
lnhrdt opened this issue Apr 19, 2024 · 1 comment · Fixed by #5174
Closed

SELECT DISTINCT syntax no longer works #5172

lnhrdt opened this issue Apr 19, 2024 · 1 comment · Fixed by #5174

Comments

@lnhrdt
Copy link
Contributor

lnhrdt commented Apr 19, 2024

SQLDelight Version

2.0.2

SQLDelight Dialect

postgresql

Describe the Bug

I used to be able to write syntax like SELECT DISTINCT col1, col2 FROM ... but since the introduction of DISTINCT ON I can only write SELECT DISTINCT ON (col1, col2) col1, col2 FROM ....

I would prefer to keep both syntaxes to not break migrations that were written before the DISTINCT ON syntax was introduced.

This is a followup from #4584 (comment)

Stacktrace

compile errors from the plugin of the form:

`ON expected, got 'col1'`
@lnhrdt lnhrdt added the bug label Apr 19, 2024
@griffio
Copy link
Contributor

griffio commented Apr 19, 2024

I will create a PR as it looks like the grammar needs a small change to fix it 🔨

Also tests are needed for the basic SELECT DISTINCT as there doesn't appear to be any in the base sql-psi grammar.

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

Successfully merging a pull request may close this issue.

3 participants