-
Notifications
You must be signed in to change notification settings - Fork 35
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
Pass a list or array of columns to orderBy #8
Comments
Awesome project. I would like to try to tackle this issue if you wanted to provide some further direction on what you had in mind. My interpretation of the task is below. Looking at the existing method signature it looks like the Might be powerful if the
or some sort of pipe delimited list: Let me know if I'm on the right track with what you were picturing. I'm really trying to get my head around writing tests and this seemed like cool project to learn from and try to help out in the process. |
Thanks, Tim! You are 100% on the right track! One of the things I've tried to do with qb is to have many ways to accomplish the same task. That way you never feel like the tool is saying "You're doing it wrong!" With that in mind, I'd like to cover three additional use cases: builder.from( "users" ).orderBy( [
"last_name",
[ "age", "desc" ],
{ column = "favorite_color", direction = "desc" }
] ).orderBy( "stars" ); would compile to SELECT * FROM "users" ORDER BY "last_name" ASC, "age" DESC, "favorite_color", DESC, "stars" ASC So I'd like to accept:
A couple other criteria I can think of:
Hopefully that doesn't scare you away! I think this is a great feature to work on TDD with, like you said. You can find the existing
Feel free to push early and often and ask questions along the way. You don't need to finish with all of it before opening a pull request. Heck, GitHub says they open pull requests before they start coding sometimes! Thanks again, and I'm excited to work with you! |
…-modules#8 to accept an array or list as the column argument's value. The array can accept a variety of value formats that can be intermingled if desired. All scenarios will inherit eithe the default direction or the supplied value for the direction argument.
…array, removed lists as a valid value for array value and refactored validDirections array to be an instance variable aptly named to match the other naming conventions.
…ccept an array or list as the column argument's value. The array can accept a variety of value formats that can be intermingled if desired. All scenarios will inherit eithe the default direction or the supplied value for the direction argument.
…lists as a valid value for array value and refactored validDirections array to be an instance variable aptly named to match the other naming conventions.
Feature available in |
No description provided.
The text was updated successfully, but these errors were encountered: