In today's lecture, Harkirat provided a comprehensive Recap of Prisma
, focusing on the framework's approach to defining and managing relationships within a database schema
. He also explains the significance of the Prisma Client
in facilitating database operations and the role of Prisma's migration system
in tracking and applying schema changes.
In Prisma, relationships between tables are defined using a straightforward and expressive syntax within the Prisma schema file. These relationships are crucial for representing how data in one table is associated with data in another, and Prisma supports several types of relationships to model the various ways in which data can be interconnected.
Prisma allows you to define the following types of relationships:
For the TODO app, there is a one-to-many relationship between the User
and Todo
models. This means that one user can have many todos, but each todo is associated with only one user.