Skip to content

refactor(cli): generate migrations from the project binary's schema - #740

Draft
m4tx wants to merge 2 commits into
migration-generator-rework-2from
migration-generator-rework-3
Draft

m4tx wants to merge 2 commits into
migration-generator-rework-2from
migration-generator-rework-3

Conversation

@m4tx

@m4tx m4tx commented Nov 13, 2026

Copy link
Copy Markdown
Member

No description provided.

@m4tx
m4tx added this pull request to stack #739 November 13, 2026 17:20
Models now carry their migration schema, with all properties resolved by
the compiler. Application models are registered in a linkme distributed
slice, and `ProjectSchema` combines them with the schema obtained
by replaying the project's migrations in order.

Passing the hidden `--cot-internal-schema` flag to the project binary
prints this as JSON without reading the project config, so that the Cot
CLI can generate migrations from it.
@github-actions github-actions Bot added A-docs Area: Documentation A-deps Area: Dependencies C-cli Crate: cot-cli (issues and Pull Requests related to Cot CLI) C-lib Crate: cot (main library crate) C-codegen Crate: cot-codegen labels Nov 13, 2026
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

🐰 Bencher Report

Projectcot
Branchmigration-generator-rework-3
Testbedgithub-ubuntu-latest
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
microseconds (µs)
(Result Δ%)
Upper Boundary
microseconds (µs)
(Limit %)
empty_router/empty_router📈 view plot
🚷 view threshold
5,374.10 µs
(-54.26%)Baseline: 11,748.10 µs
18,919.13 µs
(28.41%)
json_api/json_api📈 view plot
🚷 view threshold
571.08 µs
(-39.88%)Baseline: 949.95 µs
1,372.05 µs
(41.62%)
nested_routers/nested_routers📈 view plot
🚷 view threshold
551.30 µs
(-39.11%)Baseline: 905.45 µs
1,285.54 µs
(42.88%)
single_root_route/single_root_route📈 view plot
🚷 view threshold
507.02 µs
(-41.11%)Baseline: 860.89 µs
1,233.50 µs
(41.10%)
single_root_route_burst/single_root_route_burst📈 view plot
🚷 view threshold
9,101.70 µs
(-43.84%)Baseline: 16,207.01 µs
22,818.17 µs
(39.89%)
🐰 View full continuous benchmarking report in Bencher

🔗 Link this project to GitHub

`cot migration make` builds the project and generates the operations
from the difference between the current models and the replayed
migrations, as reported by the project binary. Generated migrations only
contain literal values, and no longer include the model snapshots.
@m4tx
m4tx force-pushed the migration-generator-rework-3 branch from 52a53a1 to b1e6337 Compare November 16, 2026 13:46

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-deps Area: Dependencies A-docs Area: Documentation C-cli Crate: cot-cli (issues and Pull Requests related to Cot CLI) C-codegen Crate: cot-codegen C-lib Crate: cot (main library crate)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant