prisma-database-setup

Configure Prisma ORM with PostgreSQL, MySQL, SQLite, MongoDB, and other database providers.

Updated Aug 19, 2026
One-click install
npx skills add https://github.com/nethangabrielb/tasks-app-practical-exam --skill prisma-database-setup-nethangabrielb
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: prisma-database-setup
Source: https://github.com/nethangabrielb/tasks-app-practical-exam/tree/main/packages/database/.agents/skills/prisma-database-setup
Command: npx skills add https://github.com/nethangabrielb/tasks-app-practical-exam --skill prisma-database-setup-nethangabrielb

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Setting up Prisma with the correct database provider, connection string format, driver adapter, and client generation workflow is error-prone, especially with the differences between Prisma 7 SQL setups and MongoDB's Prisma 6.x path. This Skill provides provider-specific configuration guides that prevent misconfiguration and connection failures. ## Core Features & Use Cases - Provider-Specific Guides: Step-by-step setup for PostgreSQL, MySQL, SQLite, MongoDB, SQL Server, CockroachDB, and Prisma Postgres, including schema blocks, prisma.config.ts, and .env connection strings. - Driver Adapter Setup: Correct adapter and driver pairings (e.g., @prisma/adapter-pg with pg, @prisma/adapter-mariadb with mariadb) with PrismaClient instantiation examples. - Prisma Client Generation: Required generator block configuration with explicit output paths and regeneration workflow after schema changes. - Use Case: When switching a NestJS project from SQLite to PostgreSQL, follow the PostgreSQL reference to update the datasource provider, set the DATABASE_URL format, install @prisma/adapter-pg, and instantiate PrismaClient with the adapter. ## Quick Start Ask the AI to configure Prisma for your database, for example: "Set up Prisma 7 with PostgreSQL including the driver adapter and client generation."

Frequently Asked Questions about prisma-database-setup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure Prisma with PostgreSQL?▼

Set provider to "postgresql" in prisma/schema.prisma, define the datasource URL in prisma.config.ts using env('DATABASE_URL'), and format the connection string as postgresql://USER:PASSWORD@HOST:5432/DATABASE?schema=public. Then install @prisma/adapter-pg and pg, and pass a PrismaPg adapter instance to PrismaClient.

How to set up Prisma Client with a driver adapter?▼

Install prisma and @prisma/client, add a generator block with provider "prisma-client" and an explicit output path, then run npx prisma generate. Instantiate PrismaClient with the adapter matching your database, such as PrismaPg for PostgreSQL or PrismaMariaDb for MySQL.

Can I use MongoDB with Prisma 7?▼

MongoDB projects should stay on the latest Prisma 6.x release with the prisma-client-js generator and the connection URL kept in schema.prisma. The Prisma 7 SQL driver adapter workflow does not apply to MongoDB, and no supported MongoDB upgrade path to Prisma 7 exists.

Which Prisma driver adapter do I need for my database?▼

PostgreSQL, CockroachDB, and Prisma Postgres use @prisma/adapter-pg with pg; MySQL uses @prisma/adapter-mariadb with mariadb; SQLite uses @prisma/adapter-better-sqlite3 or @prisma/adapter-libsql for Turso; SQL Server uses @prisma/adapter-mssql. MongoDB uses no SQL adapter.

Why does Prisma fail to connect to my database?▼

Common causes include incorrect host or port, firewall rules, the database server not running, or unencoded special characters in the password. For PostgreSQL, also verify the ?schema= parameter exists in the connection URL and matches an existing schema.

What are the limitations of SQLite with Prisma?▼

SQLite does not support enums or scalar list types like String[], and write operations lock the database file, limiting concurrency. Connection strings use the file:PATH format, with paths resolved relative to the schema location.