prisma-postgres-setup

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

Updated Jul 21, 2026
One-click install
npx skills add https://github.com/8ReTid8/vitural_reality_test --skill prisma-postgres-setup-8retid8
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prisma-postgres-setup
Source: https://github.com/8ReTid8/vitural_reality_test/tree/main/my-app/.windsurf/skills/prisma-postgres-setup
Command: npx skills add https://github.com/8ReTid8/vitural_reality_test --skill prisma-postgres-setup-8retid8

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, extracting the connection string, and configuring Prisma 7's new client adapter pattern. This Skill automates that entire workflow through the Prisma Management API. ## Core Features & Use Cases - Automated Provisioning: Creates a Prisma Postgres project and database via the Management API, handling region selection, provisioning polling, and connection string extraction. - Prisma 7 Local Configuration: Installs required packages, writes the direct connection string to .env, configures prisma.config.ts, and scaffolds the schema with migrations. - Connection Verification: Runs an end-to-end test script using the PrismaPg driver adapter to confirm the database connection works before finishing. - Use Case: You start a new Node.js project and need a hosted Postgres database. The Skill provisions the database, wires up Prisma 7 with the correct adapter pattern, and verifies connectivity in one guided flow. ## Quick Start Ask the assistant to set up a new Prisma Postgres database for this project and connect it locally using your 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 enabled, then extract the direct connection string from the response. The Skill automates region selection, provisioning, and local configuration.

How do I connect Prisma 7 to a Postgres database?

Prisma 7 requires a driver adapter: create a pg.Pool with your DATABASE_URL, wrap it in PrismaPg from @prisma/adapter-pg, and pass it to new PrismaClient({ adapter }). Connection URLs live in prisma.config.ts, not schema.prisma.

Where do I get a Prisma Management API service token?

Create a service token in Prisma Console under Workspace Settings, then Service Tokens. The token is shown only once, is scoped to the entire workspace, and should be stored in an environment variable such as PRISMA_SERVICE_TOKEN.

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

Prisma 7 removed the default constructor and the datasourceUrl option, so PrismaClient requires an explicit driver adapter. Pass { adapter } created from PrismaPg and a pg.Pool, and import the client from ./generated/prisma/client.js.

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

When project creation fails due to a database limit, list existing projects via GET /v1/projects, choose one to delete with DELETE /v1/projects/{id}, then retry creation. The Skill presents existing projects as an interactive selection for deletion.

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 belong to dedicated CI/CD or integrator workflows, while schema changes use standard Prisma CLI commands.