Custom query builder? #8974
Unanswered
ghost
asked this question in
Support Questions
Replies: 2 comments 2 replies
-
For one of my projects, I had to use a custom query builder. Indeed it helped simplifying the code but it haded some headaches managing the aliases for instance |
Beta Was this translation helpful? Give feedback.
2 replies
-
In the past, I've used an approach like the one described by Benjamin here. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello! Would it be good or bad to create custom query builder or is it suggested against it in general?
I have situation where I need to have similar filtering logic (where-clauses) in many places. Currently I use query builder and I have foreach + switch. But because queries have not only simple filters (like name etc.) but filters by relation fields and so on, the amount of exceptions to simple filters grows and the filtering code grows quickly quite large and ugly - and also I need to repeat similar loops in many places.
Thus I was thinking that I could write a custom query builder where I would have logic to handle this situation.
I found couple of places on the web where this custom query builder thing was discussed but I couldn't come to conclusion whether it is good or bad to create such.
Beta Was this translation helpful? Give feedback.
All reactions