Formateador de Esquemas Prisma
Guía
Formateador de Esquemas Prisma
Format your Prisma schema files instantly with proper indentation, column-aligned fields, and consistent styling. This tool applies the same formatting conventions as prisma format — aligning field names, types, and attributes into clean columns — entirely in your browser. Paste messy or inconsistent .prisma schemas and get clean, readable output in one click.
Cómo utilizar
Paste your Prisma schema into the input area or upload a .prisma file directly. The formatter instantly parses your schema and applies consistent formatting. You can optionally enable field sorting — alphabetical or grouped by type — to further organize your models. The formatted output appears with syntax highlighting, ready to copy back into your project.
Características
- Column-Aligned Formatting – Aligns field names, types, and attributes into neat columns, matching the style of
prisma format - Soporte Completo de Bloques – Handles datasource, generator, model, enum, view, and type blocks correctly
- Ordenación de Campos – Optionally sort fields alphabetically or group them by type (relations, scalars, etc.)
- Preservación de Comentarios – Keeps your inline and block comments intact during formatting
- Resaltado de Sintaxis – Color-coded output for models, fields, types, directives, and comments
- Directive Support – Correctly handles @id, @unique, @default, @relation, @map, @db, @@map, @@index, and all other Prisma attributes
- Subir archivo – Drag and drop or browse to upload .prisma files directly
Preguntas frecuentes
-
What is Prisma schema formatting and why does it matter?
Prisma schema formatting ensures consistent indentation, column alignment of field types and attributes, and proper block structure in your .prisma files. Consistent formatting improves readability across teams, reduces merge conflicts in version control, and makes it easier to spot errors in model definitions. The official prisma format command applies these conventions, and this tool replicates that behavior in the browser.
-
How does column alignment work in Prisma schemas?
Column alignment arranges the three main parts of each field definition — the field name, the type, and the attributes — into vertically aligned columns. For example, in a User model, the id, email, and name fields would have their Int, String types aligned in the same column, and their @id, @unique directives aligned in another. This makes schemas much easier to scan visually.
-
What block types does a Prisma schema support?
A Prisma schema can contain several block types: datasource (database connection config), generator (code generation config), model (database table definitions), enum (enumerated types), view (database view definitions), and type (composite types for MongoDB). Each block type has its own syntax rules for the fields and attributes it can contain.
-
What is the difference between field-level and block-level attributes in Prisma?
Field-level attributes (prefixed with single @) apply to individual fields — like @id for primary keys, @unique for unique constraints, @default for default values, and @relation for foreign key relationships. Block-level attributes (prefixed with @@) apply to the entire model — like @@index for composite indexes, @@unique for composite unique constraints, @@map for custom table names, and @@id for composite primary keys.
Instalar extensiones
Agregue herramientas IO a su navegador favorito para obtener acceso instantáneo y búsquedas más rápidas
恵 ¡El marcador ha llegado!
Marcador es una forma divertida de llevar un registro de tus juegos, todos los datos se almacenan en tu navegador. ¡Próximamente habrá más funciones!
Herramientas clave
Ver todo Los recién llegados
Ver todoActualizar: Nuestro última herramienta se agregó el 4 de Abr de 2026
