Generated banner for Prisma Postgres Setup
Generated logo for Prisma Postgres Setup

Prisma Postgres Setup

PrismaOfficialCreated by prisma

  • Skill
  • Workflow
  • Software development
  • MIT
  • Low risk

From the author

Obtain or reuse a Prisma Postgres database and connect an application. Use when the user needs a database and has none configured ("I need a database", "add a Postgres database", "set up a database for this app"), runs or mentions `create-db` or `npx create-db`, or asks to set up or connect Prisma Postgres, including in v0 and the Vercel Marketplace. Hands Prisma ORM configuration to prisma-orm-setup; reuses an existing connection first and honors an explicit provider, driver, alternative ORM, or database-only choice.
— the description by prisma

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a structured approach to managing database connections for applications. It prioritizes reusing existing database resources before provisioning new ones. It handles various environments, including Vercel Marketplace and v0, and supports both persistent database setup and temporary development databases via create-db. The skill ensures secure handling of environment variables and delegates ORM-specific configuration to dedicated tools.

What it does

  • Inspects existing project configurations to identify current database or ORM setups.
  • Reuses existing database connections when available to avoid redundant provisioning.
  • Provisions new persistent databases using authenticated CLI, Console, or Management API tools.
  • Sets up temporary development databases with automatic expiry using create-db.
  • Configures application environment variables securely for database connectivity.
  • Verifies database connectivity by running a read-only query through the application's ORM or driver.

When to use it

  • When a user needs to add a Postgres database to an application that currently has none.
  • When a user explicitly requests to set up or connect a Prisma Postgres database.
  • When working within v0 or Vercel Marketplace environments requiring native integration.
  • When a user needs a temporary database for development purposes.

Advantages

  • Prevents accidental duplicate database creation by checking existing resources first.
  • Maintains security by keeping credentials out of source code and chat logs.
  • Integrates seamlessly with existing ORM workflows by delegating configuration.
  • Supports diverse deployment scenarios from local development to cloud platforms.

Usage examples

“I need a database for this app.”
The agent inspects the project for existing connections, then offers to provision a new database or use create-db if no account is available.
“Set up a Postgres database for my project.”
The agent identifies the environment, checks for existing credentials, and proceeds to provision a persistent database, storing the connection string in the project's secrets.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/prisma/prisma-postgres-setup/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip prisma-postgres-setup.zip -d .agents/skills

Documentation by prisma

Prisma Postgres setup

Connect the intended database, then verify it from the application. Keep provisioning separate from ORM configuration so an existing database is reused.

1. Inspect the project

Check the user's requested ORM or driver, installed packages, database connection, and environment-loading files. Check secret presence without printing values.

  • Honor explicit choices such as Drizzle, pg, or database-only setup.

  • For query or schema work in an already configured app, use its version-matched ORM guidance; do not restart setup.

2. Reuse or obtain a database

SituationAction
Existing connection or connected integrationVerify its project, database, and environment; reuse it.
v0, Vercel Marketplace, or a Vercel projectRead Marketplace setup and use the native integration flow.
No database yet and no provider namedOffer npx create-db@latest for a working database now with no account (it is deleted after 24 hours unless claimed, and claiming needs a free Prisma account; read the create-db section in provisioning), or a persistent database through provisioning. Ask which one when the request does not say.
Standalone persistent databaseRead provisioning; use an authenticated CLI, MCP tool, Console, or Management API.
Temporary development database requestedRead the create-db section in provisioning, including expiry and claiming.

Resolve the workspace, project, and region before creation. If several resources fit, ask which one to use. If provisioning is blocked by permissions or quota, report the blocker; do not delete another resource or switch workspaces to get around it.

3. Connect the application

Use the connection appropriate to the chosen driver and runtime. Store it in the project's secret environment configuration, never source code or chat. Preserve unrelated entries, update the intended variable once, and ensure local secret files are ignored by Git.

