Skip to content

Prisma schema visualizer

Paste your Prisma schema and instantly see an entity-relationship diagram. Visualize models, scalar fields, types, and relations — all in your browser.

ER diagram

Paste a Prisma schema above to generate a diagram.

What is a Prisma schema?

A Prisma schema (schema.prisma) is the single source of truth for your database structure in a Prisma project. It defines models that map to database tables, fields that map to columns, and relations between models using the @relation directive. This tool reads that schema and renders it as a visual entity-relationship diagram.

Unlike raw SQL DDL, the Prisma schema includes relation fields that exist only at the ORM level. This visualizer filters those out and shows only the scalar fields that correspond to actual database columns, giving you a clear picture of what the underlying database looks like.

When to use a Prisma schema visualizer

  • Onboarding to a Prisma codebase — understand the data model without reading every migration
  • Reviewing schema changes in a pull request — paste the new schema and see the shape at a glance
  • Adding documentation to your project README or design doc with an up-to-date diagram
  • Planning new models and relations before writing the actual schema code
  • Communicating the database structure to teammates who aren't familiar with Prisma syntax

From schema diagrams to live dashboards

Understanding your schema is step one. Basedash goes further — connect your database and describe the chart or metric you need in plain English. Basedash writes the SQL, runs it against your real data, and renders the visualization automatically. It works with PostgreSQL, MySQL, BigQuery, Snowflake, and 750+ other data sources.

FAQ

What parts of a Prisma schema does this parse?

The visualizer parses model blocks, field definitions with scalar types, @id and @@id for primary keys, @relation directives for relationships, and optional (?) and list ([]) modifiers. Enum definitions, generators, and datasource blocks are ignored for the visual output.

Is my schema stored or sent to a server?

No. All parsing and rendering happens in your browser using JavaScript and SVG. Your schema is never transmitted or stored.

How are relations detected?

The tool looks for @relation(fields: [...], references: [...]) attributes on model fields. When it finds one, it draws a line from the foreign key field in the current model to the referenced field in the target model.

Why don't relation fields appear in the diagram?

Relation fields (like posts Post[] or author User) exist only at the Prisma ORM level — they don't correspond to actual database columns. The diagram shows only scalar fields that map to real columns, plus any foreign key fields used in @relation directives.

Can I export the diagram?

Yes. Click the "Download SVG" button to save the diagram as an SVG file, which can be opened in any browser, design tool, or embedded in documentation.

Does it handle multi-file Prisma schemas?

If you're using Prisma's multi-file schema feature, paste the contents of all your .prisma files together into the input. The parser will find and visualize all model blocks regardless of their original file.

Skip the SQL — let AI build your charts

Connect your data and describe what you want to see. Basedash handles the query, visualization, and dashboard.