© 2026 Hedgehog Software, LLC

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

Best way to get raw SQL for a SQLite insert statement (with inline parameters)?

I tried doing this:
class InlineSQLiteSyncDialect extends SQLiteSyncDialect {
  public inlineParams = true;
}
const dialect = new InlineSQLiteSyncDialect();
const statement: SQLiteInsert = ...;
statement.getSQL().toQuery(dialect).sql;
class InlineSQLiteSyncDialect extends SQLiteSyncDialect {
  public inlineParams = true;
}
const dialect = new InlineSQLiteSyncDialect();
const statement: SQLiteInsert = ...;
statement.getSQL().toQuery(dialect).sql;

But get an error
error: TypeError: escapeName is not a function
error: TypeError: escapeName is not a function
. Any ideas?

I could us
.toSQL()
.toSQL()
to get the parameterized SQL and the parameters and then have custom logic to combine them but I'm thinking there's a better way.
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

Get raw SQL string with parameters
Drizzle TeamDTDrizzle Team / help
2y ago
How to specify types for raw sql statement?
Drizzle TeamDTDrizzle Team / help
13mo ago
Run Raw SQL with sql``
Drizzle TeamDTDrizzle Team / help
16mo ago
Get the result raw sql
Drizzle TeamDTDrizzle Team / help
3y ago