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

Case expressions must be orderable #282

Closed
atombender opened this issue Jul 6, 2021 · 2 comments
Closed

Case expressions must be orderable #282

atombender opened this issue Jul 6, 2021 · 2 comments
Assignees

Comments

@atombender
Copy link

atombender commented Jul 6, 2021

Is your feature request related to a problem? Please describe.
It should be possible to express queries like:

SELECT * FROM articles
ORDER BY CASE
  WHEN published THEN published_at
  ELSE timestamptz '1900-01-01'
END

However, CaseExpression is not orderable, so you can't do:

q.Order(goqu.Case(...).Asc())

Describe the solution you'd like
Case() should return an orderable expression.

@doug-martin
Copy link
Owner

@atombender thank you for your feature request! This has been released under v9.16.0

@atombender
Copy link
Author

Awesome, thanks!

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