How do I execute raw query (with params already separated) with Drizzle?
Okay, so I've made my own query builder beforehand and I'm migrating away my code from raw postgres-js nature to Drizzle ORM (since I don't really want to parse stuff around anymore like what I would need to be doing with just raw postgres-js. On usual postgres-js, what I'd do is just:
In which
query
is a string
and params
is a unknown[]
. I wanted to execute this with Drizzle, but I haven't find the right way to do so. Even using the sql
template literals or even building my own implementation for SQLWrapper
interface (source) doesn't seem right to me. Is there any other way for me to execute the code directly without drifting away from the drizzle db instance (that's wrapping the original postgres-js
instance)?3 Replies
What I've tried (and of course, this does not work):
Hi reinaldyrfl, were you able to find a reasonable workaround? I came across a similar need.
Drizzle does not exposes some like what you're looking for. The whole point of Drizzle is that it does this mapping for you