Get Raw query string of a relational query in drizzle

I need the raw query string of a relational query to perform an explain command. The docs only explain this process for the non-relational queries :/
5 Replies
delight
delight15mo ago
Can't you simply activate the logging https://orm.drizzle.team/docs/goodies#logging that should give you the executed sql on the console
Goodies - DrizzleORM
Drizzle ORM | %s
Angelelz
Angelelz15mo ago
All query builders have the method toSQL() on them. This method will give an object with a sql property with the query and a params property with an array of all the parameters
divby0
divby0OP15mo ago
Unfortunately not - I think this only applies to the non-relational queries
No description
divby0
divby0OP15mo ago
Oh that's nice, I'll try tomorrow. Thanks soo much That was exactly what I was looking for, thanks
delight
delight15mo ago
👍😊
Want results from more Discord servers?
Add your server