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
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
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 parametersUnfortunately not - I think this only applies to the non-relational queries
Oh that's nice, I'll try tomorrow. Thanks soo much
That was exactly what I was looking for, thanks
👍😊