Drizzle Kit lets you declare configuration options in TypeScript or JavaScript configuration files.
drizzle.config.ts
drizzle.config.js
Example of an extended config file
Multiple configuration files
You can have multiple config files in the project, it’s very useful when you have multiple database stages or multiple databases or different databases on the same project:
npm
yarn
pnpm
bun
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
---
dialect
Dialect of the database you’re using
type
postgresqlmysqlsqlitetursosinglestore
default
—
commands
generatemigratepushpullcheckup
schema
glob
based path to drizzle schema file(s) or folder(s) contaning schema files.
type
stringstring[]
default
—
commands
generatepush
Example 1
Example 2
Example 3
Example 4
out
Defines output folder of your SQL migration files, json snapshots of your schema and schema.ts from drizzle-kit pull command.
type
stringstring[]
default
drizzle
commands
generatemigratepushpullcheckup
driver
Drizzle Kit automatically picks available database driver from your current project based on the provided dialect,
yet some vendor specific databases require a different subset of connection params.
driver option let’s you explicitely pick those exceptions drivers.
type
aws-data-apid1-httppglight
default
—
commands
migratepushpull
AWS Data API
PGLite
Cloudflare D1 HTTP
---
dbCredentials
Database connection credentials in a form of url,
user:password@host:port/db params or exceptions drivers(aws-data-apid1-httppglight ) specific connection options.
type
union of drivers connection options
default
—
commands
migratepushpull
PostgreSQL
MySQL
SQLite
Turso
Cloudflare D1
AWS Data API
PGLite
migrations
When running drizzle-kit migrate - drizzle will records about
successfully applied migrations in your database in log table named __drizzle_migrations in public schema(PostgreSQL only).
migrations config options lets you change both migrations log table name and schema.
casing is responsible for in-code column keys casing
type
{ casing: "preserve" | "camel" }
default
{ casing: "camel" }
commands
pull
camel
preserve
---
tablesFilter
If you want to run multiple projects with one database - check out our guide.
drizzle-kit push and drizzle-kit pull will by default manage all tables in public schema.
You can configure list of tables, schemas and extensions via tablesFilters, schemaFilter and extensionFilters options.
tablesFilter option lets you specify glob
based table names filter, e.g. ["users", "user_info"] or "user*"
type
stringstring[]
default
—
commands
generatepushpull
schemaFilter
If you want to run multiple projects with one database - check out our guide.
drizzle-kit push and drizzle-kit pull will by default manage all tables in public schema.
You can configure list of tables, schemas and extensions via tablesFilters, schemaFilter and extensionFilters options.
schemaFilter option lets you specify list of schemas for Drizzle Kit to manage
type
string[]
default
["public"]
commands
generatepushpull
extensionsFilters
Some extensions like postgis, when installed on the database, create its own tables in public schema.
Those tables have to be ignored by drizzle-kit push or drizzle-kit pull.
extensionsFilters option lets you declare list of installed extensions for drizzle kit to ignore their tables in the schema.
type
["postgis"]
default
[]
commands
pushpull
---
entities
This configuration is created to set up management settings for specific entities in the database.
For now, it only includes roles, but eventually all database entities will migrate here, such as tables, schemas, extensions, functions, triggers, etc
roles
If you are using Drizzle Kit to manage your schema and especially the defined roles, there may be situations where you have some roles that are not defined in the Drizzle schema.
In such cases, you may want Drizzle Kit to skip those roles without the need to write each role in your Drizzle schema and mark it with .existing().
The roles option lets you:
Enable or disable role management with Drizzle Kit.
Exclude specific roles from management by Drizzle Kit.
Include specific roles for management by Drizzle Kit.
Enable modes for providers like Neon and Supabase, which do not manage their specific roles.
By default, drizzle-kit won’t manage roles for you, so you will need to enable that. in drizzle.config.ts
You have a role admin and want to exclude it from the list of manageable roles
You have a role admin and want to include to the list of manageable roles
If you are using Neon and want to exclude roles defined by Neon, you can use the provider option
If you are using Supabase and want to exclude roles defined by Supabase, you can use the provider option
important
You may encounter situations where Drizzle is slightly outdated compared to new roles specified by database providers,
so you may need to use both the provider option and exclude additional roles. You can easily do this with Drizzle:
---
strict
Prompts confirmation to run printed SQL statements when running drizzle-kit push command.
type
boolean
default
false
commands
push
verbose
Print all SQL statements during drizzle-kit push command.
type
boolean
default
true
commands
generatepull
breakpoints
Drizzle Kit will automatically embed --> statement-breakpoint into generated SQL migration files,
that’s necessary for databases that do not support multiple DDL alternation statements in one transaction(MySQL and SQLite).
breakpoints option flag lets you switch it on and off