Skip to main content
doc0blade47/drizzle-ormdocumentation home
Sign in

Configuring Drizzle Kit

Last updated Oct 12, 2026100% grounded

Overview

Introduction to Configuration

Configuring Drizzle Kit allows you to define how database commands—such as generating migrations, pushing schema updates, and running Drizzle Studio—interact with your database. By setting up a configuration file, you can specify your database dialect, connection credentials, file paths, and advanced options in one centralized place.


Creating a Configuration File

To get started, create a configuration file named in your project's root directory.

  1. Create a file named drizzle.config.ts in your project root.
  2. Define and export your configuration object using the required dialect, schema, and credential settings.

Here is a sample configuration file for a PostgreSQL database:

import type { Config } from 'drizzle-kit';
 
export default {
  dialect: 'postgresql',
  schema: './src/schema.ts',
  out: './drizzle',
  dbCredentials: {
    url: process.env.DATABASE_URL!,
  },
} satisfies Config;

Note

Make sure you have installed the required database driver packages in your project before running commands with your configuration file.


Configuration Options Reference

The configuration options available for your setup control how Drizzle Kit connects to and processes your database schema.

OptionTypeDescription
dialectstringMandatory database dialect. Supported dialects: postgresql, mysql, sqlite, singlestore, gel, turso.
schemastring | string[]Path or glob pattern to your database schema file or files.
outstringOutput folder for generated migration files and database snapshots. Defaults to ./drizzle.
driverstringOptional driver used when accessing specific services. Supported drivers: aws-data-api, d1-http, expo, turso, pglite.
dbCredentialsobjectConnection credentials required to connect to your database (such as connection strings or host details).
breakpointsbooleanEnables or disables SQL statement breakpoints in generated migrations. True by default.
verbosebooleanPrints all statements that will be executed during push commands.
strictbooleanAlways asks for confirmation before executing statements to sync your schema with the database.
casingstringControls column casing for serialization. Supported values: camelCase, snake_case.
tablesFilterstring | string[]Glob pattern or array of patterns to filter tables during push commands.
schemaFilterstring | string[]Defines which schema in PostgreSQL to use for introspection or push commands.

Database Credentials by Dialect

Depending on the chosen dialect, the dbCredentials object expects specific properties:

  • PostgreSQL: Can use a connection URL (url) OR individual fields (host, port, user, password, database, ssl). Alternatively, when using the aws-data-api driver, it requires database, secretArn, and resourceArn.
  • MySQL: Can use a connection URL (url) OR individual fields (host, port, user, password, database, ssl).
  • SQLite: Requires a database file path or URL (url).
  • Turso / LibSQL: Requires a database URL (url) and an optional authentication token (authToken).
  • SingleStore: Can use a connection URL (url) OR individual fields (host, port, user, password, database).

Tip

Use environment variables (via process.env.DATABASE_URL) inside your configuration file to keep sensitive credentials secure and out of version control.

Was this page helpful?