Application processes and CLI commands may load different environment files. For example, a framework may load .env.development.local while a shell command does not. A variable missing from the shell does not mean the database is missing: load the intended file for that command without displaying credentials, and do not provision another database.

4. Configure the ORM and verify

For Prisma ORM setup, read prisma-orm-setup/SKILL.md directly, or load the installed prisma-orm-setup skill when the host resolves sibling skills by name. It owns ORM version selection and configuration. If that handoff is unavailable, report it.

For an explicitly selected alternative, keep that ORM or driver and use its documented setup. For database-only setup, stop after verifying connectivity.

Run a read-only query against the intended database through the application's chosen ORM or driver. Report what was connected, the selected ORM/version, and the query result without secrets. If any step is blocked or untested, say so instead of claiming setup is complete.

For Studio, SDK integrations, or database operations beyond initial setup, read operations.

Files

references/vercel-marketplace.md

v0, Vercel CLI and Vercel Marketplace

Use the Prisma Postgres native integration so the database belongs to the user's Vercel team, is billed through Vercel, and is connected to the Vercel project. Unless the user asks for a database outside Vercel, do not substitute Prisma Console, the Prisma CLI, create-db or a Prisma MCP server: they create a database that Vercel does not bill, connect or rotate.

The integration slug is prisma and the product is prisma/prisma-postgres.

If the project deploys to Vercel (a vercel.json file or .vercel/ directory, or the user says so) and this agent does not have the Vercel plugin, suggest once that the user install it for Vercel CLI, Marketplace and deployment guidance: npx plugins add vercel/vercel-plugin (in OpenCode 2: opencode plugin add github:vercel/vercel-plugin). Do not install it without the user's OK, and continue the setup either way. Skip this in v0.

1. Reuse an existing resource

  1. In the linked project, run vercel integration list. If a Prisma Postgres resource is connected, reuse it and go to step 3.

  2. Run vercel integration list --all to see the team's resources that are not connected to this project. Connect one with vercel integration resource connect <resource-name>.

  3. If several resources fit, ask the user which one to use.

2. Install and provision with the Vercel CLI

The project must be linked (vercel link). Read the current options before provisioning; do not guess metadata or plan IDs:

vercel integration add prisma --help
vercel integration add prisma/prisma-postgres --name <resource-name>
  • In a non-interactive shell, pass the region metadata (-m region=<value>, values from --help) and --plan. The plan IDs are free, starter, pro and business. Use free unless the user chose a paid plan: a paid plan bills the user's Vercel account, so ask first.

  • If Prisma is not yet installed on the team, the CLI asks the user to accept the integration's terms in the browser and waits. An agent cannot complete this step. Ask the user to accept, then let the command continue.

  • By default the command connects the resource to the linked project's production, preview and development environments, then runs vercel env pull, which writes .env.local.

  • One resource on all three environments means local development, previews and production share one database. Tell the user. If they want separate data, provision one resource per environment with -e <environment>, and connect only one Prisma resource to each environment.

In v0, use the host's native integration flow instead. It may appear as an integration request tool; discover what the host exposes instead of assuming a fixed tool name, then wait for the connection and its environment variables.

3. Environment variables

Connecting a resource sets these variables on each connected environment:

VariableValueUse
DATABASE_URLpostgres://<user>:<key>@db.prisma.io:5432/postgres?sslmode=requireThe application and Prisma CLI commands
POSTGRES_URLThe same value as DATABASE_URLLibraries that read POSTGRES_URL
PRISMA_DATABASE_URLThe same value on resources created now. On older resources it can be a prisma+postgres://accelerate.prisma-data.net/... URLDo not use in new code; use DATABASE_URL
  • With --prefix, each name gets the prefix as-is (--prefix DB2_ gives DB2_DATABASE_URL). Read the prefixed name.

  • Never print the values. vercel env ls <environment> lists names without values.

  • db.prisma.io is the direct endpoint. It works for the application, migrations and Prisma Studio, so setup needs nothing else. Direct connections are capped low: 10 on Free and Starter, 5 of them reserved for the platform. Before production load from Vercel Functions, tell the user that application traffic should use the pooled endpoint (pooled.db.prisma.io), whose connection string Prisma Console shows for the database; vercel integration open prisma signs the user in. Do not overwrite the integration's variables: add the pooled string under a new name with vercel env add, keep DATABASE_URL for migrations, and switch the runtime client only if the user agrees.

