Functions

branch-path

fn (branch-id: Str): Str

create-branch

fn (request: CreateBranchRequest): Branch

Create a new preview branch. Preview branching must be enabled on the project.

Example

::branches ::supabase::admin::branches

branch ::branches/create-branch(::branches/CreateBranchRequest({
  project_ref: "my-project-ref",
  branch_name: "feat-auth",
  git_branch: "feat/auth"
}))

delete-branch

fn (branch-id: Str): Map

Delete a preview branch.

disable-preview-branching

fn (project-ref: Str): Map

Disable preview branching for a project. This deletes all existing preview branches.

get-branch

fn (branch-id: Str): Branch

Get details for a specific branch by its ID.

get-branch-config

fn (branch-id: Str): Map

Get the database configuration for a branch.

list-branches

fn (project-ref: Str): Vec

List all preview branches for a project.

Example

::branches ::supabase::admin::branches

branches ::branches/list-branches("my-project-ref")
// => [{id: "...", name: "feat-auth", git_branch: "feat/auth", status: "RUNNING_MIGRATIONS", ...}, ...]

merge-branch

fn (branch-id: Str): Map

Merge a preview branch into the parent project.

ns alias

Alias of ::supabase::admin::branches/

push-branch

fn (branch-id: Str): Map

Push migrations to a preview branch database.

reset-branch

fn (branch-id: Str): Map

Reset a preview branch database to match the parent project.

update-branch-config

fn (request: UpdateBranchConfigRequest): Map

Update branch configuration (git branch association, reset behavior, persistence).

Types

Branch

Branch type {
    id: Str,
    name: Str?,
    branch_name: Str?,
    git_branch: Str?,
    status: Str?,
    persistent: Bool?,
    reset_on_push: Bool?
}

CreateBranchRequest

CreateBranchRequest type {
    project_ref: Str,
    branch_name: Str,
    git_branch: Str?,
    region: Str?
}

UpdateBranchConfigRequest

UpdateBranchConfigRequest type {
    branch_id: Str,
    git_branch: Str?,
    reset_on_push: Bool?,
    persistent: Bool?,
    status: Str?
}