prisma-postgres-setup

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

Updated Aug 10, 2026
One-click install
npx skills add https://github.com/AlvaroCG123/BancoAtividade --skill prisma-postgres-setup-alvarocg123
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: prisma-postgres-setup
Source: https://github.com/AlvaroCG123/BancoAtividade/tree/main/AtividadeBanco/.windsurf/skills/prisma-postgres-setup
Command: npx skills add https://github.com/AlvaroCG123/BancoAtividade --skill prisma-postgres-setup-alvarocg123

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 so a local project goes from zero to a verified database connection in one guided session. ## Core Features & Use Cases - API-driven provisioning: Authenticates with a service token, lists available regions, creates a project with a database, and polls until the database status is ready. - Local project configuration: Installs required npm packages, writes the direct connection string to .env, scaffolds prisma/schema.prisma and prisma.config.ts, and runs prisma migrate dev. - Prisma 7 client setup: Enforces the driver adapter pattern (pg.Pool + PrismaPg) and verifies the connection end-to-end with a test script. - Use Case: A developer starting a new Node.js app asks to "set up a database" — the Skill provisions a Prisma Postgres instance in their chosen region, configures the schema, runs the initial migration, and confirms connectivity. ## Quick Start Ask the assistant 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 for a new project?▼

Authenticate with a workspace service token, pick an available region from GET /v1/regions/postgres, then POST to /v1/projects with createDatabase set to true. Extract the direct connection string from the response and store it as DATABASE_URL in your .env file.

How do I get a Prisma Postgres connection string?▼

Create a project with a database via the Management API and read data.database.connections[0].endpoints.direct.connectionString from the response. Use the direct endpoint, not the pooled or accelerate endpoints, which are only for legacy Accelerate setups.

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. Calling new PrismaClient() with no arguments or with datasourceUrl throws in Prisma 7.

Why does Prisma Postgres authentication fail with a 401 error?▼

A 401 authentication-failed error means the service token is invalid or expired. Create a new token in Prisma Console under Workspace Settings, Service Tokens, and set it as the PRISMA_SERVICE_TOKEN environment variable.

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

Do not use this workflow for CI/CD preview databases or multi-tenant provisioning built into an app, which need dedicated approaches. It is also unnecessary for databases that already exist and are connected, where standard Prisma CLI migration commands suffice.