Chronos/DBWaitlist

Blog / Database branching

Can you merge a database branch back?

Sometimes. Most database branching gives you a copy to work in and discard; merging changed rows back is a separate feature. What Postgres templates, Neon, Dolt and Chronos each do, and when to use which.

Abhishek DG · 6 min read
  • Database branching
  • Comparison
  • Merge

Sometimes. Most database branching gives you a copy to work in and a way to throw it away or reset it. Bringing the rows a branch changed back into the database it came from is a different feature, and only some tools have it. This post goes through what a few of them do, as their own docs describe it in November 2026, and where Chronos sits.

Why are branching and merging two different things?

A branch answers “where can I work without affecting anyone?”. A merge answers “how does that work get back?”. For a schema change the second question has a familiar answer: write a migration and run it on production. For data there is no such script. The branch holds changed rows, production has moved on, and something has to compare the two row by row and decide.

That matters little when branches are for previews and tests, where you throw the data away. It matters a great deal when an AI agent did real work in a branch and the whole point was to keep it.

What do the tools do?

Branch isGetting data changes back to the parent
Postgres template databasesa full copy, made with CREATE DATABASE … TEMPLATEno merge: copy rows over yourself
Neona copy-on-write branch of a Postgres databaseno merge described; a branch can be reset from its parent, which replaces the branch’s data
Dolta Git-style branch of a SQL databasea three-way merge of data, cell by cell, with conflicts in system tables
Chronos DBa copy-on-write world of the whole databasea three-way merge of data, row by row, under rules you set, optionally written to your own database

Neon. Its docs describe branches as isolated: changes made to a branch do not affect its parent (workflow primer, branching). The way to bring the two together runs from parent to child: resetting a branch from its parent replaces the branch’s schema and data with the parent’s. That is the right design for what Neon’s branches are for, which is development, previews and tests on real Postgres.

Dolt. Dolt does merge data. Its docs describe a cell-wise three-way merge: two branches that change different columns of the same row combine on their own, and a conflict arises when both change the same cell to different values (merge, conflicts). Conflicts are rows in system tables that you resolve in SQL. If what you want is Git for a database, with commits, history, clone, push and pull, that is what Dolt is.

Postgres template databases. CREATE DATABASE copy TEMPLATE source gives you a complete second database. Nothing connects the two afterwards.

What does Chronos do?

A merge in Chronos is three-way: the world, its parent, and the moment they forked. If both sides changed the same row, nothing is merged and the conflicts come back as rows for you to settle. If you would rather different columns of one row combine, as they do by default in Dolt, that is a setting per table.

SQL
create world run_42;-- ... the agent works in run_42 ...diff world run_42;              -- every changed row, before and aftermerge world run_42 dry run;     -- what the merge would do, and why it would be heldmerge world run_42;             -- three-way; nothing merges if there is a conflict

What Chronos adds is aimed at agents, not at version control:

  • Conflictsboth sides changed the same rownothing merges; the rows come back
  • Merge policytoo many rows, a delete, a table you namedheld for a person
  • Merge checksa rule about the merged data is brokenrefused, with the rows the check found
  • Stale readsa row the run read has changed sinceheld
  • Write-backbeside your own Postgres, MySQL, MariaDB or MongoDBone transaction there, every row compared first
What happens at a merge. Each step can stop it, and each stop names the rows.

Where is Chronos the wrong choice?

  • You want version control for data. Dolt keeps every commit and has clone, push and pull between databases. Chronos keeps a history window (one hour by default) and has no clone, push or pull between databases today.
  • You want real Postgres in every branch. Neon’s branches are Postgres. Chronos speaks the Postgres wire protocol and runs much of Postgres 16’s SQL, not all of it.
  • Your branches are for previews and tests only. If nothing needs to come back, you do not need a merge, and any copy will do.

Is there a speed difference?

In our own runs, yes, for the workload Chronos is built for. A thousand agents each fork, write 1,000 rows and merge, on disk with 64 workers: Chronos wrote 713,000 to 716,000 rows a second, Dolt 2.3.5 wrote 28,300, and Postgres 17 template databases 9,800. In BranchBench, six agent workflows against Doltgres 1.4.0 and Postgres 18 copies, Chronos was fastest in four of six; Doltgres was faster in two. Methods, machines and the workloads Chronos loses are in BENCHMARKS.md.

So which should I use?

  • Schema changes and preview environments on Postgres: a branching Postgres such as Neon.
  • Git-style history and collaboration on data: Dolt.
  • AI agents doing real work that has to land in a database you already run, with rules about what lands: that is what Chronos is for. How to let an AI agent write to your Postgres safely walks through it.

Questions

Can you merge a database branch back into production?

It depends on the tool. Copies made with Postgres template databases and Neon branches have no data merge back to their parent. Dolt and Chronos DB do a three-way merge of data: Dolt cell by cell in the style of Git, Chronos row by row under merge rules.

What is the difference between database branching and merging?

Branching gives you an isolated copy to work in. Merging brings the rows that copy changed back into the database it came from, comparing both sides with the point where they forked. Many tools offer the first without the second.

Which database lets AI agents work in branches and merge their changes?

Chronos DB is built for that: each agent run gets a branch of the whole database, and its merge is checked against rules you set, held for a person when it breaks one, and can be written to a Postgres, MySQL, MariaDB or MongoDB you already run.

Written by

Abhishek DG

Co-founder & CEO, 2090 Labs

Abhishek builds Chronos in Bangalore: the database where AI agents work in their own copy of your data. Before it he built TailsMart and ACRED India.

More about Abhishek

Keep reading

Can you merge a database branch back? · Chronos