What is the best way to create conditional filters on a query?

I am building an marketplace for rural real estate. I would like to build a filter system with multiple options to filter. What would be the best way to do this with Drizzle? It would be like Airbnb.
4 Replies
Angelelz
Angelelz11mo ago
The best practice is to construct an array of filters that you'l like include using your logic, and then spread that array to the and() function
frankscp
frankscp11mo ago
Can you provide an example?
Angelelz
Angelelz11mo ago
GitHub
[FEATURE]: Merge multiple calls to where when in dynamic mode · I...
Describe what you want It would be great if multiple calls to the where method could be merged with an and when the query was in dynamic mode. This would be fantastic for scenarios where you want t...
Angelelz
Angelelz11mo ago
GitHub
[FEATURE]: Allow adding filters based on conditions · Issue #720 · ...
Describe want to want In real world, it is very rare to just fetch stuff from database in one go using pre defined filters and send it to client. There are many complex conditions which needs to be...
Want results from more Discord servers?
Add your server