prisma-postgres-setup

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

Updated Aug 30, 2026
One-click install
npx skills add https://github.com/Rashidrxq/SalesOrder-ERP-REMEX --skill prisma-postgres-setup-rashidrxq
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: prisma-postgres-setup
Source: https://github.com/Rashidrxq/SalesOrder-ERP-REMEX/tree/main/sales_order/.windsurf/skills/prisma-postgres-setup
Command: npx skills add https://github.com/Rashidrxq/SalesOrder-ERP-REMEX --skill prisma-postgres-setup-rashidrxq

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 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, creates a project with a database, and polls until the database is ready. - Local project configuration: Installs required packages, writes the direct connection string to .env, scaffolds prisma/schema.prisma and prisma.config.ts, and runs the initial migration. - Prisma 7 client setup: Enforces the driver adapter pattern (pg.Pool + PrismaPg) and verifies the connection with a test script. - Use Case: You start a new Node.js project and say "set up a Prisma Postgres database for this app" — the Skill provisions the database, configures the schema, runs prisma migrate dev, and confirms connectivity. ## Quick Start Ask the agent to set up a new Prisma Postgres database and connect it to your current project, providing your workspace service token if you have one.

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, POST to /v1/projects with createDatabase set to true, then extract the direct connection string from the response. Write it to .env as DATABASE_URL and run npx 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?▼

Prisma 7 requires a driver adapter: create a pg.Pool with your DATABASE_URL, wrap it in PrismaPg from @prisma/adapter-pg, and pass { adapter } to the PrismaClient constructor. Calling new PrismaClient() with no arguments or with datasourceUrl throws an error.

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

A 401 authentication-failed response 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?▼

Avoid this workflow for CI/CD preview databases, multi-tenant provisioning inside an application, or databases that already exist and are connected. Those cases use dedicated CI/CD or integrator flows, while schema and migration tasks on existing databases use the standard Prisma CLI.