© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
DT
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 Team
Join
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Recent Announcements
Similar Threads
Raw SQL string to `DrizzleSQLiteSnapshotJSON`?
DT
Drizzle Team / help
5mo ago
Run Raw SQL with sql``
DT
Drizzle Team / help
16mo ago
Get the result raw sql
DT
Drizzle Team / help
3y ago
Best way to get raw SQL for a SQLite insert statement (with inline parameters)?
DT
Drizzle Team / help
3y ago