PgBeam Docs
Branches

DiscardDatabaseBranch

Discard a sandbox branch

Marks an ephemeral sandbox branch as discarded for teardown.

Usage

err := client.Branches.DiscardDatabaseBranch(ctx, "prj_xxx", "brn_xxx")

Parameters

ParameterTypeRequiredDescription
ctxcontext.ContextYesRequest context
projectIDstringYesUnique project identifier (prefixed, e.g. prj_xxx).
branchIDstringYesUnique sandbox branch identifier (prefixed, e.g. brn_xxx).

Response

error — returns nil on success.

Example

import pgbeam "go.pgbeam.com/sdk"

client := pgbeam.NewClient(&pgbeam.ClientOptions{
  APIKey: "pgb_your_api_key",
})

err := client.Branches.DiscardDatabaseBranch(ctx, "prj_xxx", "brn_xxx")
if err != nil {
  log.Fatal(err)
}

Errors

StatusDescription
400Invalid request parameters.
401Missing or invalid authentication.
403Operation not allowed by current plan limits.
404Resource not found.

On this page