scan, list, describe, hover and er read Drizzle schemas as well as Django, SQLAlchemy and Prisma models, and so do the MCP tools list_apps, list_models, describe_model, find_relations and er_diagram. They read the JSON snapshot that drizzle-kit generate writes next to every migration: it holds the whole schema with every table, column, key and index already resolved, so no TypeScript is run and no Node, drizzle-kit or database is needed.
uvx orm-lens scan -f table # every table in the latest snapshot
uvx orm-lens er -f dbml # ER diagram: mermaid, dbml, d2, plantuml or dot
uvx orm-lens describe posts # one table: columns, keys and what each does on delete
A project that only runs drizzle-kit push has no snapshot and shows nothing; run drizzle-kit generate once to get one. The other commands don’t read Drizzle yet, and neither does the VS Code extension. The Django analyses never see a Drizzle table, and a Python relation never points at one.
drizzle-kit has two layouts, and both are read:
| drizzle-kit | Snapshot | Which one |
|---|---|---|
| 0.x | <out>/meta/<prefix>_snapshot.json next to meta/_journal.json |
the last migration in the journal, else the highest name |
| 1.x | <out>/<timestamp>_<name>/snapshot.json next to migration.sql |
the last folder by name |
Only the latest snapshot of each out directory is read: it is the schema the migrations leave behind. When a 1.x folder sits next to the 0.x meta/ it was upgraded from, the 1.x one is read. Snapshots in node_modules, dist, build, vendor, virtualenvs, test directories (test, tests, __tests__) and hidden directories are skipped, and so are symlinks that lead outside the workspace. The default exclude of migrations directories, which keeps Django migrations out of the model scan, does not apply: drizzle-kit often writes its snapshots there.
In a workspace with no Django or SQLAlchemy project, the MCP server looks for a snapshot at most four directories down, which covers packages/db/drizzle/meta/. If yours is deeper, point workspace_root at a directory closer to it. The CLI has no such limit.
Tables are listed under their table name. A table in another PostgreSQL schema keeps its own name unless public has a table of the same name, in which case the schema goes in front (auth_users); the declaration then reads pgSchema("auth").table("users"). A name with a dot, such as pgTable("auth.users"), becomes auth_users, so app.Model still names one table. tableName always has the real name, and meta has the dialect, the schema and a composite primary key.
Columns keep the SQL type the snapshot records (uuid, varchar(255), integer). args reads NOT NULL, UNIQUE and DEFAULT ...; JSON output adds nullable, and primaryKey for every column of the primary key. A column is unique when a unique constraint or a plain unique index covers it alone: an index on an expression or with a WHERE doesn’t count.
Foreign keys are shown on their key column, as a ForeignKey, or as a OneToOneField when the key columns are the primary key or unique. A composite key is one relation, shown on one of its columns, and when two keys share a column both are kept. JSON output lists the key’s columns in keyColumns and the columns they point at in references, and diagram edges lead to those columns.
Delete policy is the key’s onDelete. Without one the database takes no action, so NO_ACTION is shown.
Relations declared with relations() exist only in TypeScript and are not read. They add no column and no constraint, so the diagram is the same without them.
Each out directory is listed as an app named after the directory that owns it: packages/db/drizzle is db, apps/web/src/db/migrations is web, and a drizzle/ at the repository root is drizzle. When that name isn’t unique, or a Django, SQLAlchemy or Prisma app already has it, the app is named after its path instead (packages_db_drizzle). Relations always stay inside their own app.
orm-lens scan --format json marks these models with "orm": "drizzle" and adds tableName. Django models serialize exactly as before.
The latest snapshots of lobe-chat, openstatus, karakeep, Cap, midday (0.x), hollo, hackers.pub, zipline, zerobyte, holocron, headplane, LNReader and a Cloudflare Workers SaaS template (1.x), on PostgreSQL, MySQL and SQLite, were read and compared with a separate count over the raw JSON. All 663 tables and 1385 foreign keys were found, with every column, primary key, target table and onDelete, and the DBML diagram has one reference per foreign key. On the 29 Django and SQLAlchemy projects used for parser changes the output is the same as before; the one difference is PostHog, whose desktop app keeps a Drizzle schema of 14 tables that is now listed as well.