Section 11: Designing a Schema with Prisma Schema Language
- The multi-file schema.prisma structure, scalar types and common attributes (@id, @unique, @default, @@index)
- Default functions autoincrement(), uuid(7), cuid(2), ulid(), noting that uuid()/cuid() run only on the client side
- PostgreSQL native types (@db.Uuid, @db.JsonB, @db.Timestamptz) and designing indexes for query patterns
Section 12: Relations Between Tables
- One-to-one, one-to-many, many-to-many (implicit and explicit join tables) and self-relations
- onDelete and onUpdate (Cascade, Restrict, SetNull), composite keys and relationMode (foreignKeys vs prisma)
- Workshop: design a complete example schema (User, Role, Product, Category, Order, OrderItem, Payment)
Section 13: Prisma Migrate Across the Development Lifecycle
- The difference between migrate dev, migrate deploy, db push and the shadow database
- Handling drift (migrate status, resolve, diff), baselining and seed data with prisma db seed
- Common error codes (P3005, P3006, P3009, P3014, P3018) and safe production migration practices
Section 14: Deep Prisma Client Queries
- Full CRUD and batch operations, advanced filtering (AND, OR, NOT, in, contains, mode: insensitive)
- Loading relations (include, select, nested write), pagination (offset vs cursor) and aggregation (count, groupBy, _sum)
- JSON fields, full-text search, raw queries ($queryRaw, $executeRaw), preventing SQL injection and TypedSQL (Preview)
Section 15: Transactions, Performance and the Connection Pool
- Sequential vs interactive transactions, the maxWait, timeout and isolation level options, and handling write conflicts (P2034)
- The N+1 problem in Prisma and how to detect it, relationLoadStrategy (Preview) and enabling query logging to see the real SQL
- The connection pool in Prisma 7 (set at the driver adapter), PgBouncer/Supavisor, and Prisma Client Extensions replacing $use
Section 16: MariaDB with Prisma - Real Usage and Caveats
- MariaDB uses the same mysql provider as MySQL, installing @prisma/adapter-mariadb, and a type-mapping comparison with PostgreSQL
- Features unavailable on MariaDB (scalar list, multiSchema, mode: insensitive, createManyAndReturn) and its advantages (full-text index)
- Key caveats: open Prisma 7 issues with MariaDB around JSON, migration drift, timezone and collation, plus a workshop moving the schema to MariaDB