prisma-database-setup

Configure Prisma ORM schema, client generation, and driver adapters for multiple database providers.

1|Updated May 1, 2026
One-click install
npx skills add https://github.com/Joshkovu/ghost-ai --skill prisma-database-setup-joshkovu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prisma-database-setup
Source: https://github.com/Joshkovu/ghost-ai/tree/main/.agents/skills/prisma-database-setup
Command: npx skills add https://github.com/Joshkovu/ghost-ai --skill prisma-database-setup-joshkovu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It removes guesswork when configuring Prisma ORM across different database providers, helping you set up the correct schema, environment variables, client generation, and (when applicable) driver adapters.

Core Features & Use Cases

  • Provider-specific Prisma configuration: Guidance for PostgreSQL, MySQL/MariaDB, SQLite, MongoDB, SQL Server, CockroachDB, and Prisma Postgres.
  • Correct generator and client setup: Ensures prisma/schema.prisma has the right generator block and that prisma generate is rerun after schema changes.
  • Driver adapter wiring for SQL providers: Covers adapter selection and Prisma Client instantiation patterns for supported relational workflows.
  • MongoDB-safe handling: Explicitly avoids Prisma 7 SQL adapter guidance for MongoDB and describes the Prisma 6.x approach.
  • Troubleshooting and environment correctness: Helps resolve common connectivity and setup errors by validating prerequisites and connection string expectations.

Quick Start

Generate and wire up Prisma for PostgreSQL by editing prisma/schema.prisma with provider = "postgresql", adding the Prisma Client generator output, then run npx prisma generate and instantiate PrismaClient using the @prisma/adapter-pg adapter with DATABASE_URL.

Frequently Asked Questions about prisma-database-setup

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

FAQPage Schema
How do I set up Prisma ORM with PostgreSQL and a driver adapter?

To set up Prisma ORM with PostgreSQL, configure `provider = "postgresql"` in `schema.prisma`, add the Prisma Client generator output, run `npx prisma generate`, and instantiate `PrismaClient` using the `@prisma/adapter-pg` adapter with your `DATABASE_URL` environment variable.

Does Prisma support MongoDB with SQL driver adapters?

Prisma explicitly excludes Prisma 7 SQL adapter patterns for MongoDB configurations. You must use the Prisma 6.x approach instead, ensuring your MongoDB setup follows the correct provider-specific datasource details and avoids incompatible SQL adapter instantiations.

Why does Prisma Client fail to connect after switching database providers?

Prisma Client connection failures after switching databases usually occur because `prisma generate` was not rerun after schema changes, or the connection string and driver adapter mismatch the new provider's datasource details. Validate your prerequisites and environment variables.

Can I use Prisma to connect to multiple database providers like MySQL, SQLite, and CockroachDB?

Yes, Prisma ORM supports configuring connections to multiple database providers including PostgreSQL, MySQL, MariaDB, SQLite, SQL Server, CockroachDB, and Prisma Postgres by aligning your schema, client generation, and driver adapter wiring for each specific provider.

What is the correct Prisma generator setup for reliable database connections?

Correct Prisma generator setup requires ensuring `prisma/schema.prisma` contains the right `generator` block with explicit output defined, and that you rerun `npx prisma generate` after any schema changes to keep the client synchronized with your database configuration.

How do I troubleshoot Prisma database connection and adapter mismatches?

Troubleshoot Prisma database connection mismatches by validating environment correctness, confirming connection string expectations, and verifying that your SQL driver adapter instantiation aligns with the provider specified in your `prisma/schema.prisma` datasource block.