Skip to main content
The rule: branch before you touch the database. Every time. Takes 6 seconds. Means you can run any migration, drop any table, try any index. If it breaks, delete the branch and start over. Your production data is never at risk.

The pattern

# Starting a new feature
ardent branch create my-feature

# Work, run migrations, break things freely
BRANCH_DATABASE_URL="$(ardent branch info --print-url)"
if [ -z "$BRANCH_DATABASE_URL" ]; then
  echo "branch info did not return a database URL" >&2
  exit 1
fi
psql "$BRANCH_DATABASE_URL"

# Done, or it all went wrong. Either way:
ardent branch delete my-feature

Working across multiple tasks

ardent branch list
# * ● my-feature
#   ○ auth-refactor
#   ○ index-experiment

ardent branch switch auth-refactor
Branches auto-suspend after 5 minutes of inactivity. Leave them running and they won’t cost you anything while idle.