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

[Feat]: Enum to ORDER BY CASE statement #154

Open
GeekMasher opened this issue Dec 1, 2024 · 0 comments
Open

[Feat]: Enum to ORDER BY CASE statement #154

GeekMasher opened this issue Dec 1, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@GeekMasher
Copy link
Contributor

What new feature are you looking for / expect?

To get better support for enums we should all support for when .order("column", Order::Asc) is used we generate a CASE

enum UserState {
    Active,
    Inactive,
    Banned,
}

This turns into:

ORDER BY 
  CASE ID
    WHEN 'Active' THEN 0
    WHEN 'Inactive' THEN 1
    WHEN 'Banned' THEN 2
  END

Sources

Expectations

Nice to have

@GeekMasher GeekMasher added the enhancement New feature or request label Dec 1, 2024
@GeekMasher GeekMasher self-assigned this Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant