You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is hopefully something you can find through docs or searching issues.
This should do it :)
constconditions=[sql`age > 1`,sql`height < 170`,sql`hair_color = 'red'`]awaitsql` select * from humans where ${conditions.flatMap((x,i)=>i ? [sql`and`,x] : x)}`
There a many ways to dynamically generate queries, so having all ways covered in the docs is not something I have time to do (or want to), as it is highly case specific. Perhaps a separate post explaining the difference between, values, identifiers and keywords relating to dynamic query generation would help, but again - unfortunately not something I have time to do.
I have a dynamic array of conditions
I would like to join al of these conditions with and AND and create a runnable query that looks like this:
What is the correct way to go about it? Is it possible using this library, i could not figure it our reading the docs
The text was updated successfully, but these errors were encountered: