prisma-postgres-setup

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

Updated Jul 27, 2026
One-click install
npx skills add https://github.com/Soares-B/Livia-Lace --skill prisma-postgres-setup-soares-b
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prisma-postgres-setup
Source: https://github.com/Soares-B/Livia-Lace/tree/main/livia-lace/.windsurf/skills/prisma-postgres-setup
Command: npx skills add https://github.com/Soares-B/Livia-Lace --skill prisma-postgres-setup-soares-b

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 local environment, and configuring Prisma 7's new client adapter pattern. This Skill automates that entire workflow so you get a working, verified database connection without reading API docs. ## Core Features & Use Cases - Database Provisioning via Management API: Authenticates with a service token, lists available regions, creates a project with a database, and polls until the database status is ready. - Local Project Configuration: Installs required packages (prisma, @prisma/client, @prisma/adapter-pg, pg, dotenv), writes DATABASE_URL to .env, and sets up prisma.config.ts following Prisma 7 conventions. - Schema and Migration Setup: Offers starter schemas or generates one from a natural-language description, then runs prisma migrate dev to create migration history and generate the client. - Connection Verification: Runs a test script against the database to confirm end-to-end connectivity before finishing. - Use Case: You are starting a new Node.js e-commerce backend and need a hosted Postgres database. The Skill provisions the database, configures your project, and verifies the connection 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 for a new project?

Authenticate with a workspace service token, list available regions via GET /v1/regions/postgres, then create a project with POST /v1/projects using createDatabase: true. Extract the direct connection string from the response and write it to your .env file as DATABASE_URL.

How do I get a Prisma Postgres connection string?

Create a project with createDatabase set to true and read data.database.connections[0].endpoints.direct.connectionString from the response. Use the direct endpoint, not the pooled or accelerate endpoints, which are only for legacy Accelerate 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.

What should I do when Prisma API returns a 401 authentication-failed error?

A 401 means your service token is invalid or expired. Create a new token in Prisma Console under Workspace Settings, then Service Tokens, and use it in the Authorization Bearer header for all Management API requests.

When should I not use this database setup workflow?

Do not use it for CI/CD preview databases, which belong to the prisma-postgres-cicd skill, or for multi-tenant provisioning inside an app, which belongs to prisma-postgres-integrator. Existing connected databases only need standard Prisma CLI migration commands.