Overview

Use Prisma ORM 7 for typed access to Postgres and SQLite from TypeScript. Prisma 7 is the stable line (7.10.0). As of 2026-10-01 Prisma 8 is a release candidate (8.0.0-rc.19) with a different API (a contract.prisma file and @prisma/orm-postgres), GA is expected in October 2026, and Prisma 7 keeps bug and security fixes for 18 months after Prisma 8 reaches GA. These pages describe Prisma 7.

Pin both packages to the 7 line

On the npm registry, prisma@latest is the prerelease 8.0.0-rc.19 (the prev tag is 7.10.0), while @prisma/client@latest is 7.10.0 and @prisma/adapter-pg@latest is 7.10.0, so a bare npm install prisma pairs a Prisma 8 CLI with a Prisma 7 client. Pin both to 7 and re-check with npm view prisma dist-tags before relaxing the pin.

npm install prisma@7 @prisma/client@7

Prisma 7 needs Node 20.19+, 22.12+, or 24+, TypeScript 5.4+, and an ESM project ("type": "module").

Wire Prisma 7 in three files

The connection URL lives in prisma.config.ts, not in schema.prisma; the generator must set output; the client needs a driver adapter.

// prisma/schema.prisma
generator client {
  provider = "prisma-client"
  output   = "../src/generated/prisma"
}
 
datasource db {
  provider = "postgresql"
}
// prisma.config.ts
import "dotenv/config"
import { defineConfig, env } from "prisma/config"
 
export default defineConfig({
  schema: "prisma/schema.prisma",
  migrations: { path: "prisma/migrations" },
  datasource: { url: env("DATABASE_URL") },
})
// src/db.ts
import { PrismaPg } from "@prisma/adapter-pg"
import { PrismaClient } from "./generated/prisma/client"
 
export const prisma = new PrismaClient({
  adapter: new PrismaPg({ connectionString: process.env.DATABASE_URL }),
})

Prisma 7 does not load .env files itself, and migrate dev and db push no longer run prisma generate or seed scripts. Run npx prisma generate explicitly.

Send each task to its page