prisma-postgres-setup

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

Updated Aug 9, 2026
One-click install
npx skills add https://github.com/mousetailor/doker_and_cd_pipeline --skill prisma-postgres-setup-mousetailor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prisma-postgres-setup
Source: https://github.com/mousetailor/doker_and_cd_pipeline/tree/main/packages/db/.agents/skills/prisma-postgres-setup
Command: npx skills add https://github.com/mousetailor/doker_and_cd_pipeline --skill prisma-postgres-setup-mousetailor

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 end-to-end. ## Core Features & Use Cases - Automated Provisioning: Creates a Prisma Postgres project and database through the Management API, handles region selection, 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. - Connection Verification: Generates and runs a test script using the Prisma 7 PrismaPg adapter to confirm the database connection works before finishing. - 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 Prisma 7 correctly, runs the first migration, and verifies connectivity. ## Quick Start Set up a new Prisma Postgres database for this project and connect it to my local environment.

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. Import the client from ./generated/prisma/client.js and ensure package.json has type set to module.

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

Prisma 7 removed the zero-argument constructor and the datasourceUrl option. You must pass a driver adapter such as PrismaPg wrapping a pg.Pool, otherwise the client throws a non-empty options error.

What should I do when Prisma Management API returns 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 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, multi-tenant provisioning inside an application, or databases that already exist and are connected. Those scenarios use dedicated CI/CD or integrator flows, and existing databases only need standard Prisma CLI migration commands.