prisma-postgres-setup

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

Updated Jul 9, 2026
One-click install
npx skills add https://github.com/DimonikRV/ghost-pilot-project --skill prisma-postgres-setup-dimonikrv
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: prisma-postgres-setup
Source: https://github.com/DimonikRV/ghost-pilot-project/tree/main/.agents/skills/prisma-postgres-setup
Command: npx skills add https://github.com/DimonikRV/ghost-pilot-project --skill prisma-postgres-setup-dimonikrv

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 project in the Console, obtaining a connection string, installing the right Prisma 7 packages, configuring prisma.config.ts, and verifying the connection. This Skill automates that entire provisioning and connection workflow through the Prisma Management API. ## Core Features & Use Cases - Automated Database Provisioning: Creates a Prisma Postgres project and database via the Management API, including region selection and polling until the database status is ready. - Local Project Configuration: Installs required packages (prisma, @prisma/client, @prisma/adapter-pg, pg, dotenv), writes the direct connection string to .env, and configures prisma.config.ts for Prisma 7. - Schema and Migration Setup: Offers starter schemas or generates one from a natural-language description, then runs prisma migrate dev and verifies the connection end-to-end. - Use Case: You are starting a new Next.js app and need a hosted Postgres database. Ask the agent to set up Prisma Postgres, pick a region from the interactive menu, and get a working, verified database connection with migrations 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 with POST /v1/projects including createDatabase: true, extract the direct connection string from the response, write it to .env as DATABASE_URL, then run npx 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 set to true. The response contains data.database.connections[0].endpoints.direct.connectionString, which is the direct PostgreSQL connection string to use as DATABASE_URL.

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 new PrismaClient(). 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 removed the default constructor and the datasourceUrl option. You must pass a driver adapter explicitly: new PrismaClient({ adapter }) where the adapter wraps a pg.Pool configured with your connection string.

What authentication does the Prisma Management API use?▼

The API uses workspace-scoped service tokens passed as a Bearer token in the Authorization header. Create one in Prisma Console under Workspace Settings, Service Tokens, and store it in the PRISMA_SERVICE_TOKEN environment variable.

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 cases use the prisma-postgres-cicd or prisma-postgres-integrator skills, or standard Prisma CLI commands.