prisma-postgres-setup

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

Updated Jul 8, 2026
One-click install
npx skills add https://github.com/NarixHine/uni-chem --skill prisma-postgres-setup-narixhine
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: prisma-postgres-setup
Source: https://github.com/NarixHine/uni-chem/tree/main/.agents/skills/prisma-postgres-setup
Command: npx skills add https://github.com/NarixHine/uni-chem --skill prisma-postgres-setup-narixhine

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 your project, and configuring Prisma 7's new client adapter pattern. This Skill automates that entire workflow so you get a working, verified database connection without reading API docs. ## Core Features & Use Cases - Automated Provisioning: Creates a Prisma Postgres project and database through the Management API, including region selection and polling until the database status is ready. - Local Project Configuration: Installs required packages, writes the direct connection string to .env, scaffolds prisma.config.ts, and sets up the Prisma 7 ESM client with the pg driver adapter. - End-to-End Verification: Runs a test connection script against the live database to confirm everything works before finishing. - Use Case: You are starting a new Node.js app and need a hosted Postgres database. Ask the agent to set up Prisma Postgres, pick a region from the interactive menu, and receive a migrated schema, generated client, and verified connection 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: list available regions, create a project with createDatabase set to true, then extract the direct connection string from the response. Write it to .env as DATABASE_URL and run prisma migrate dev to initialize the schema.

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, for new projects.

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 setup fail with a 401 authentication error?▼

A 401 authentication-failed response means the service token is missing, invalid, or expired. Create a new token in Prisma Console under Workspace Settings, Service Tokens, and pass it as a Bearer token in the Authorization header of every API request.

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. If the database already exists and is connected, standard Prisma CLI commands handle schema and migration tasks directly.