© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•14mo ago•
2 replies
Le Michel

Get `CREATE TABLE ...` SQL from a schema

Is there a way to get the SQL to create a table based on the table's schema ?
I am doing some tests with Drizzle-ORM, and I don't want to setup Drizzle-Kit and all the migrations stuff just for that.
Given a table variable defined with
const table = sqliteTable('table_name', schema);
const table = sqliteTable('table_name', schema);
, is there a way to get the SQL to create the table in the db ? Something like
db.run(table.getCreateQuery())
db.run(table.getCreateQuery())
.
Thanks !
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 table's CREATE sql with Drizzle
Drizzle TeamDTDrizzle Team / help
2y ago
How to get schema name from table name?
Drizzle TeamDTDrizzle Team / help
10mo ago
sql.raw() does not get columns from Table object
Drizzle TeamDTDrizzle Team / help
2y ago
JS API for generating CREATE TABLE sql?
Drizzle TeamDTDrizzle Team / help
3y ago