prisma-postgres-setup

Provision Prisma Postgres databases via the Management API and connect them to local projects.

Updated Aug 21, 2026
One-click install
npx skills add https://github.com/Rithika135/watchtower-360 --skill prisma-postgres-setup-rithika135
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prisma-postgres-setup
Source: https://github.com/Rithika135/watchtower-360/tree/main/watchtower360-backend/.windsurf/skills/prisma-postgres-setup
Command: npx skills add https://github.com/Rithika135/watchtower-360 --skill prisma-postgres-setup-rithika135

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 through the Management API, choosing a region, extracting the right connection string, installing Prisma 7 dependencies, configuring prisma.config.ts, and verifying the connection. This Skill automates that entire provisioning and local configuration workflow. ## Core Features & Use Cases - API-driven provisioning: Authenticate with a service token, list available regions, create a project with a database, and poll until the database status is ready. - Local project configuration: Install the required Prisma 7 packages, write the direct connection string to .env, scaffold schema.prisma and prisma.config.ts, and run the initial migration. - End-to-end verification: Generate and run a test-connection script using the pg driver adapter to confirm the database works before finishing. - Use Case: You start a new Node.js project and need a hosted Postgres database. The Skill creates the Prisma Postgres project, retrieves the direct connection string, configures Prisma 7 with ESM output, runs prisma migrate dev, and verifies connectivity in one guided flow. ## Quick Start Ask the agent 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: list available regions via GET /v1/regions/postgres, then POST /v1/projects with createDatabase set to true. Extract the direct connection string from the response and store it as DATABASE_URL in your .env file.

How do I get a Prisma Postgres connection string?

Create a project with createDatabase enabled and read data.database.connections[0].endpoints.direct.connectionString from the API response. Use the direct endpoint, not the pooled or Accelerate endpoints, which are only for legacy setups.

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": "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; you must pass a PrismaPg adapter wrapping a pg.Pool instead.

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

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 and migration tasks use the standard Prisma CLI.