prisma-postgres-setup

Provision a Prisma Postgres database via the Management API and connect it to a local project.

Updated Aug 7, 2026
One-click install
npx skills add https://github.com/Sambhav242005/Major-Project --skill prisma-postgres-setup-sambhav242005
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prisma-postgres-setup
Source: https://github.com/Sambhav242005/Major-Project/tree/main/apps/web/.windsurf/skills/prisma-postgres-setup
Command: npx skills add https://github.com/Sambhav242005/Major-Project --skill prisma-postgres-setup-sambhav242005

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 across the Prisma Console, Management API, and local project configuration. This Skill automates the entire provisioning workflow, from authentication to a verified working connection. ## 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 configure prisma.config.ts and schema.prisma for Prisma 7. - End-to-end verification: Run migrations, generate the client, and execute a test script confirming the database connection works. - Use Case: You are starting a new Node.js project and need a hosted Postgres database. The Skill creates the database in your chosen region, wires up the Prisma 7 client with the pg adapter, and verifies connectivity 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. Create a project via POST /v1/projects with createDatabase set to true, extract the direct connection string from the response, and write it to your .env file as DATABASE_URL.

How do I get 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.

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 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; you must pass a PrismaPg adapter wrapping a pg.Pool instead.

What should I do when Prisma API returns a 401 authentication error?

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

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

Do not use it for CI/CD preview databases or multi-tenant provisioning built into an app, which need dedicated workflows. Standard Prisma CLI commands suffice for databases that already exist and are connected.