What is Drift Mode?
Compare your ORM schema to the actual database and find every divergence in one screen.
For: developers.
Drift Mode is QueryDeck's answer to a problem every team with an ORM eventually hits: the schema your code thinks exists no longer matches the schema your database actually has.
The problem
You have a Prisma schema, a Django models.py, or a Rails schema.rb. Your code is built around it. But over time:
- A teammate added a column directly with
ALTER TABLEand forgot the migration. - A migration was rolled back in production but the model files still reflect the new state.
- An index was added in the database for performance but never went back into the ORM.
- A field type was changed manually (
TEXT→VARCHAR(255)) and the ORM still thinks it's the old type.
Each of those is a silent bug waiting to happen — a query that works locally and crashes in production, a deploy that breaks because the migration tries to add a column that already exists, a search that misses indexed lookups because the ORM doesn't know the index is there.
What Drift Mode does
QueryDeck reads your ORM schema files, queries your live database for its real schema, and shows you every difference on one screen.
┌─────────────────────────────────────────────────────┐
│ Drift Mode — Prisma vs PostgreSQL │
│ Checked 2026-05-28 14:32 prisma/schema.prisma │
├─────────────────────────────────────────────────────┤
│ │
│ ⚠ 4 differences found │
│ │
│ ╭─────────────────────────────────────────────╮ │
│ │ users.deleted_at │ │
│ │ Missing in code — exists in database │ │
│ │ db: TIMESTAMP, nullable │ │
│ ╰─────────────────────────────────────────────╯ │
│ │
│ ╭─────────────────────────────────────────────╮ │
│ │ orders.status │ │
│ │ Type differs │ │
│ │ code: String │ │
│ │ db: ENUM(active, paid, refunded) │ │
│ ╰─────────────────────────────────────────────╯ │
│ │
└─────────────────────────────────────────────────────┘Each card describes one drift item: what changed, where it's defined (or not), and what the discrepancy is. From there you decide what to do.
How to open Drift Mode
Drift Mode runs automatically when you connect to a project with qdeck. The first time qdeck opens a database, it parses the ORM schema, queries the database, computes the drift, and switches to Drift Mode if anything is different.
You can also open it manually:
| Way to open | Where |
|---|---|
| Toolbar | Click Drift in the mode switcher |
| Menu | View → Drift Mode |
| Command palette | Cmd+K, type "drift" |
When Drift Mode runs
Drift Mode requires:
- A database with an introspectable schema (PostgreSQL, MySQL — SQLite is supported with reduced fidelity).
- An ORM that QueryDeck recognizes. The current list: Prisma, Drizzle, TypeORM, Django, Rails. (Knex and Sequelize are detected by the CLI but their migration files don't carry a typed schema — Drift Mode can't compare them.)
- The schema file on disk, reachable from the project root that
qdeckdetected.
If any of those is missing, Drift Mode shows a one-line explanation rather than the diff.
What it compares
Drift Mode looks at four kinds of objects:
| Object | What's compared |
|---|---|
| Tables | Existence on both sides |
| Columns | Name, type, nullable, default value |
| Indexes | Name, columns, uniqueness |
| Foreign keys | Source column, referenced table.column, ON DELETE / ON UPDATE rules |
For each object, the result is one of three statuses:
| Status | Meaning |
|---|---|
| Missing in DB | Your ORM declares it, the database doesn't have it |
| Missing in code | The database has it, your ORM doesn't declare it |
| Different | Both sides have it, but the values don't match |
What it does NOT compare
- Data, only schema. Drift Mode is not for finding rows that have unexpected values.
- Stored procedures, triggers, materialized views — not currently in scope.
- Permissions or grants — not in scope.
- Application-level constraints (some ORMs validate things in code that the DB doesn't enforce) — only DB-level constraints are compared.
Why this is rare
Most database tools that exist do schema diffing in one direction:
- CI tools like Atlas check drift in pipelines, but they don't have a GUI for daily use.
prisma migrate diffexists for Prisma only, and the output is terminal text.- DataGrip's schema compare compares two live databases, not code vs database.
QueryDeck is the first desktop client that compares the ORM you're writing every day against the database you're connected to, in real time, with a fix path.
What's next
- Reading the diff — what each card means and how severity is decided
- The Fix button — what runs when you click it, and what doesn't
- Supported ORMs — what each parser reads