❤️Please Support me by subscribing to my channel 👉🏻https://www.youtube.com/@sakuradev?sub_confirmation=1
In this video, we’ll explore the basics of using Prisma for database management. We’ll start by defining our data models using Prisma’s declarative syntax. Then, we’ll learn how to apply migrations and introspect existing databases to create Prisma models.
With our data models in place, we’ll dive into one of Prisma’s most powerful features: relationships between models. We’ll learn how to define one-to-one, one-to-many, and many-to-many relationships, as well as cascading actions like deletes and updates.
Next, we’ll explore the Prisma Client, a high-level API for querying, creating, updating, and deleting records. We’ll cover the query API, including filters and relation filters, which allow us to easily retrieve specific subsets of data.
With our queries sorted, we’ll turn our attention to creating, updating, and deleting data in the database. We also implement Offset and Cursor pagination with Prisma and then We’ll cover transactions, which allow us to group multiple database operations together and roll them back if necessary.
By the end of this course, you’ll have a solid understanding of how to use Prisma to manage your databases efficiently and effectively. Whether you’re building a small web app or a large-scale enterprise system, Prisma’s intuitive syntax and powerful features make it a must-have tool for any modern developer.
🗃️ GitHub Repo (Don’t forget to give it a⭐): https://github.com/vahid-nejad/prisma-crash-course
1:24 Setting up PostgreSQL with Docker
3:19 Setting up Prisma
5:59 Data Models
7:00 Introspection and Migrations
8:48 Defining Data Models
11:38 Runing Migrations
12:52 Attributes: Modify the behavior of fields and model
14:57 Prisma Studio
26:24 One-To-Many Relationships
29:57 Many-To-Many Relationships
33:15 Setting up Prisma Client
34:51 Fetch data with Find functions
36:30 Seed the data base
41:58 Filters: How we can narrow down result of a query
43:48 Operators in Filters
51:21 Relation Filters
59:38 Nested queries
1:00:36 Selecting Specific Fields
1:03:10 Aggregation Functions
1:08:22 Group By
1:11:34 Sort the Result of a Query
1:15:18 Offset Pagination
1:21:05 Cursor Pagination
1:25:26 Insert data to data base
1:35:45 Cascading Delete and Update
1:41:49 Take Inserting data from client