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
Hi, I looked through some of the older issues regarding this but they did not solve my problem. Here is my code snippet
letwhereClause='';if(fragments.length>0){whereClause=db`WHERE ${fragments.join(' AND ')}`;}constnewPairs=awaitdb` SELECT * FROM NewPairs${whereClause ? whereClause : db``} ORDER BY ${db(orderBy)}${orderDirection.toUpperCase()==='ASC' ? db`ASC` : db`DESC`} LIMIT 100 OFFSET 0 `;
fragments just contains 0 or many of these for example:
db`sell_count <= ${sellCountTo}`
I keep getting an empty response from my DB but im not sure why, even though If I write out the full query and query my DB, it returns with a populated response.
The text was updated successfully, but these errors were encountered:
You can't join on an array of fragments as that will just result in a stringified version of it. Use eg. flatMap and only insert and if i !== 0. Eg xs.flatMap((x, i) => i ? [sql`and`, x] : x)
Hi, I looked through some of the older issues regarding this but they did not solve my problem. Here is my code snippet
fragments just contains 0 or many of these for example:
I keep getting an empty response from my DB but im not sure why, even though If I write out the full query and query my DB, it returns with a populated response.
The text was updated successfully, but these errors were encountered: