PedroTech on YouTube · Open on YouTube
Core skills: building for the web · Advanced beginner · Lesson 25 of 98 · 2 h 36 min video, then about 6 hours of practice
Talking to Postgres from code: an ORM and migrations
After this you can define a schema in Prisma, query it with type safety from Node, and evolve it with migrations.
Why it matters
In application code you rarely write raw SQL for every query; an ORM such as Prisma gives you typed queries and, more importantly, migrations: versioned, reviewable changes to your schema that run the same way on every machine and in production. Focus on the schema file, relations, migrations, and avoiding the N+1 query problem. Trap: editing the production database by hand. Every schema change goes through a migration.
How to use this resource
A full Prisma course: schema, queries, relations and migrations.
Go further
Go deeper