Prisma Schema Generator
DeveloperGenerate Prisma schema files with models, fields, relations, and data source configuration. Supports PostgreSQL, MySQL, SQLite, and MongoDB.
Quick Presets
Data Source
Model:
| Field | Type | ID | Unique | Optional | Default | |
|---|---|---|---|---|---|---|
schema.prisma
About Prisma
Prisma is a next-generation ORM for Node.js and TypeScript with a declarative schema language, type-safe queries, and automated migrations.
- Prisma Schema - Declarative data modeling language for defining your database
- Type Safety - Auto-generated TypeScript types from your schema
- Prisma Migrate - Declarative database migrations
- Prisma Studio - Visual database browser and editor
What is This Tool?
A Prisma schema generator creates schema.prisma files for the Prisma ORM. Define models, fields, relations, and indexes with a visual editor and export ready-to-use Prisma schema code with proper type mappings for PostgreSQL, MySQL, SQLite, and MongoDB.
Prisma uses its own schema language (PSL) to define data models that generate both database migrations and a type-safe TypeScript client. Models define tables, fields define columns, and relation attributes (@relation) define foreign key relationships between models.
Common Use Cases
Database Modeling
Design data models visually and generate Prisma schema with correct field types, attributes, and relations.
Project Scaffolding
Generate complete Prisma schemas for new projects with common patterns like User, Post, Comment models.
Schema Migration
Convert existing database schemas to Prisma format when adopting Prisma ORM on existing projects.
Learning Prisma
Understand Prisma schema syntax by generating examples with various field types, relations, and attributes.
Frequently Asked Questions
Which databases does Prisma support?
PostgreSQL, MySQL, SQLite, SQL Server, MongoDB, and CockroachDB. Each has specific type mappings and features.
How do I generate migrations?
Run npx prisma migrate dev to generate SQL migrations from schema changes. The generated schema is the input for Prisma Migrate.
Does it generate the Prisma Client?
This tool generates the schema.prisma file. Run npx prisma generate to create the type-safe Prisma Client from the schema.