Guides

ORM Cockpit

Link a Drizzle or Prisma project, see how its schema has drifted from the live database, and preview a migration before you run it.

ORM Cockpit

The ORM Cockpit connects your code to your running database. Link a project folder, and Dora reads its Drizzle or Prisma schema, compares it against the live database, and shows you exactly where the two have drifted apart. When there is drift, Dora generates a dialect-correct migration you can review before anything touches the database.

The cockpit is read-first. It never alters your database on its own — it shows drift and generates SQL, and you decide what to run.

What it does

  1. Link a project folder. Point Dora at the root of a project that uses Drizzle or Prisma.
  2. Detect the ORM and parse the schema. Dora finds the Drizzle schema (drizzle.config.* / schema files) or Prisma schema (prisma/schema.prisma) and parses it into an internal schema model.
  3. Diff against the live database. Dora introspects the connected database's real schema and compares it to what your code declares.
  4. Preview a migration. For any drift, Dora generates the SQL to bring the database in line with your schema, written for the connected database's dialect.

Reading the drift

Drift is grouped per table so you can scan it quickly. Each change is classified by how risky it is to apply:

ClassificationMeaningExamples
SafeAdditive, non-destructiveAdd a new table, add a nullable column
ReviewCould affect existing dataChange a column type, add a constraint
DestructiveRemoves or rewrites dataDrop a column, drop a table

This lets you see at a glance whether a migration is a routine additive change or something that needs care.

Previewing and running a migration

When you open the migration preview, Dora shows the generated SQL statements in order. Safe statements are ready to go. Review and destructive statements are gated behind an explicit opt-in — you have to consciously include them before they become part of the SQL handed to the query console.

From there you run the SQL in Dora's console like any other query, with the generated statements in front of you the whole time. Nothing is applied silently.

Destructive statements (dropping columns or tables) permanently remove data. Review the generated SQL and take a backup before running anything in the destructive group.

Supported ORMs

  • Drizzle — schema files and drizzle.config.*
  • Prismaprisma/schema.prisma

If you write type-safe queries with these ORMs, see the ORM Runners guide for running Drizzle and Prisma Client queries directly inside Dora.