Backend & APISûr100100/100
Prisma Database Setup Postgresql (Prisma)
PostgreSQL Setup. Reference when using this Prisma feature.
ou envoie-le directement à ton agent.
Installer dans ton projet
$ curl -fsSL https://arboristhree.xyz/cli/install-skill.mjs -o /tmp/arboris-install-skill.mjs && node /tmp/arboris-install-skill.mjs prisma-database-setup-postgresql__prisma-cursor-plugin__skills-47ce95bcd944Prisma
prisma/cursor-plugin
Contenu à copier
---
name: prisma-database-setup-postgresql
description: PostgreSQL Setup. Reference when using this Prisma feature.
license: MIT
metadata:
origin: Prisma
author: prisma
version: "7.0.0"
---
# PostgreSQL Setup
Configure Prisma with PostgreSQL.
## Prerequisites
- PostgreSQL database (local or cloud)
- Connection string
## 1. Schema Configuration
In `prisma/schema.prisma`:
```prisma
datasource db {
provider = "postgresql"
}
generator client {
provider = "prisma-client"
output = "../generated"
}
```
## 2. Config Configuration (v7)
In `prisma.config.ts`:
```typescript
import { defineConfig, env } from 'prisma/config'
export default defineConfig({
schema: 'prisma/schema.prisma',
datasource: {
url: env('DATABASE_URL'),
},
})
```
## 3. Environment Variable
In `.env`:
```env
DATABASE_URL="postgresql://user:password@localhost:5432/mydb?schema=public"
```
### Connection String Format
```
postgresql://USER:PASSWORD@HOST:PORT/DATABASE?schema=SCHEMA
```
- **USER**: Database user
- **PASSWORD**: Password (URL encoded if special chars)
- **HOST**: Hostname (localhost, IP, or domain)
- **PORT**: Port (default 5432)
- **DATABASE**: Database name
- **SCHEMA**: Schema name (default `public`)
## Driver Adapter (Prisma ORM 7 required)
Prisma ORM 7 uses the query compiler by default, so you must use a driver adapter.
1. Install adapter and driver:
```bash
npm install @prisma/adapter-pg pg
```
2. Instantiate Prisma Client with the adapter:
```typescript
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 })
```
## Common Issues
### "Can't reach database server"
- Check host and port
- Check firewall settings
- Ensure database is running
### "Authentication failed"
- Check user/password
- Special characters in password must be URL-encoded
### "Schema does not exist"
- Ensure `?schema=public` (or your schema) is in the URLColle ce Markdown dans ton agent ou utilise les boutons ci-dessus pour l’écrire dans ton projet.
Ce que fait Prisma Database Setup Postgresql (Prisma)
PostgreSQL database (local or cloud)
Connection string
**USER**: Database user
**PASSWORD**: Password (URL encoded if special chars)
Comment utiliser Prisma Database Setup Postgresql (Prisma)
1
Copie le prompt
Un clic copie le prompt packagé (ou l'envoie à ton agent).
2
L'agent installe le skill
Il ajoute le SKILL.md et ses ressources à ton projet.
3
Activation automatique
Le skill s'active dès que le contexte correspond.
Déclencheurs pour Prisma Database Setup Postgresql (Prisma)
Dis simplement à ton agent quelque chose comme :
Applique le skill prisma-database-setup-postgresql__prisma-cursor-plugin__skills-47ce95bcd944 à cette tâche
Utilise prisma-database-setup-postgresql__prisma-cursor-plugin__skills-47ce95bcd944 pour améliorer cette implémentation
Passe en revue ce sujet avec prisma-database-setup-postgresql__prisma-cursor-plugin__skills-47ce95bcd944
Skills liés à Prisma Database Setup Postgresql (Prisma)
Activate Site (Microsoft)
Activates and provisions a Power Pages website in a Power Platform environment via the Power Platform REST API. Use when the user wants to activate, provision, turn on, or enable a Power Pages website or portal.IA Core (TanStack)
Entry point for TanStack AI skills. Routes to chat-experience, tool-calling, media-generation, structured-outputs, adapter-configuration, ag-ui-protocol, middleware, locks, custom-backend-integration, and debug-logging, plus the skills shipped by companion packages (@tanstack/ai-persistence, @tanstack/ai-code-mode). Use chat() not streamText(), openaiText() not createOpenAI(), toServerSentEventsResponse() not manual SSE, middleware hooks not onEnd callbacks.api-connector-builder
Build a new API connector or provider by matching the target repo's existing integration pattern exactly. Use when adding one more integration without inventing a second architecture.