Build reproducible, referentially closed PostgreSQL test data branches.
JSON 配方 + PostgreSQL 一致性快照
→ 根记录 + 外键闭包 + 显式子表扩展
→ 带 SHA-256 的 JSON 制品
→ 空的、已迁移的开发数据库git clone https://github.com/zlhahaha/MoonBranch.git
cd MoonBranch
moon build --target js --release cmd/main
node bin/moonbranch.mjs --helpcreatedb moonbranch_demo_source
createdb moonbranch_demo_target
psql -X -v ON_ERROR_STOP=1 -d moonbranch_demo_source -f examples/shop/schema.sql -f examples/shop/seed.sql
psql -X -v ON_ERROR_STOP=1 -d moonbranch_demo_target -f examples/shop/schema.sql
MOONBRANCH_SOURCE=moonbranch_demo_source node bin/moonbranch.mjs capture examples/shop/recipe.json shop.branch.json
node bin/moonbranch.mjs verify shop.branch.json
MOONBRANCH_TARGET=moonbranch_demo_target node bin/moonbranch.mjs restore shop.branch.json
psql -X -d moonbranch_demo_target -c 'SELECT tenant, id FROM shop.orders;'moon add zlhahaha/moonbranch@0.1.0moon fmt --check
moon check --deny-warn
moon test --deny-warn
moon build --target js --release --deny-warn cmd/main
# 仅在隔离的测试实例使用;测试账户需要 CREATEDB。
node scripts/integration.mjsInstall
Download zipBuild reproducible, referentially closed PostgreSQL test data branches.