Every PR gets its own fresh database cloned from production, torn down after merge. No shared staging that drifts out of sync. No test runs that corrupt each other.Documentation Index
Fetch the complete documentation index at: https://docs.tryardent.com/llms.txt
Use this file to discover all available pages before exploring further.
Have Claude set this up
Paste this into Claude Code or Cursor and it will walk you through the whole thing:Prerequisites
You need an Ardent account with at least one connector set up. If you haven’t done that yet, follow the Quickstart first.Setup
Get your project and connector names
Run these locally to find the values you’ll need for the workflow:Note the project name and connector name. You will use these in the workflow to explicitly select which database to branch from.
Create an API token
Go to Ardent dashboard > API keys and create a token.
Add the token to GitHub
In your repo, go to Settings > Secrets and variables > Actions and click New repository secret. Name it
ARDENT_TOKEN and paste your token.GitHub Actions workflow
ardent login --tokenauthenticates the CLI using your repo secret.ardent project switch/ardent connector switchexplicitly selects which project and connector to branch from. A connector represents one Postgres server. Replacemy-projectandmy-connectorwith your names. Always set these in CI so the workflow is deterministic.ardent branch createcreates an isolated database branch. The name includes the PR number and run ID so concurrent runs and re-runs don’t collide.ardent branch info | awk '/URL:/{print $2}'extracts the branch connection URL and writes it toDATABASE_URLinGITHUB_ENV. Your test step readsDATABASE_URLlike any other environment variable. If your app uses a different env var name, change it in theecholine.npm testruns your test suite against the branch. Replace withpytest,pnpm test,make test, or whatever your project uses.ardent branch deletecleans up the branch.if: always()ensures this runs even when tests fail.
Compared to a shared staging database
- Full production data: branches are not schema-only copies. You test against the same data at the same scale, so if something would blow up in production, it blows up here first.
- Isolation: each PR gets its own branch. No test run can interfere with another.
- Efficient at scale: compute auto-scales per branch and storage is shared across branches, so spinning up many ephemeral environments stays cheap.
- Always in sync: branches are created from a continuously synced replica. No drift.
- Auto cleanup:
if: always()deletes the branch after the run. No orphaned environments.