USE CASE

Database branching for Cursor

Let Cursor's AI agent work on real production data without risk. Ardent creates isolated Postgres branches in under 6 seconds using copy-on-write — so Cursor can test migrations, write queries, and modify schemas on a perfect copy of your database.

Book a demoRead the docs
THE PROBLEM

Cursor generates SQL, but testing it is still manual

Cursor excels at generating SQL queries, writing migrations, and suggesting schema changes. But the generated code needs to be tested against real data with real constraints, foreign keys, and edge cases. Running untested AI-generated SQL against production is reckless. Running it against stale staging data misses bugs.

Most teams end up in a slow cycle: Cursor generates a migration, the developer manually reviews it, creates a test database, runs it, checks the results, and then applies it to production. The trust gap between AI-generated SQL and production deployment is where developers lose the most time.

THE SOLUTION

How Ardent solves this

Ardent gives Cursor a safe playground with real data. Create a branch of your production Postgres database in under 6 seconds, pass the connection string to Cursor, and let the agent work freely. Every branch is a full copy with real schemas, real data, and real constraints — created using copy-on-write so there's no storage duplication.

When Cursor finishes, review the diff to see exactly what changed. Apply the good changes to production and delete the branch. No staging environment to maintain, no synthetic data to keep updated, no manual cleanup.

# Install and log in (one-time setup)
npm install -g ardent-cli
ardent login

# Connect your database (one-time setup)
ardent connector create postgresql postgres://user:pass@host:5432/mydb

# Create a branch for Cursor to work on
ardent branch create cursor-migration
✓ Branch created in 4.2s
postgres://branch-xyz789.db.tryardent.com:5432/mydb

# Add the connection string to your .env or Cursor MCP config
# After Cursor finishes, review the changes
ardent branch diff
# Shows every row-level change across all tables
KEY FEATURES

What makes this work

Validate generated SQL instantly

Cursor generates migrations and queries in your IDE. Pass the branch connection string via .env and Cursor tests its own output against real constraints, foreign keys, and data volumes — in the same editor session.

Iterate without waiting

Branches create in seconds. Cursor generates a migration, you test it on a branch, it fails on a unique constraint, Cursor fixes it, you test again. The feedback loop is seconds, not hours.

Native IDE workflow

Add the branch URL to your project's .env or Cursor's MCP config. Cursor's agent reads the schema, generates SQL, and executes it — all within the IDE. No terminal switching, no separate tools.

See what Cursor changed

ardent branch diff shows every row-level modification. Cursor altered 3 tables and created an index? You see exactly what before deciding to apply it to production.

COMPARISON

Traditional approach vs. Ardent

FEATURE
TRADITIONAL
ARDENT
Time to test environment
Hours (staging)
Under 6 seconds
Data accuracy
Stale staging copy
Live production copy
Risk level
Staging drift bugs
Full isolation
Storage overhead
Full database copy
Changes only (CoW)
Compute cost
Always-on staging
Scale to zero when idle
Branch per session
Impractical
Standard workflow
Change review
Manual comparison
Built-in diff
FAQ

Frequently asked questions

How does Ardent work with Cursor?

Create a database branch with the Ardent CLI, then pass the connection string to Cursor via your .env file or MCP configuration. Cursor's agent can query, modify schemas, and test migrations on the branch without affecting production.

Can Cursor's agent safely modify database schemas?

Yes. Each Ardent branch is fully isolated. Cursor can ALTER tables, CREATE indexes, DROP columns, and run migrations freely. Changes only exist on the branch — production is never affected.

How fast are Ardent branches for Cursor workflows?

Branches create in under 6 seconds regardless of database size, using copy-on-write storage. A 500 GB production database branches as fast as a 1 GB one.

Ship fast and don't break things

Make sure coding agents never break your DB.

Book a demo