Drizzle Kit lets you declare configurations in TypeScript, JavaScript or JSON configuration files.
You can have autocomplete experience and a very convenient environment variables flow!
drizzle.config.ts
drizzle.config.js
drizzle.config.json
Schema files paths
schema param lets you define where your schema file/files live.
You can have as many separate schema files as you want and define paths to them using
glob
or array of globs syntax.
Example 1
Example 2
Example 3
Migrations folder
out param lets you define folder for your migrations, it’s optional and drizzle by default.
It’s very useful since you can have many separate schemas for different databases in the same project
and have different migration folders for them.
Migration folder contains .sql migration files and _meta folder which is used by drizzle-kit
⚠️
Don’t delete any files manually, please refer to drizzle-kit drop command
SQL breakpoints
breakpoints param lets you enable/disable SQL statement breakpoints in generated migrations.
It’s optional and true by default,
it’s necessary to properly apply migrations on databases, that do not support multiple DDL alternation statements in one transaction (MySQL, SQLite)
and Drizzle ORM has to apply them sequentially one by one.
When using the PlanetScale driver, your connection string must end with ?ssl={"rejectUnauthorized":true} instead of ?sslaccept=strict.
Multi-project schema
tablesFilter param lets you filter tables with glob
syntax for db push command. It’s useful when you have only one database available for several separate projects with separate sql schemas.
How to define multi-project tables with Drizzle ORM — see here.