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
Alternative syntax for .where()
#14
Comments
Why is this needed? We have a builder syntax which is more concise, clearer to look at and doesn't create lots of unnecessary objects for each clause (this basically creates Current API (would be) is builder.whereEqual('field1', 'value')
.whereBetween('field2', -100, 100)
.whereMore('field3', 100)
.whereLess('field4', 100)
...
.whereIn('field10', [1, 2, 3]) Is this needed for some programmatic use of making batch queries, then we can come up with a more efficient syntax I think? |
See comment: #15 (review) where({
field1: between(-100, 100),
field2: greater(100),
field3: less(100),
}) or where({
field1: { greater: -100, less: 100 },
field2: { greater: 100 },
field3: { less: 100 },
}) or where({
field1: { '>': -100, '<': 100 },
field2: { '>': 100 },
field3: { '<': 100 },
}) FYI: @belochub |
I don't understand why would we replace builder calls with declarative syntax, it is okay to have it in a separate method (i.e. I'd be fine with adding something like |
@lundibundi @belochub
The text was updated successfully, but these errors were encountered: