prisma-postgres-setup

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

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

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, the Management API, and local project configuration. This Skill automates the entire provisioning workflow, from authentication to a verified working connection, eliminating configuration errors common with Prisma 7's new client instantiation model. ## Core Features & Use Cases - Automated Provisioning: Authenticates with a service token, lists available regions, creates a project with a database, and retrieves the direct connection string via the Management API. - Local Project Configuration: Installs required packages (prisma, @prisma/client, @prisma/adapter-pg, pg, dotenv), writes DATABASE_URL to .env, and configures prisma.config.ts and schema.prisma for Prisma 7. - Schema and Migration Setup: Offers interactive schema options (manual, starter Blog schema, or natural-language generation) and runs prisma migrate dev to create migration history. - Use Case: A developer starting a new Next.js app asks to "set up a database". The Skill provisions a Prisma Postgres database in their chosen region, configures the project, pushes an initial schema, and verifies the connection end-to-end with a test script. ## 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 to 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 configure prisma.config.ts to load it.

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?

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 set to 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 either. Pass an adapter such as PrismaPg wrapping a pg.Pool instead.

What should I do when Prisma Postgres database creation hits a limit?

List existing projects with GET /v1/projects, present them for selection, delete one with DELETE /v1/projects/{projectId}, then retry creation. Deleting a project also removes all its databases.

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

Avoid it for CI/CD preview databases, multi-tenant provisioning built into an app, or databases that already exist and are connected. Those scenarios use dedicated CI/CD or integrator flows, and existing databases use standard Prisma CLI migration tasks.