prisma-postgres-setup

Provision Prisma Postgres databases via the Management API and connect them to local projects.

Updated Aug 17, 2026
One-click install
npx skills add https://github.com/Sahil-Showket/ShopSphere --skill prisma-postgres-setup-sahil-showket
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: prisma-postgres-setup
Source: https://github.com/Sahil-Showket/ShopSphere/tree/main/services/product-service/.windsurf/skills/prisma-postgres-setup
Command: npx skills add https://github.com/Sahil-Showket/ShopSphere --skill prisma-postgres-setup-sahil-showket

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 service token, choosing a region, provisioning a project through the Management API, extracting the connection string, and configuring Prisma 7 client code correctly. This Skill automates that entire workflow end-to-end. ## Core Features & Use Cases - Database Provisioning via Management API: Authenticate with a service token, list available regions, create a project with a database, and poll until the database status is ready. - Local Project Configuration: Install required packages (prisma, @prisma/client, @prisma/adapter-pg, pg, dotenv), write the direct connection string to .env, and configure prisma.config.ts for Prisma 7. - Schema and Migration Setup: Generate a starter schema or build one from a natural-language description, then run prisma migrate dev and verify the connection with a test script. - Use Case: A developer starting a new Node.js microservice asks to "set up a database" and receives a fully provisioned Prisma Postgres instance with migrations, a generated client, and a verified connection. ## Quick Start Ask the agent to set up a new Prisma Postgres database for this project and connect it locally using your 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: list available regions, create a project with createDatabase set to true, and extract the direct connection string from the response. Then write it to .env as DATABASE_URL and run prisma migrate dev.

How do I get a Prisma Postgres connection string?▼

Create a project via POST /v1/projects with createDatabase enabled, 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?▼

Create a pg.Pool with your DATABASE_URL, wrap it in a PrismaPg adapter from @prisma/adapter-pg, and pass { adapter } to the PrismaClient constructor. Import the client from ./generated/prisma/client.js and ensure package.json has type set to module.

Why does new PrismaClient() throw an error in Prisma 7?▼

Prisma 7 requires a driver adapter, so calling new PrismaClient() with no arguments throws. The datasourceUrl option no longer exists; you must pass a PrismaPg adapter wrapping a pg.Pool instead.

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

List existing projects with GET /v1/projects, present them to the user for selection, delete the chosen project with DELETE /v1/projects/{projectId}, and retry the creation request.

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

Do not use it for CI/CD preview databases or multi-tenant provisioning built into an app, which need dedicated workflows. It is also unnecessary when the database already exists and only schema or migration tasks remain.