Connect Prisma to Postgres, MySQL, SQLite or MongoDB.
Prisma's official guide to configuring a database provider. Your agent uses it when starting a project, switching databases or fixing connection problems.
Install this skill
npx skills add https://github.com/prisma/skills --skill prisma-database-setupRuns the open-source skills CLI in your own terminal. It asks which agents to add the skill to. Read what it tells your agent to do before you install it.
Install for your agent
Claude Code
Run this in your project
npx skills add https://github.com/prisma/skills --skill prisma-database-setup -a claude-codeAdd
-gto install it for every project instead.Or ask Claude Code to do it
Install the "prisma-database-setup" skill from https://github.com/prisma/skills for Claude Code. Copy the skill folder (the one containing SKILL.md, with any scripts or reference files next to it) into .claude/skills/ in this project. Before copying, show me the SKILL.md and list any scripts it includes, and wait for me to confirm.
Or copy the folder yourself
Unzip the download into
.claude/skills/for this project, or~/.claude/skills/for all your projects.Picked up in the current session, no restart needed.
Claude Code skills docsClaude.ai
Upload the ZIP
- In Settings > Capabilities, turn on Code execution and file creation.
- Go to Customize > Skills, press +, then Create skill.
- Choose Upload a skill and pick the ZIP you downloaded.
Free, Pro and Max plans. On Team and Enterprise, an owner turns skills on in Organization settings first.
Claude.ai skills docsChatGPT
Upload the ZIP
- Open Skills in ChatGPT and select Create.
- Select Upload from your computer and pick the ZIP you downloaded.
- Wait for ChatGPT's safety scan. A skill marked Needs Review asks you to check it before use.
Skills that rely on scripts or a terminal may not work unchanged in ChatGPT.
ChatGPT skills docsCodex
Run this in your project
npx skills add https://github.com/prisma/skills --skill prisma-database-setup -a codexAdd
-gto install it for every project instead.Or ask Codex to do it
Install the "prisma-database-setup" skill from https://github.com/prisma/skills for Codex. Copy the skill folder (the one containing SKILL.md, with any scripts or reference files next to it) into .agents/skills/ in this project. Before copying, show me the SKILL.md and list any scripts it includes, and wait for me to confirm.
Or copy the folder yourself
Unzip the download into
.agents/skills/for this project, or~/.agents/skills/for all your projects.Restart Codex if the skill does not show up.
Codex skills docsCursor
Run this in your project
npx skills add https://github.com/prisma/skills --skill prisma-database-setup -a cursorAdd
-gto install it for every project instead.Or ask Cursor to do it
Install the "prisma-database-setup" skill from https://github.com/prisma/skills for Cursor. Copy the skill folder (the one containing SKILL.md, with any scripts or reference files next to it) into .cursor/skills/ in this project. Before copying, show me the SKILL.md and list any scripts it includes, and wait for me to confirm.
Or copy the folder yourself
Unzip the download into
.cursor/skills/for this project, or~/.cursor/skills/for all your projects.Run it by typing / and the skill name in chat.
Cursor skills docsGitHub Copilot
Run this in your project
npx skills add https://github.com/prisma/skills --skill prisma-database-setup -a github-copilotAdd
-gto install it for every project instead.Or ask GitHub Copilot to do it
Install the "prisma-database-setup" skill from https://github.com/prisma/skills for GitHub Copilot. Copy the skill folder (the one containing SKILL.md, with any scripts or reference files next to it) into .github/skills/ in this project. Before copying, show me the SKILL.md and list any scripts it includes, and wait for me to confirm.
Or copy the folder yourself
Unzip the download into
.github/skills/for this project, or~/.copilot/skills/for all your projects.Works in Copilot CLI, the cloud agent and agent mode in VS Code and JetBrains.
GitHub Copilot skills docsAntigravity
Run this in your project
npx skills add https://github.com/prisma/skills --skill prisma-database-setup -a antigravityAdd
-gto install it for every project instead.Or ask Antigravity to do it
Install the "prisma-database-setup" skill from https://github.com/prisma/skills for Antigravity. Copy the skill folder (the one containing SKILL.md, with any scripts or reference files next to it) into .agents/skills/ in this project. Before copying, show me the SKILL.md and list any scripts it includes, and wait for me to confirm.
Antigravity skills docsOr copy the folder yourself
Unzip the download into
.agents/skills/for this project, or~/.gemini/config/skills/for all your projects.Gemini CLI
Run this in your project
npx skills add https://github.com/prisma/skills --skill prisma-database-setup -a gemini-cliAdd
-gto install it for every project instead.Or ask Gemini CLI to do it
Install the "prisma-database-setup" skill from https://github.com/prisma/skills for Gemini CLI. Copy the skill folder (the one containing SKILL.md, with any scripts or reference files next to it) into .gemini/skills/ in this project. Before copying, show me the SKILL.md and list any scripts it includes, and wait for me to confirm.
Or copy the folder yourself
Unzip the download into
.gemini/skills/for this project, or~/.gemini/skills/for all your projects.Run /skills to check it was found.
Gemini CLI skills docs
- Installs
- 283.5K via skills.sh
- GitHub
- 57 stars ↗
- Last updated
- 8 Sept 2026
- Licence
- MIT
Security checks
Run by independent scanners and published on skills.sh. Their results, not a Viberation review.
- 1 Apr 2026
Gen Agent Trust Hub Pass
The skill provides comprehensive documentation and setup guides for Prisma ORM v7 with various database providers. It uses standard placeholders for configuration and references official vendor packages. No security issues were detected.
- 1 Apr 2026
Socket Pass
No alerts
- 1 Apr 2026
Snyk Pass
Risk: LOW · No issues
- 26 Feb 2026
Runlayer Pass
4/9 files flagged
- 16 Apr 2026
ZeroLeaks Pass
Score: 93/100 · 2 sections analyzed
What's inside (9 files)
references/cockroachdb.md1.8K charsreferences/mongodb.md2.7K charsreferences/mysql.md2.7K charsreferences/postgresql.md1.8K charsreferences/prisma-client-setup.md1.3K charsreferences/prisma-postgres.md3.2K charsreferences/sqlite.md2.2K charsreferences/sqlserver.md2.1K charsSKILL.md5.8K chars
SKILL.md, first part. Shown as plain text.
---
name: prisma-database-setup
description: Guides for configuring Prisma with different database providers (PostgreSQL, MySQL, SQLite, MongoDB, etc.). Use when setting up a new project, changing databases, or troubleshooting connection issues. Triggers on "configure postgres", "connect to mysql", "setup mongodb", "sqlite setup".
license: MIT
metadata:
author: prisma
version: "7.6.0"
---
# Prisma Database Setup
Comprehensive guides for configuring Prisma ORM with various database providers.
## When to Apply
Reference this skill when:
- Initializing a new Prisma project
- Switching database providers
- Configuring connection strings and environment variables
- Troubleshooting database connection issues
- Setting up database-specific features
- Generating and instantiating Prisma Client
## Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|----------|----------|--------|--------|
| 1 | Provider Guides | CRITICAL | provider names |
| 2 | Prisma Postgres | HIGH | `prisma-postgres` |
| 3 | Client Setup | CRITICAL | `prisma-client-setup` |
## System Prerequisites
- **Node.js 20.19.0+**
- **TypeScript 5.4.0+**
## Bun Runtime
If you're using Bun, run Prisma CLI commands with `bunx --bun prisma ...` so Prisma uses the Bun runtime instead of falling back to Node.js.
## Supported Databases
| Database | Provider String | Notes |
|----------|-----------------|-------|
| PostgreSQL | `postgresql` | Default, full feature support |
| MySQL | `mysql` | Widespread support, some JSON diffs |
| SQLite | `sqlite` | Local file-based, no enum/scalar lists |
| MongoDB | `mongodb` | Mongo-specific workflow; do not apply SQL driver-adapter guidance |
| SQL Server | `sqlserver` | Microsoft ecosystem |
| CockroachDB | `cockroachdb` | Distributed SQL, Postgres-compatible |
| Prisma Postgres | `postgresql` | Managed serverless database |
## Configuration Files
Your configuration shape depends on the provider and Prisma major version:
1. **All providers** use **`prisma/schema.prisma`**.
2. **Prisma 7 SQL setups** typically use **`prisma.config.ts`** for datasource URLs.
3. **MongoDB projects should stay on Prisma 6.x**, keep `url = env("DATABASE_URL")` in the schema, and continue using the classic MongoDB setup.
## Driver Adapters
The standard SQL workflow uses a driver adapter. Choose the adapter and driver for your database and pass the adapter to `PrismaClient`.
| Database | Adapter | JS Driver |
|----------|---------|-----------|
| PostgreSQL | `@prisma/adapter-pg` | `pg` |
| CockroachDB | `@prisma/adapter-pg` | `pg` |
| Prisma Postgres (Node.js) | `@prisma/adapter-pg` | `pg` |
| Prisma Postgres (edge/serverless) | `@prisma/adapter-ppg` | `@prisma/ppg` |
| MySQL / MariaDB | `@prisma/adapter-mariadb` | `mariadb` |
| SQLite | `@prisma/adapter-better-sqlite3` | `better-sqlite3` |
| SQLite (Turso/LibSQL) | `@prisma/adapter-libsql` | `@libsql/client` |
| SQL Server | `@prisma/adapter-mssql` | `node-mssql` |
MongoDB should not follow the Prisma 7 SQL adapter workflow. Use the latest Prisma 6.x release for MongoDB projects and do not install a SQL `@prisma/adapter-*` package for it.
Example (PostgreSQL):
```ts
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 })
```
## Prisma Client Setup (Required)
Prisma Client must be installed and generated for any database.
1. Install Prisma CLI and Prisma Client:
```bash
npm install prisma --save-dev
npm install @prisma/client
```
1. Add a generator block (`prisma-client` requires an explicit output path):
```prisma
generator client {
provider = "prisma-client"
output = "../generated"
}
```
1. Generate Prisma Client:
```bash
npx prisma generate
```
1. For SQL providers, instantiate Prisma Client with the database-specific driver adapter:
Key info
- Pricing
- Open source
- Category
- Skills
Related reading
- Fundamentals
Row level security is the security boundary
If your database rows are protected by a check in your application code, they are not protected. Anything holding a key can talk to the database directly, an…
Expert