add pull command for declarative schema exports - #67
Conversation
Enumerates every table in one schema and drives each through the introspect -> render path, one desired-state file per table, reporting per-table outcomes (pulled / refused / error) instead of failing fast.
Review found INHERITS children exported as silently lossy baselines (flattened columns, zero diff). Introspection now records inheritance edges both ways and Render refuses both sides. Also: extension-owned tables excluded, missing schema errors instead of exiting 0, truncated files removed on Close failure, case-collision detection, exhaustive status switch, partition children filtered, create-only contract documented.
|
🤖 Adversarial correctness review, requested by @aparajon and performed by their agent. Reviewed at head Verdict: The diff path does not refuse classic inheritance
Reproduced against a live server — parent The inherited column is invisible in the desired file — there is no grammar for
|
|
🤖 Second-pass review through two lenses — OSS adoption ease and SchemaBot integration — requested by @aparajon and performed by their agent. Reviewed at head Verdict: Adoption lensThe limitations table just acquired two silent losses, and its own introduction says there are none. The table opens by promising every listed shape is answered "with a typed refusal — never a silently wrong or incomplete result". The two new rows do not work that way:
Both are dropped from an export without any refusal, warning, or report line. Documenting them is the right instinct and I would not want them removed — but they belong under a heading that says "silently not carried", not inside the table that promises the opposite. This matters most precisely at the moment The README row promises more than the command delivers. The flag help is the best-written part of this and should be the model for the docs. SchemaBot integration lens
The refusal surface is the real gate on PostgreSQL onboarding, and this PR makes it legible for the first time. Before Action items
This review was generated by Claude Code (claude-opus-5). |
aparajon
left a comment
There was a problem hiding this comment.
🤖 Approving on @aparajon's behalf after the adversarial correctness review above. The findings there are yours to pick up as follow-ups — flagging them, not gating on them.
This stamp was left by Claude Code (claude-opus-5).
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Add
pg-sprite pull: export every table in a schema as desired-state.sqlfiles, one file per table, with per-table outcomes.Why
Onboarding a live database to the declarative workflow needs a baseline export. The engine surface already exists — the introspect→render path (#52) and the render refusals for constructs that cannot be expressed as desired state (#55) — but there was no command driving it across a whole schema.
What
PullCmd(Kong):pg-sprite pull --url=… [--schema public] [-o|--out schema], sharing the existing DB connection flags.pg_catalog, then per table: Introspect → Render → write<table>.sql(create-only, refuses to overwrite existing files).PULLED/REFUSED/ERRORplus a summary line; render refusals map to the refusal exit code, any hard error exits non-zero, all-success exits zero.Before / after