capabilities.work

Postgres Rotate a Database Connection String

A 4-step recipe with Prisma. We can help you get access.

Recipe · 4 steps

Postgres Rotate a Database Connection String

with Prisma
Works with AI assistants

Confirm a database, mint a new connection string, and revoke the previous one.

  1. Read the database to confirm it is active before rotating its connection string.
  2. List the database connection strings so the currently active one can be identified for later revocation.
  3. Mint a replacement Prisma connection string before revoking the old one so applications stay connectable throughout the rotation.
  4. Permanently revoke and delete the previously active connection string now that the replacement is in place. Returns 204 No Content on success.
What you'll need to have ready
  • apiToken: Service token or OAuth access token for the Management API, sent as a Bearer token.
  • databaseId: Identifier of the database whose connection string is being rotated.
  • connectionName: Optional display name for the replacement connection string.
For your developer

Arazzo workflow prisma:rotate-connection-string, 4 operations: getDatabase → listConnections → createConnection → deleteConnection. Specs on APIs.io.