Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Drizzle ORM · Command

drizzle-kit push

drizzle-kit push synchronizes a Drizzle schema directly with a database without writing SQL migration files. It is intended for fast, code-first schema iteration.

How it works

Drizzle Kit reads the TypeScript schema, introspects the database, compares both representations, creates the required SQL changes internally, and applies them directly. It does not leave generated SQL migration files, so it is suited to a code-first workflow.

Syntax

npx drizzle-kit push [options]

Parameters

NameTypeDescription
dialectstringDatabase dialect, such as postgresql, mysql, sqlite, turso, singlestore, mssql, or cockroach.
schemastringTypeScript schema file or directory; multiple files can be supplied through a glob.
urlstringDatabase connection URL.
connection optionsobjectAlternative connection fields: user, password, host, port, and database.
tablesFilterstringOptional table-name filter.
configstringOptional configuration-file path; defaults to drizzle.config.ts.

Returns

Applies the required schema changes to the database; no SQL migration files are generated.

Key points

  • It applies the initial schema and later schema changes directly to the target database.
  • The workflow does not create SQL migration files.
  • Drizzle Kit first builds a JSON snapshot from the configured schema files.
  • It introspects the current database structure before calculating changes.
  • The SQL change plan is derived by comparing the application schema with the database schema.
  • The resulting SQL is executed against the configured database.

Common mistakes

  • Use push primarily for local development and local databases; use generated migrations for controlled deployment workflows.
  • Changes to certain existing-index fields are not emitted automatically, including expressions, WHERE clauses, and operator classes.

Example: Push a PostgreSQL schema

npx drizzle-kit push --dialect=postgresql --schema=./src/schema.ts --url=postgresql://user:password@host:port/dbname

Pushes the schema defined in the specified TypeScript file to the PostgreSQL database.

When to use it

Rapidly test schema designs

Local schema experimentation

Synchronize incremental schema changes

Code-first development

Select a specific Drizzle Kit configuration

Configured multi-database projects

Interview questions

QWhat does drizzle-kit push do?

The command compares the declared Drizzle schema with the live database schema and applies the required SQL changes directly. It skips producing migration files, which makes it convenient for rapid code-first iteration.

Follow-up: How would you handle production schema changes? Generate migration files, review them, and apply them through the deployment process rather than relying on direct push synchronization.

QWhat configuration does push require?

At minimum, the command needs a database dialect, schema path, and connection information. These can be supplied through drizzle.config.ts or as command-line options.

Follow-up: What could happen if the schema glob omits a schema file? Drizzle Kit may compare an incomplete declared schema and produce an incorrect synchronization plan, so all relevant files should be included.

QHow does push differ from generate?

Push does not generate migration files first; it builds an internal schema snapshot, introspects the database, derives SQL from the differences, and applies that SQL. This differs from generate, which creates migration files without applying them.

Follow-up: Why can push be risky in a shared environment? Direct synchronization bypasses a reviewed migration-file workflow and can make destructive or unintended changes harder to audit.

  • drizzle.config.ts
  • drizzle-kit generate
  • drizzle-kit migrate
  • Drizzle Kit

Source: Drizzle ORM - push. Checked 2026-10-16.