Hi Y'all,I'm trying to use query parameters to search a Postgres DB. I've figured out how to pass the query parameters as variables via an interface, but I"m stuck on actually executing the query. I'd preferably like to have it so that no matter the query it returns the responses. Say there are multiple columns from param1 to param6 /search?param1=var1¶m4=var2 Which would return all the items with var1 and var2 in param1 and param4.Attempt @ Solution I could hard code each of the possible combinations through some SQL query but that doesn't seem like a legit way of doing it.I could also use some of the features/built in functions from TypeORM, I just don't know which one. All of the built in functions seem to require actual variables to be passed, meaning in case I accidentally get an var = undefined it will error out of the query.Do you have any suggestions?
Submitted June 03, 2019 at 09:49PM by always-stressed
No comments:
Post a Comment