Define application entities
Represent a domain entity such as a user, order, or product in the Prisma schema.
Prisma · Const
A Prisma model defines an application-domain entity in the Prisma schema. Prisma maps it to a table for relational databases or a collection for MongoDB.
A model block declares an application entity in Prisma Schema Language. Its fields describe the model's data and relations, while Prisma maps the model to a database table for relational connectors or a collection for MongoDB.
model ModelName {
fieldName FieldType
}model block whose contents are fields.model block, with its fields declared inside the block.model User {
id Int @id @default(autoincrement())
email String @unique
}Add a model block to schema.prisma, then run Prisma's normal schema-generation workflow to expose the model through Prisma Client.
Represent a domain entity such as a user, order, or product in the Prisma schema.
Describe the fields belonging to an entity and its relationships to other entities.
Generate a database representation from a schema model for a relational or MongoDB data source.
A Prisma model is a schema-level declaration of an application entity. It maps to a table in relational databases and to a collection in MongoDB.
Follow-up: How are model properties described? Fields inside the model block define the model's data and relations.
Models are written as model blocks in Prisma Schema Language. The block contains fields that describe the entity and its relationships.
Follow-up: Where is this declaration normally placed? It belongs in the Prisma schema, typically a file named schema.prisma.
A model represents an entity in the application domain and maps that entity to an underlying database structure. The concrete structure varies by data source.
Follow-up: What changes between relational databases and MongoDB? The model targets a table for relational databases and a collection for MongoDB.
Prisma schemaPrisma Schema Language (PSL)fieldsrelationsscalar typesenums