Gnomon is an open-source PostgreSQL extension that adds Git-like branching, review, merging, and undo for database data. A branch reads from the main database and stores only its changes, so it can be created without copying the database. Applications can use a branch through a session, transaction, or connection string; schema changes can be isolated there as well. Gnomon tracks selected tables from the moment tracking begins, without backfilling earlier history. Its diffs show changed rows and fields, while three-way merges apply data-aware rules - such as adding numeric counts or combining JSON keys - and surface unresolved conflicts for review. Users can also restore past database states, undo transactions or merges, and identify the transaction that caused a check to fail.
The project is designed to let AI agents work on isolated database branches under enforceable limits. Agents can receive separate roles and branches, with PostgreSQL restricting access to main; merge rules can limit affected tables or rows and require SQL checks to pass. Changes can be reviewed before merging, recorded with an actor and task reason, and replayed against the exact data an agent previously read. TypeScript and Python SDKs, an MCP server, a CLI, integrations, and a GitHub Action support agent workflows, application development, and per-test or per-pull-request branches. The extension is intended for PostgreSQL 15-18, including self-hosted and managed services; optional components add features such as routing and stronger row-lock behavior.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.