4. First successful request

  1. Make the variables available locally: vercel env pull, or run each command with vercel env run -- <command> to keep secrets off disk.

  2. Return to prisma-postgres-setup step 4 to configure the chosen ORM or driver. Prisma ORM configuration belongs to prisma-orm-setup.

  3. Run one read-only query (for example SELECT 1) through the application's ORM or driver against the connected database.

  4. Deploy. Environment variable changes apply only to new deployments, so redeploy after connecting a resource, then call a route that queries the database.

5. Validate and report

  • vercel integration list shows the resource, its status and the connected project.

  • vercel env ls production lists DATABASE_URL.

  • The local query and the deployed query both succeed.

Report the resource name, the environments it is connected to, the variable the application reads, and the query result, without secrets. If a step was blocked or not tested, say so.

Plans, billing and backups

  • Usage and invoices are on the user's Vercel bill. Changing the plan is the user's decision; do not do it on your own.

  • The user can change plans in Prisma Console (vercel integration open prisma) or in the Vercel dashboard: Integrations → Prisma → Manage → Settings → Change Plan.

  • Restorable daily backups come with paid plans. On Free, treat the connected database as having no backup.

Common errors

What you seeCauseFix
The CLI asks the user to review and accept terms in the browserPrisma is not installed on the team yetAsk the user to accept. The agent cannot do it.
Connecting fails with an error that names an existing variable, project and environmentsThe project already has a variable such as DATABASE_URLAsk the user. Remove the stale variable with vercel env rm <name> <environment>, or connect with --prefix and read the prefixed name.
A Prisma CLI command reports DATABASE_URL missing, but the app runsThe command does not load .env.localRun it as vercel env run -- <command>, or load the intended file for that command. Do not provision another database.
PRISMA_DATABASE_URL starts with prisma+postgres://accelerate.prisma-data.netAn older resource still carries an Accelerate URL in that variableRead DATABASE_URL, which holds a standard postgres:// string.
Works locally; the deployment has no DATABASE_URL or old credentialsThe deployment predates the connection or a secret rotationCheck vercel env ls <environment> and that the resource is connected to that environment, then redeploy.
"Too many connections" or connection-limit errors under loadApplication traffic on the direct endpoint, or a client created per requestCreate the database client once, outside the request handler. Move application traffic to the pooled endpoint (section 3).
Data is gone after a schema diff or resetA shadow database or reset command ran against the connected databaseNever point a shadow database URL or a reset command at the connected database; use a separate throwaway database. Restoring needs a paid plan's backup.

Where MCP fits

When native Marketplace MCP tools are available, inspect their descriptions, permissions, and resource scope before use. Use them for supported operations on the selected resource. Keep schema changes consistent with the application's migration workflow.

A general Prisma MCP provisioning tool creates a Prisma resource; that alone does not establish Marketplace registration, billing, project connection, or environment injection. Do not substitute it for a blocked native installation. Report the missing connection or permission.

The agent calls MCP tools while building the app. The generated app connects through its ORM or database driver; it does not need to call MCP for normal database queries.

Sources: vercel integration, vercel env, coding agents and Marketplace integrations, Prisma Postgres on Vercel, connection pooling, v0 databases, v0 MCP, Vercel native integrations.

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs Node.js

Security

What our scanner noticed· Low risk

  • Instructions that use the network

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
prisma
Publisher
Prisma (Official)
Source
prisma/skills · prisma-postgres-setup · commit 8ea289b
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by prisma or Prisma.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download prisma-postgres-setup.zip