PREPARE
PERSISTENCE.
@domain-first/project-structure
Set up the Project Structure PostgreSQL preset for Prisma 8 RC: a starter contract, configuration, optional shared service and migration scripts.
Choose the PostgreSQL preset.
npx df-psSelect Add integration → Prisma 8 (PostgreSQL, RC). Choose whether to generate the shared Prisma infrastructure service and whether prisma should become your default persistence implementation label.
This preset targets Prisma 8 RC with PostgreSQL. It is not a Prisma 7 migration tool. The scaffolder prepares files and scripts; it does not connect to the database.
Keep database setup in Infrastructure.
src/shared/infrastructure/prisma/
prisma.config.ts
contract.prisma
Optional:
src/shared/infrastructure/services/
... PrismaInfrastructureService
src/shared/wiring/
... service factory when wire is enabledExisting contracts and models are preserved. The optional service exposes orm, uses the Temporal polyfill and reuses its client across development hot reloads. With wire enabled, a factory is generated too.
Package scripts point at the generated Prisma config. Existing script conflicts can be kept, replaced or renamed. Install the missing dependencies printed by the CLI; existing declared dependencies are preserved.
Add the connection and models.
Configure DATABASE_URL, add models to contract.prisma and run emit before compiling or importing the generated service. The CLI loads .env; your application must load its own runtime environment. Add the printed exception for the Prisma directory to your linter ignores.
The documented preset expects Node.js 22.18+, TypeScript 5.9+, ESM and JSON import support. Review compatibility with the dependencies selected in your project.
Emit. Plan. Review. Apply.
npm run prisma:emitnpm run prisma:migration:planReview the planned migration before applying it.
npm run prisma:migration:applyEmit produces the contract artifacts; plan emits the contract and plans a migration; apply applies migrations and advances the db reference. Prisma manages generated contract files and migration history.
Repository and execution-handler skeletons still need your actual persistence behavior. See Building blocks ↗.