Prisma Course: Zero To Hero 🎯

Sakura Dev

✅Prisma Docs👉🏻

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⭐):

0:00 Intro
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
17:49 Enums
19:21 Relationships
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:13:45 Pagination
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
1:44:12 Update
1:50:32 Upsert
1:53:08 Delete
1:55:00 Transactions