QueryDeck Docs
Drift Mode

Supported ORMs

What each Drift Mode parser reads, the Fix commands per ORM, and known parser limits.

For: developers.

Drift Mode currently ships with parsers for five ORMs. This page documents what each one reads and what it can't see yet.

ORMParser statusFix direction supported
PrismaFullBoth (push and pull)
DrizzleFullBoth (push and pull)
TypeORMFullCode → DB (migration generation)
DjangoFullBoth (makemigrations / inspectdb)
RailsFullBoth (db:migrate / db:schema:dump)
KnexNot parsed for drift
SequelizeNot parsed for drift

The CLI (qdeck) detects Knex and Sequelize for connection purposes — it can open QueryDeck connected to a Knex or Sequelize project. But Drift Mode needs a typed schema definition, and Knex/Sequelize keep schema in migration files (procedural code) rather than a declarative schema. That style doesn't map cleanly to a diff.

Prisma

Reads: schema.prisma and optional *.prisma files referenced via multiSchema.

What's parsed:

  • Models (tables) and their fields (columns)
  • Field types, mapping Prisma types to canonical types via the type map
  • ? nullable suffix
  • @id, @unique, @@unique, @@index
  • @default(...) values (including now(), uuid(), cuid())
  • @relation(...) foreign keys with onDelete and onUpdate
  • @map(...) for table/column name overrides
  • @@map(...) for table name overrides

Fix commands:

  • Code ahead of DB → {runner} prisma migrate dev
  • DB ahead of code → {runner} prisma db pull

Known limits:

  • @@check constraints are not compared.
  • Composite types are not parsed (preview feature in Prisma).
  • View models (view keyword) are detected but not diffed against database views yet.

Drizzle

Reads: the file pointed to by drizzle.config.ts's schema: field. Often schema.ts, db/schema.ts, or drizzle/schema.ts.

What's parsed:

  • pgTable(...), mysqlTable(...), sqliteTable(...) declarations
  • Column factories: text(...), varchar(...), integer(...), boolean(...), timestamp(...), jsonb(...), etc.
  • Modifiers: .notNull(), .unique(), .primaryKey(), .default(...), .$default(...)
  • references(() => other.column, { onDelete, onUpdate }) for foreign keys
  • index(...) and uniqueIndex(...) declarations
  • serial, uuid, bigserial autoincrement variants

Fix commands:

  • Code ahead of DB → {runner} drizzle-kit push
  • DB ahead of code → {runner} drizzle-kit introspect

Known limits:

  • enum(...) declarations are parsed but enum values must be inline (not imported from another file).
  • The parser doesn't follow import statements across files. If your schema is split across many files, list them in drizzle.config.ts's schema: field as an array.
  • Custom types via customType(...) are accepted but not compared by name.

TypeORM

Reads: data-source.ts / data-source.js, plus the entity files referenced by the entities field.

What's parsed:

  • @Entity(...) classes mapped to tables
  • @Column(...), @PrimaryColumn(), @PrimaryGeneratedColumn(), @CreateDateColumn(), @UpdateDateColumn()
  • Column options: type, nullable, unique, default, length, precision, scale
  • @ManyToOne, @OneToMany, @ManyToMany for relations (FKs)
  • @JoinColumn(...) for explicit FK column names
  • @Index(...) declarations
  • @Unique([...]) composite unique constraints

Fix commands:

  • Code ahead of DB → {runner} typeorm migration:generate -d data-source.ts <name> && {runner} typeorm migration:run -d data-source.ts

Known limits:

  • Embedded entities (@Embedded) are flattened to their columns but the embed name isn't preserved.
  • @Tree(...) tree entities are parsed as their underlying table; tree-specific columns aren't validated.
  • The synchronize: true config is honored — if your data source has it, Drift Mode tells you that drift is expected to auto-resolve on app boot and suggests reviewing only what's stable.

Django

Reads: the model files of every installed app, discovered via settings.INSTALLED_APPS and the Django app autoload convention (<app>/models.py).

What's parsed:

  • models.Model subclasses → tables (named <app>_<model> by default, or Meta.db_table if set)
  • Field types: CharField, TextField, IntegerField, BigIntegerField, BooleanField, DateField, DateTimeField, JSONField, UUIDField, DecimalField, FloatField, custom fields fall back to "unknown"
  • Field options: null, blank, default, max_length, unique, db_index, db_column
  • ForeignKey, OneToOneField, ManyToManyField for FKs and join tables
  • Meta.indexes, Meta.constraints, Meta.unique_together
  • Meta.db_table, Meta.managed = False

Fix commands:

  • Code ahead of DB → python manage.py makemigrations && python manage.py migrate
  • DB ahead of code → python manage.py inspectdb

Known limits:

  • Meta.managed = False tables are detected and listed but not diffed (you're telling Django not to manage them).
  • Custom Field subclasses are accepted but their type is shown as "custom: ClassName" in the diff — comparison is best-effort.
  • Multi-database setups (DATABASES['readonly']) are detected; only the connection you opened in QueryDeck is compared.

Rails

Reads: db/schema.rb (the snapshot) primarily, with app/models/*.rb cross-referenced for relationship and validation hints.

What's parsed:

  • create_table blocks in schema.rb → tables
  • Column types: string, text, integer, bigint, boolean, date, datetime, timestamp, decimal, float, json, jsonb
  • Column options: null:, default:, limit:, precision:, scale:, comment:
  • t.references :name, foreign_key: { on_delete: :cascade } for FKs
  • add_index ... unique: true
  • add_foreign_key outside of create_table

Fix commands:

  • Code ahead of DB → rails db:migrate
  • DB ahead of code → rails db:schema:dump

Known limits:

  • If you use structure.sql instead of schema.rb (set config.active_record.schema_format = :sql), Drift Mode falls back to parsing SQL DDL — this works for PostgreSQL but is less rich for MySQL.
  • Polymorphic associations are not enforced at the database level, so Drift Mode reports the underlying columns (*_type, *_id) but doesn't validate the polymorphic relationship.

When your ORM isn't listed

If you use Eloquent, MikroORM, Mongoose (for MongoDB), Diesel, sqlx, or any other ORM, Drift Mode won't run today. You can still use every other feature of QueryDeck on the same connection.

Want your ORM supported? Open the in-app feedback button and tell us which one, with a link to a small example repo. We prioritize based on demand.

What's next