skills/prisma-database-setup-prisma-postgres/SKILL.md
Prisma Postgres Setup
npx skillsauth add prisma/cursor-plugin prisma-database-setup-prisma-postgresInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Configure Prisma with Prisma Postgres (Managed).
Prisma Postgres is a serverless, managed PostgreSQL database optimized for Prisma.
You can provision a Prisma Postgres instance directly via the CLI:
prisma init --db
This will:
.env with the connection string.The connection string starts with prisma+postgres://.
DATABASE_URL="prisma+postgres://[email protected]/env_id"
In prisma/schema.prisma:
datasource db {
provider = "postgresql" // Use postgresql provider
}
generator client {
provider = "prisma-client"
output = "../generated"
}
In prisma.config.ts:
import { defineConfig, env } from 'prisma/config'
export default defineConfig({
schema: 'prisma/schema.prisma',
datasource: {
url: env('DATABASE_URL'),
},
})
Prisma ORM 7 uses the query compiler by default, so you must use a driver adapter. For Prisma Postgres, use the Prisma Postgres serverless driver adapter.
Install adapter and driver:
npm install @prisma/adapter-ppg @prisma/ppg
Use a direct TCP connection string for the adapter (from the Prisma Console) and instantiate Prisma Client:
import 'dotenv/config'
import { PrismaClient } from '../generated/client'
import { PrismaPostgresAdapter } from '@prisma/adapter-ppg'
const prisma = new PrismaClient({
adapter: new PrismaPostgresAdapter({
connectionString: process.env.PRISMA_DIRECT_TCP_URL,
}),
})
Since Prisma ORM 7 requires a driver adapter, use the Prisma Postgres adapter shown above when instantiating Prisma Client.
databases
Schema Changes. Reference when using this Prisma feature.
tools
Removed Features. Reference when using this Prisma feature.
tools
Prisma Config. Reference when using this Prisma feature.
tools
ESM Support. Reference when using this Prisma feature.