reinaldyrfl
reinaldyrfl
Explore posts from servers
DTDrizzle Team
Created by reinaldyrfl on 4/9/2024 in #help
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:
await this.database.unsafe(query, params as never[]);
await this.database.unsafe(query, params as never[]);
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)?
4 replies