CRUD Operations with Prisma
Learn how to perform basic CRUD operations with the Prisma ORM.
CRUD operations are an important building block of back-end applications. They allow us to Create, Read, Update and Delete data, usually from a database or data structure.
Create
To create a new record in the database, we use the create method in the PrismaClient class.
The data key in the create method maps to the model that we created earlier.
...
model employee {
id Int @default(autoincrement()) @id
email String @unique
name String?
}
Read
To retrieve data from the database, we have ...