prisma-postgres-setup

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

7|2|Updated Jul 24, 2026
One-click install
npx skills add https://github.com/ysfcl/GeoMorphosis --skill prisma-postgres-setup-ysfcl
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: prisma-postgres-setup
Source: https://github.com/ysfcl/GeoMorphosis/tree/main/.windsurf/skills/prisma-postgres-setup
Command: npx skills add https://github.com/ysfcl/GeoMorphosis --skill prisma-postgres-setup-ysfcl

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, extracting the connection string, and configuring Prisma 7's new client adapter pattern. This Skill automates the entire provisioning and local connection workflow through the Prisma Management API. ## Core Features & Use Cases - Automated Provisioning: Creates a Prisma Postgres project and database via the Management API, handles region selection, and polls until the database status is ready. - Prisma 7 Configuration: Installs required packages, writes the direct connection string to .env, scaffolds prisma.config.ts, and sets up the pg driver adapter pattern correctly. - End-to-End Verification: Runs a test connection script to confirm the database works before finishing, with self-correction guidance for 401, 404, 422, and 429 API errors. - Use Case: You start a new Node.js project and need a hosted Postgres database. The Skill provisions the database, configures schema.prisma and prisma.config.ts, runs prisma migrate dev, and verifies connectivity in one guided flow. ## Quick Start Set up a new Prisma Postgres database for this project and connect it locally.

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. Create a project via POST /v1/projects with createDatabase set to true, extract the direct connection string from the response, write it to .env as DATABASE_URL, then run npx prisma migrate dev.

How to create a Prisma Postgres connection string?▼

Create a project with a database through 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, for new projects.

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

Prisma 7 requires a driver adapter passed to the constructor. Create a pg.Pool with your DATABASE_URL, wrap it in PrismaPg from @prisma/adapter-pg, and pass { adapter } to PrismaClient. The datasourceUrl option no longer exists.

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

In Prisma 7, connection URLs belong in prisma.config.ts via the datasource url field loaded from process.env. The schema.prisma datasource block should only declare provider = "postgresql" with no url or directUrl.

What should I do when the Prisma Management API returns 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 use it in the Authorization Bearer header for all API requests.

When should I not use this database setup workflow?▼

Do not use it for CI/CD preview databases or multi-tenant provisioning built into an app, which have dedicated workflows. It is also unnecessary for databases that already exist and are connected, where standard Prisma CLI migration tasks apply.