prisma-postgres-setup

Provisions a Prisma Postgres database via the Management API and connects it to a local project.

Updated Sep 17, 2026
One-click install
npx skills add https://github.com/team-zerolatency/cfta --skill prisma-postgres-setup-team-zerolatency
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: prisma-postgres-setup
Source: https://github.com/team-zerolatency/cfta/tree/main/packages/database/.windsurf/skills/prisma-postgres-setup
Command: npx skills add https://github.com/team-zerolatency/cfta --skill prisma-postgres-setup-team-zerolatency

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 your project, and configuring Prisma 7's new client adapter pattern. This Skill automates that entire workflow end to end. ## Core Features & Use Cases - API-driven provisioning: Authenticates with a service token, lists available regions, and creates a project with a database through the Prisma Management API, extracting the direct connection string automatically. - Local project configuration: Installs required packages (prisma, @prisma/client, @prisma/adapter-pg, pg, dotenv), writes DATABASE_URL to .env, and sets up prisma.config.ts following Prisma 7 conventions. - Schema and migration workflow: Offers starter schemas or generates one from a natural-language description, then runs prisma migrate dev and verifies the connection with a test script. - Use Case: You just scaffolded a new Node.js app and need a hosted Postgres database. Ask the Skill to set up Prisma Postgres, pick a region from an interactive menu, and get a working, verified database connection with migrations in minutes. ## 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: 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 either. Pass an adapter such as PrismaPg wrapping a pg.Pool instead.

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 process.env with dotenv. The schema.prisma datasource block should only declare provider = "postgresql" with no url or directUrl.

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

Avoid it for CI/CD preview databases, which belong to a dedicated CI/CD workflow, and for multi-tenant provisioning inside an app, which requires the OAuth-based integrator approach. Existing connected databases only need standard Prisma CLI migration commands.