Prisma and Drizzle are the two most popular ways to talk to a SQL database from TypeScript. Prisma offers a schema language and a high-level client; Drizzle stays close to SQL with schemas written in TypeScript. This course teaches both on the same project, so you understand what each does well and can work confidently in either codebase.
What you'll learn
- Why ORMs and query builders exist, and what they hide from you
- Prisma: the schema file, generating the client, CRUD queries and relations
- Prisma Migrate: development and production migrations, and handling drift
- Drizzle: defining schemas in TypeScript, the SQL-like query API and the relational query API
- Drizzle Kit: generating, pushing and running migrations
- Modelling one-to-many and many-to-many relations, enums and soft deletes
- Transactions, optimistic locking and handling unique constraint errors
- Spotting N+1 queries, selecting only needed fields, indexing and reading query plans
- Using both with PostgreSQL, MySQL and SQLite, and with serverless and edge runtimes
- Seeding, testing against a real database and choosing between the two for a new project
Who it's for
- TypeScript developers building APIs with Node.js, NestJS or Next.js
- Developers who use Prisma or Drizzle by copying examples and want to understand them properly
- Teams deciding which ORM to standardise on
Prerequisites
- Solid TypeScript (see React & TypeScript Fundamentals or equivalent experience)
- Basic SQL (see SQL and PostgreSQL Essentials)
- Node.js and a local or hosted PostgreSQL database
Outcomes
By the end of this course you will be able to:
- Design a relational schema and manage it with migrations in Prisma or Drizzle.
- Write type-safe queries, including relations and transactions.
- Find and fix slow ORM-generated queries.
- Choose the right tool for a project and explain the trade-offs.
Course outline
| Module | Topic |
|---|---|
| 1 | ORMs, query builders and raw SQL |
| 2 | Prisma schema and client basics |
| 3 | Prisma relations and nested writes |
| 4 | Prisma Migrate in development and production |
| 5 | Drizzle schemas in TypeScript |
| 6 | Drizzle queries: SQL-like and relational APIs |
| 7 | Drizzle Kit migrations |
| 8 | Transactions, constraints and error handling |
| 9 | Performance: N+1, indexes and query plans |
| 10 | Serverless, edge runtimes and connection pooling |
| 11 | Testing and seeding |
| 12 | Project: one API built with both ORMs |
FAQ
Which one should I learn first?
If your project already uses one, start there. For a new project we discuss the trade-offs so you can choose, and the course covers both.
Do I still need to know SQL?
Yes. Both tools produce SQL, and understanding it is how you debug and optimise them.
Can I use these with NestJS?
Yes. See NestJS Backend Development with TypeScript for the framework side.
How do I join?
Get in touch and we'll share the current format, schedule and enrolment details.