A clean database for every test run

Create a Postgres branch when the pipeline starts, run migrations and tests against it, and delete it when the job ends. Each run tests against an untouched copy of your data.

A fresh copy every run

Each run tests against an untouched copy of your data.

Parallel jobs

Each job gets its own branch. Nothing is shared.

Deleted at the end

The last step removes the branch.

The problem

Flaky tests often start in the database

Tests fail for reasons that have nothing to do with the code under test.

  • A shared test database turns CI into a queue
  • Parallel jobs trip over each other’s rows
  • Cleanup scripts miss a table
  • A migration from one branch leaks into another branch’s run
  • Mocking the database stops testing what production runs
How it works

Create, test, delete. Every run.

  1. 01

    Create

    The first step creates a branch from your baseline: production, staging, or a masked copy. It copies no data, so it is ready in about three seconds.

  2. 02

    Migrate and test

    Apply pending migrations, seed if you need to, run the suite. Integration tests hit real Postgres with the real data shape.

  3. 03

    Delete

    The last step deletes the branch. Nothing carries over to the next run.

The whole pipeline

Four commands, any CI

The same commands run anywhere a shell does.

Set it up

Works with the CI you already run

Any other CI

GitLab, CircleCI, Buildkite, Jenkins

  1. 01Install the CLI
  2. 02Set XATA_API_KEY to a key scoped to the one project
  3. 03Store it in your CI secret manager
Install
Agent-driven

Agents run the suite before you review

  • Claude Code
  • Cursor
  • Codex
  1. 01Create a branch for the task
  2. 02Migrate, test and report
  3. 03Delete it before a human sees the change
Coding agents

Your agent can run the whole workflow

Connect the Xata MCP server or install the CLI, and your coding agent can create branches, apply migrations and read schema without touching production.

  • Claude Code
  • Cursor
  • Codex
  • VS Code (Copilot)
  • Windsurf
  • Cline
  • OpenCode
  • Zed
Keep it cheap and safe

No bill for cancelled jobs, no exposed data

Give every test run its own database

Stop sharing a test database. Branch it per run and delete it when the job ends.