Script branch creation and wait until ready

branches

// what it does

branch create returns immediately while provisioning continues in the background; --wait blocks until the branch is actually usable. Essential in CI pipelines that create a branch and immediately connect to it in the next step.

// shell

$ pscale branch create mydb ci-check-$GITHUB_RUN_ID --wait

// gotcha

Without --wait, a fast follow-up command (shell, connect, password create) races the provisioning and fails intermittently — the classic "works on retry" CI flake.

// resources