Feature Request - Support Dynamic Where Clauses for Query #38
Labels
codegen
deals with generated code
design discussion required
Issue that needs discussion with maintainers for deciding on approach
enhancement
New feature or request
hacktoberfest
Hi Team,
We need a Feature in NORM where we don't have to write multiple queries for multiple cases/filters which we want rather NORM should be able to take decision on its own that if Given Param is NULL/Empty is some case it should not add its Column in WHERE clause.
For Example -
We want to have a Users API where we want to support filtering by
name, address_line, city, state and zip_code
.Current Solution -
We have to write multiple queries for each case like
SELECT * FROM users WHERE name = 'XXXX';
SELECT * FROM users WHERE address_line = 'XXXX';
....
....
SELECT * FROM users WHERE zip_code = 'XXXX';
And then if we need combination we will need combinations also, then we would few more queries like
SELECT * FROM users WHERE zip_code = 'XXXX'; AND city = 'XXXX';
and so on.......Expected Solution -
NORM should generate query on the fly according to Parameters given to it like below code somewhat -
The text was updated successfully, but these errors were encountered: