usmanhalalit / pixie

Database query builder for PHP, framework agnostic, lightweight and expressive.
MIT License
672 stars 180 forks source link

Add ability to pass array of conditions into where statement #178

Closed kticka closed 6 years ago

eL-Prova commented 6 years ago

@kticka I have no idea why this can be very helpful, because you can chain easy the where statements. Anyway I think it is better to create a easy new function with good name instead of making a function more complex with if and elses. Last, unit-test is missing.

kticka commented 6 years ago

I'm working with Eloquent ORM and this is very helpful. Sometimes you have array of key/value conditions and it's very helpful when you can pass them at once and reuse multiple times instead chaining query with bunch of wheres.

eL-Prova commented 6 years ago

@kticka the risk can be that your code wont be very readable. To keep code simple I suggest to change the signature by checking if array but move that part to own method. Further for approvement a unit-test should be part of your pull request together with small documentation for how to use.

usmanhalalit commented 6 years ago

Sorry @kticka, closing it for now, as it's not a priority right now to add new features. But this can come in the future with a cleaner implementation.