© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•2y ago•
2 replies
Eli

Get raw SQL string with parameters

I use drizzle to build up SQL strings - but I need to get the final SQL string.
I can use
query.toSQL()
query.toSQL()
and then do a string-replace on
?
?
with
toSQL().sql | toSQL().params
toSQL().sql | toSQL().params
.

My questions are:
- is this the right way to do it?
- if so, is it safe to do a simple text-replace on the question-marks?
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Raw SQL string to `DrizzleSQLiteSnapshotJSON`?
Drizzle TeamDTDrizzle Team / help
5mo ago
Run Raw SQL with sql``
Drizzle TeamDTDrizzle Team / help
16mo ago
Get the result raw sql
Drizzle TeamDTDrizzle Team / help
3y ago
Best way to get raw SQL for a SQLite insert statement (with inline parameters)?
Drizzle TeamDTDrizzle Team / help
3y ago