prisma-postgres

par prisma

Configuration et gestion programmatique des bases de données Prisma Postgres via la Console, la CLI et les API. Quatre workflows principaux : configuration manuelle dans la Console, provisionnement instantané via la CLI create-db, intégration API REST avec jetons de service ou OAuth, et intégration TypeScript typée via @prisma/management-api-sdk. Prend en charge la création de bases de données temporaires avec suppression automatique après environ 24 heures, URLs de revendication pour la persistance, et sélection de région. API de gestion disponible à https://api.prisma.io/v1 avec documentation OpenAPI et...

npx skills add https://github.com/prisma/skills --skill prisma-postgres

Prisma Postgres

Guidance for creating, managing, and integrating Prisma Postgres across interactive and programmatic workflows.

When to Apply

Reference this skill when:

  • Setting up Prisma Postgres from Prisma Console
  • Provisioning instant temporary databases with create-db
  • Linking an existing local project with prisma postgres link
  • Managing Prisma Postgres resources via Management API
  • Using @prisma/management-api-sdk in TypeScript/JavaScript
  • Handling claim URLs, connection strings, regions, and auth flows

Rule Categories by Priority

PriorityCategoryImpactPrefix
1CLI ProvisioningCRITICALcreate-db-cli
2Management APICRITICALmanagement-api
3Management API SDKHIGHmanagement-api-sdk
4Console and ConnectionsHIGHconsole-and-connections

Quick Reference

  • create-db-cli - instant databases and current CLI flags (--ttl, --copy, --quiet, --open)
  • management-api - service token and OAuth API workflows
  • management-api-sdk - typed SDK usage with token storage
  • console-and-connections - Console operations, prisma postgres link, direct TCP connections, and serverless-driver choices

Core Workflows

1. Console-first workflow

Use Prisma Console for manual setup and operations:

  • Open https://console.prisma.io
  • Create/select workspace and project
  • Use Studio in the project sidebar to view/edit data
  • Retrieve direct connection details from the project UI

2. Quick provisioning with create-db

Use create-db when you need a database immediately:

npx create-db@latest

Aliases:

npx create-pg@latest
npx create-postgres@latest

For app integrations, you can also use the programmatic API (create() / regions()) from the create-db npm package.

Temporary databases auto-delete after ~24 hours unless claimed.

2b. Persistent databases with the Platform CLI

For databases that belong to a Project (not throwaway create-db databases), use @prisma/cli:

npx -y @prisma/cli@latest database create --help
npx -y @prisma/cli@latest database list --json
npx -y @prisma/cli@latest database connection create db_123
npx -y @prisma/cli@latest database usage db_123
npx -y @prisma/cli@latest database backup list db_123

database create and database connection create print a one-time connection URL; store it immediately. Destructive commands (remove, restore) require exact --confirm <id>.

For automation, prefer --json --no-interactive, resolve ids before mutations, and verify the installed command's help because this CLI is beta.

3. Link an existing local project

Use prisma postgres link when the database already exists and you want to wire a local project to it:

prisma postgres link

For CI or other non-interactive environments:

prisma postgres link --api-key "<your-api-key>" --database "db_..."

This flow updates your local .env with DATABASE_URL, then you can run prisma generate and prisma migrate dev.

4. Programmatic provisioning with Management API

Use API endpoints on:

https://api.prisma.io/v1

Explore the schema and endpoints using:

  • OpenAPI docs: https://api.prisma.io/v1/doc
  • Swagger Editor: https://api.prisma.io/v1/swagger-editor

Auth options:

  • Service token (workspace server-to-server)
  • OAuth 2.0 (act on behalf of users)

5. Type-safe integration with Management API SDK

Install and use:

npm install @prisma/management-api-sdk

Use createManagementApiClient for existing tokens, or createManagementApiSdk for OAuth + token refresh.

The SDK exposes typed workspace service-token list, create, and revoke routes. A newly created token value is returned exactly once. Let the installed SDK types or OpenAPI document settle exact beta endpoint shapes.

Rule Files

Detailed guidance lives in:

references/console-and-connections.md
references/create-db-cli.md
references/management-api.md
references/management-api-sdk.md

How to Use

Start with references/create-db-cli.md for fast setup, then switch to references/management-api.md or references/management-api-sdk.md when you need programmatic provisioning.

Plus de skills de prisma

prisma-cli-migrate-reset
prisma
prisma migrate reset
official
prisma-cli-validate
prisma
Validation Prisma. Référence lors de l'utilisation de cette fonctionnalité Prisma.
official
prisma-next-extension-upgrade
prisma
Upgrade Prisma Next in your extension. Bumps every `@prisma-next/*` dependency to the requested target (or npm `latest`), runs the per-transition upgrade…
official
adr-review
prisma
Examiner un ou plusieurs ADR avec un regard neuf (en tant que membre de l’équipe sans contexte préalable), identifier les problèmes narratifs et structurels, puis les réécrire. À utiliser lorsque le…
official
prisma-next-upgrade
prisma
Upgrade Prisma Next in your app. Bumps every `@prisma-next/*` dependency from the version pinned in the lockfile to the requested target (or npm `latest`),…
official
prisma-cli
prisma
We need to translate the given text from English to French, preserving the name "prisma-cli" and other technical terms. The text is a description of a directory item for an agent skill. We must not add any extra commentary, labels, or formatting. Just the translation. The text: "Complete reference for Prisma CLI commands, options, and workflows across setup, migrations, and database operations. Covers 20+ commands organized by priority: setup ( init ), generation ( generate ), development ( dev ), database operations ( db pull/push/seed/execute ), and migrations ( migrate dev/deploy/reset/status/diff/resolve ) Includes Prisma 7.x changes: new prisma.config.ts configuration file, removed flags ( --skip-generate , --skip-seed , --schema , --url ), and explicit..." We need to translate into French. Keep technical terms like "Prisma CLI", "init", "generate", "dev", "db pull/push/seed/execute", "migrate dev/deploy/reset/status/diff/resolve
official
prisma-client-api
prisma
Référence complète de l'API Prisma Client pour les requêtes de modèle, les opérations CRUD, le filtrage, les relations et les transactions. Couvre 17 méthodes de requête de modèle, dont findUnique, findMany, create, update, delete, upsert et les opérations en masse avec variantes de retour. Fournit des options de requête pour façonner les résultats : select, include, omit, orderBy, take, skip, cursor et distinct. Inclut les opérateurs de filtre scalaires et logiques (equals, in, contains, startsWith, lt, gt) ainsi que les filtres de relation (some,...
official
prisma-compute
prisma
Prisma Compute deployment and hosting guide. Use whenever the user mentions Prisma Compute, `prisma.compute.ts`, `defineComputeConfig`, deploying or hosting a Prisma app, `@prisma/cli app deploy`, `compute:deploy`, `create-prisma --deploy`, `PRISMA_SERVICE_TOKEN`, `auth workspace`, Compute apps/deployments/build logs/domains, `@prisma/cli agent install`, localhost vs `0.0.0.0`, deploy port binding, or framework deploy readiness for Hono, Elysia, Next.js, TanStack Start, Astro, Nuxt, Svelte,...
developmentdevopsofficial