prisma-postgres-setup

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

Updated May 23, 2026
One-click install
npx skills add https://github.com/kveperedo/website --skill prisma-postgres-setup-kveperedo
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: prisma-postgres-setup
Source: https://github.com/kveperedo/website/tree/main/.agents/skills/prisma-postgres-setup
Command: npx skills add https://github.com/kveperedo/website --skill prisma-postgres-setup-kveperedo

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, wiring the connection string into a local project, and configuring Prisma 7's new client instantiation pattern. This Skill automates that entire workflow end to end. ## Core Features & Use Cases - API-driven provisioning: Authenticate with a service token, list available regions, and create a project with a database through the Prisma Management API. - Local project configuration: Install required packages, write the direct connection string to .env, and set up prisma.config.ts and schema.prisma following Prisma 7 conventions. - Schema and migration workflow: Generate a starter schema or one from a natural-language description, then run prisma migrate dev to create migration history. - Connection verification: Run a test script using the pg driver and @prisma/adapter-pg adapter to confirm the database works before finishing. - Use Case: A developer starting a new Node.js project asks to "set up a database" and gets 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, then extract the direct connection string from the response. Write it to your .env file as DATABASE_URL and configure prisma.config.ts.

How do I create a Prisma service token for the Management API?▼

Create a service token in Prisma Console under Workspace Settings, then Service Tokens. Copy it immediately since it is shown only once, and pass it as a Bearer token in the Authorization header of every API request.

How does Prisma 7 client instantiation differ from earlier versions?▼

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

Where does the database URL go in Prisma 7, schema.prisma or prisma.config.ts?▼

In Prisma 7 the connection URL belongs in prisma.config.ts via the datasource url field, loaded from the environment with dotenv. The schema.prisma datasource block only declares provider = "postgresql" with no url or directUrl.

What should I do if Prisma project creation fails due to a database limit?▼

List your existing projects with GET /v1/projects, pick one to remove, and delete it via DELETE /v1/projects/{projectId}. Then retry the project creation request with your chosen region.

When should I not use this database setup workflow?▼

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 are covered by dedicated CI/CD and integrator workflows or standard Prisma CLI commands.