Database Branches

Extend a branch's lifetime

Changed on

Replaces the branch's lifetime and restarts the countdown from now, so a branch you are still working on is not swept mid-session. The new duration is remembered, so a later reset re-arms the same lifetime.

patch/projects/{id}/databases/{databaseName}/branches/{branchName}

Request

  • Base URL
    https://api.volcano.dev
  • Auth
    • HTTP bearer
    • or HTTP bearer

Path parameters

id, string uuid required

Project ID

databaseName, string required

Database name (unique within project, lowercase letters, numbers, and underscores only)

branchName, string required

Branch name (unique within the parent database, lowercase letters, numbers, and underscores only)

Request body

UpdateDatabaseBranchRequest required

Replace the branch's lifetime and restart its countdown from now.

ttl_seconds, integer required

The new lifetime, between one hour and 30 days.

Example request

{
  "ttl_seconds": 86400
}

Response

Lifetime updated

DatabaseBranch required

A copy-on-write fork of a database, for development and testing.

A branch starts as an exact copy of its parent's data and diverges from there. It has its own connection string and its own credential, so a branch password cannot reach the parent.

Every branch expires. expires_at is a hard deadline: once it passes the branch stops accepting connections and is deleted. Use PATCH to extend a branch you are still working on.

id, string uuid required
database_id, string uuid required

The parent database this branch was forked from.

project_id, string uuid required
name, string required

Branch name, unique within the parent database.

status, 'provisioning' | 'active' | 'failed' | 'deleting' required

Branch status. A new branch starts provisioning and is not connectable until it reports active; poll this endpoint until it does. connection_string is only present while active.

provisioning also covers a branch being rebuilt after a reset, and a build that is between retries, so it is the status to keep waiting on. failed is terminal: it means the platform gave up, and the branch will not become active on its own.

connection_string, string

PostgreSQL connection URI for this branch. Present only while the branch is active.

The URI carries the branch's own globally-unique username and password; application_name selects the access mode exactly as it does for the parent database:

  • volcano_full_access — Full admin access (DDL, migrations)
  • volcano_user_access:{user_id} — User impersonation (RLS enforced)
  • volcano_user_access — Anonymous access (anon role, RLS enforced)
ttl_seconds, integer required

The lifetime the branch was created with. Resetting a branch re-arms this same duration, so a reset never shortens a branch's remaining life.

expires_at, string date-time required

When the branch stops serving connections and becomes eligible for deletion. Enforced on the connection path, so it holds even if reclamation is delayed.

storage_bytes, integer

Bytes this branch has diverged from its parent, which is what a branch actually costs. Shared pages are not counted twice. Counts against the parent database's storage allowance. Absent until the branch has been sampled.

last_invoked_at, string date-time

Most recent request timestamp for this branch

created_at, string date-time required
updated_at, string date-time required

Changes

    • info

      the endpoint scheme security ProjectAccessToken was added to the API

    • breaking

      added the new path request parameter branchName

    • breaking

      added the new path request parameter databaseName

    28 more changes in this revision