prisma-postgres-setup

Provisions Prisma Postgres databases via the Management API and connects them to local projects.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires prisma, @prisma/client, @prisma/adapter-pg, pg, dotenv, and includes references (resource) components.

What problem does it solve? Setting up a new Prisma Postgres database involves multiple manual steps: creating a project, choosing a region, obtaining a connection string, configuring Prisma 7, and verifying connectivity. This Skill automates that entire provisioning workflow through the Prisma Management API. ## Core Features & Use Cases - Automated Provisioning: Creates a Prisma Postgres project and database via the Management API, handles region selection, and polls until the database is ready. - Prisma 7 Configuration: Installs required packages, writes the direct connection string to .env, and configures prisma.config.ts with the driver adapter pattern. - End-to-End Verification: Runs a connection test script to confirm the database works before finishing. - Use Case: You are starting a new Node.js project and need a hosted Postgres database. Ask the agent to set up Prisma Postgres, pick a region from the interactive menu, and receive a working DATABASE_URL with migrations applied. ## Quick Start Set up a new Prisma Postgres database for this project and connect it locally using my service token.

Frequently Asked Questions about prisma-postgres-setup

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

FAQPage Schema
How do I set up a Prisma Postgres database from the command line?▼

Use the Prisma Management API with a workspace service token to create a project with createDatabase enabled, then extract the direct connection string from the response. Write it to your .env file as DATABASE_URL and run prisma migrate dev to initialize the schema.

How do I get a Prisma Postgres connection string?▼

Create a project via POST /v1/projects with createDatabase set to true, then read data.database.connections[0].endpoints.direct.connectionString from the response. Use the direct endpoint, not the pooled or Accelerate endpoints.

How do I instantiate PrismaClient in Prisma 7?▼

Prisma 7 requires a driver adapter: create a pg.Pool with your DATABASE_URL, wrap it in PrismaPg from @prisma/adapter-pg, and pass { adapter } to the PrismaClient constructor. Calling new PrismaClient() with no arguments throws an error.

Why does Prisma 7 not use a url in schema.prisma?▼

Prisma 7 moves connection URLs out of schema.prisma into prisma.config.ts, which loads DATABASE_URL from the environment via dotenv. The datasource block in the schema only declares the postgresql provider.

What should I do when Prisma Postgres project creation hits a database limit?▼

List your existing projects with GET /v1/projects, present them for selection, delete one with DELETE /v1/projects/{projectId}, and retry the creation request. Deleting a project also removes all its databases.

When should I not use the Prisma Management API for database setup?▼

Do not use it for CI/CD preview databases, multi-tenant provisioning inside an application, or databases that already exist and are connected. Those cases use dedicated CI/CD or integrator flows, and existing databases use standard Prisma CLI migration commands.