-
Notifications
You must be signed in to change notification settings - Fork 11
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
Arbitrary SELECTs #6
Comments
I like this idea (the first one, especially) but my only immediate thought is that it could be tricky to know what type to cast the value to for things that aren't as simple as a |
Exactly what I was thinking. I noticed that valium rewrite the select() instruction. As DISTINCT is such a common case, adding a unique_value_of to valium would be great! |
I'd like to select and perform a Any ideas how to accomplish that using Valium? |
This would also be useful for things like hstore: Person.values_of("data -> name") |
I don't know if this is feasible or in scope, but it would be pretty cool if one could use arbitrary select criteria.
So like:
Shoe.value_of "DISTINCT category"
or
Shoe.select('DISTINCT category AS category').value_of :category
Instead of
Shoe.select('DISTINCT category AS category').map(&:category)
Unless there is already a good way to do this, with or without valium.
The text was updated successfully, but these errors were encountered: