
prisma-database-setup-prisma-postgres
✓ Official★ 8by prisma · part of prisma/cursor-plugin
Prisma Postgres Setup
Prisma Postgres Setup
Inspect the full instructions your agent will receiveExpandCollapse
This is the exact playbook injected into your agent when the skill activates — shown here so you can audit it before installing. You don't need to read it to use the skill.
by prisma
Prisma Postgres Setup
npx skills add https://github.com/prisma/cursor-plugin --skill prisma-database-setup-prisma-postgres
Download ZIPGitHub8
Overview
Prisma Postgres is a serverless, managed PostgreSQL database optimized for Prisma.
Connection String
The connection string starts with prisma+postgres://.
DATABASE_URL="prisma+postgres://[email protected]/env_id"
Driver Adapter (Prisma ORM 7 required)
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,
}),
})
Features
-
Serverless: Scales to zero.
-
Caching: Integrated query caching (Accelerate).
-
Real-time: Database events (Pulse).
Using with Prisma Client
Since Prisma ORM 7 requires a driver adapter, use the Prisma Postgres adapter shown above when instantiating Prisma Client.
npm install @prisma/adapter-ppg @prisma/ppgRun this in your project — your agent picks the skill up automatically.
Prisma Postgres Setup
Configure Prisma with Prisma Postgres (Managed).
Setup via CLI
You can provision a Prisma Postgres instance directly via the CLI:
prisma init --db
This will:
-
Log you into Prisma Data Platform.
-
Create a new project and database instance.
-
Update your
.envwith the connection string.
1. Schema Configuration
In prisma/schema.prisma:
datasource db {
provider = "postgresql" // Use postgresql provider
}
generator client {
provider = "prisma-client"
output = "../generated"
}
2. Config Configuration
In prisma.config.ts:
import { defineConfig, env } from 'prisma/config'
export default defineConfig({
schema: 'prisma/schema.prisma',
datasource: {
url: env('DATABASE_URL'),
},
})
No common issues documented yet. If you hit a problem, the repository's GitHub Issues page is the best place to look.