PostgreSQL Setup. Reference when using this Prisma feature.
npx skills add https://github.com/prisma/cursor-plugin --skill prisma-database-setup-postgresql
Configure Prisma with PostgreSQL.
In prisma/schema.prisma:
datasource db {
provider = "postgresql"
}
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'),
},
})
In .env:
DATABASE_URL="postgresql://user:password@localhost:5432/mydb?schema=public"
postgresql://USER:PASSWORD@HOST:PORT/DATABASE?schema=SCHEMA
public)Prisma ORM 7 uses the query compiler by default, so you must use a driver adapter.
npm install @prisma/adapter-pg pg
import 'dotenv/config'
import { PrismaClient } from '../generated/client'
import { PrismaPg } from '@prisma/adapter-pg'
const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL })
const prisma = new PrismaClient({ adapter })
?schema=public (or your schema) is in the URLTake prisma/prisma-database-setup-postgresql from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference npm.
Without those the skill loads but fails at the first command.