Gnomon:Postgres 数据的 Git
Gnomon: Git for Postgres Data

原始链接: https://gnomon.bitsinfra.com/

Gnomon 是一个 PostgreSQL 扩展,可为现有 Postgres 数据库添加分支、历史记录、合并和撤销功能,而无需复制数据。它跟踪表,创建从主分支读取并仅存储更改的分支,并允许会话通过普通查询在分支上工作。用户可以检查差异、使用类型感知的三路合并合并分支,以及撤销合并。它支持代理特定的角色和带有连接字符串的分支,以及权限和合并规则。TypeScript、Python 和其他语言的 SDK 有助于管理任务分支,而历史记录和变更馈送工具支持审计和审查。Gnomon 在你已有的数据库内部运行。

Hacker News 新 | 过去 | 评论 | 提问 | 展示 | 工作 | 提交 登录 Gnomon:Postgres 数据的 Git ( bitsinfra.com ) 17 分 by lucasluitjes 1 小时前 | 隐藏 | 过去 | 收藏 | 2 条评论 帮助 flowerlad 12 分钟前 | 下一条 [–] Neon 是另一个为 Postgres 提供分支功能的项目: https://github.com/neondatabase/neon 回复 stephbook 7 分钟前 | 上一条 [–] 这是个有趣的想法。 但它两周前才开始,由一个每 1.5 年换一次公司的开发者独自凭感觉写成。 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

Gnomon is a PostgreSQL extension that gives your database branches, history, merges and undo. Give an agent its own branch of your real database, as nothing more than a connection string. See every field it changed, merge it into main when it's right, and undo it if it wasn't.

Gnomon runs inside the Postgres you already have. One extension, no copies, no second database.

Install the extension, then take a branch, change something on it and look at what changed:

create extension gnomon;
select gnomon.track('orders');                    -- history starts now, no backfill

select gnomon.create_branch('agent/refunds');
select gnomon.use('agent/refunds');

-- Every query from here on runs on the branch
update orders set status = 'refunded' where id = 4182;

select * from gnomon.diff('agent/refunds');       -- every row and field it changed
select gnomon.merge('agent/refunds');             -- three-way, type-aware, conflicts as rows
select gnomon.undo_merge(1);                      -- and back

A branch reads everything from main and keeps only what it changes, so it opens instantly and copies nothing, however big your database is. Your application doesn't change: point a session at a branch and the queries it already runs read and write the branch instead of main.

Follow the tutorial →

One command gives an agent a database role, a branch of its own and a connection string. It reads and writes its branch, and the database refuses the rest, main included, even when the agent asks for it by name.

gnomon agent create support-bot

Merging is for the people you choose, or for an agent within rules you write: at most twenty rows, only these tables, every check passing. Postgres enforces them, whatever the agent is told.

Agents → · The MCP server →

The TypeScript and Python SDKs give each task your agents take on a run: a branch of its own, with limits already set. Merge it, send it for review, or let it go.

npm install @bitsinfra/gnomon      # TypeScript
pip install gnomon-postgres        # Python

Bindings for Node, Go, Ruby, Java, Elixir, .NET and PHP put your application's sessions and tests on a branch, through the drivers and ORMs you already use.

Runs and the SDKs → · Install the SDK for your language →

  • Concepts: branches, coordinates and how a merge decides.
  • Branches: what works on a branch, and how a branch write behaves.
  • Merges: counts that add up, JSON merged key by key, conflicts as rows, undo.
  • Review: diffs, change requests, checks and approvals that go stale.
  • History: read any moment exactly, blame a field, bisect a failing check.
  • The change feed: every change, in order, to Kafka, NATS, a webhook or a file.
  • SQL reference and CLI reference.
  • Operations and security when you put it into production.
联系我们 contact @ memedata.com