prisma-postgres-setup

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

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

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, including polling until the database status is ready. - Local project configuration: Install required packages, write the direct connection string to .env, scaffold prisma/schema.prisma and prisma.config.ts, and run prisma migrate dev to create migration history and generate the client. - Prisma 7 client setup: Configure the pg driver adapter pattern (pg.Pool + PrismaPg + PrismaClient) and verify the connection with a test script. - Use Case: You start a new Node.js project and say "set up a database". The Skill provisions a Prisma Postgres database in your chosen region, configures your project, pushes a starter schema, and verifies the connection works. ## Quick Start Ask the AI 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, create a project via POST /v1/projects with createDatabase set to true, and extract the direct connection string. Then write it to .env as DATABASE_URL, run npx prisma init, and push your schema with npx prisma migrate dev.

How to get a Prisma Postgres connection string from the Management API?▼

Create a project with a database using POST /v1/projects and read data.database.connections[0].endpoints.direct.connectionString from the response. Use the direct endpoint, not the pooled or accelerate endpoints, which are 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 throws, and the datasourceUrl option no longer exists.

Does Prisma 7 still use the url field in schema.prisma?▼

No. In Prisma 7, connection URLs are managed in prisma.config.ts via the datasource url property, not in schema.prisma. The schema datasource block should only declare provider = "postgresql", and prisma.config.ts must import dotenv/config to load .env variables.

Why does Prisma Postgres project creation fail with a database limit error?▼

Workspaces have a limit on databases, so creation fails when the limit is reached. List existing projects with GET /v1/projects, delete an unused one with DELETE /v1/projects/{projectId}, then retry the creation request.

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

Do not use this workflow for CI/CD preview databases or for building multi-tenant provisioning into an application, as those require dedicated approaches. It is also unnecessary for databases that already exist and are connected, where standard Prisma CLI migration tasks apply.