feat: add drop_enabled message option #143
All Vouch review confidence checks passed
Residual risk 0.29 = Change Risk (0.52) × (1 − Review Confidence (0.44)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 279 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 10%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.337
No Reviewer Assigned
no_reviewer_assigned
0.120
Real PR Conversation Timeline
1 comments
"Review active on #143"
general
weight: 0.35
loganintech
Summary
Adds a new
drop_enabledoption toMessageOptions, alongsidedisabled/nested_only/ etc. When a message setsdrop_enabled = true, code generation emits only two helpers and nothing else:DBDropTableStatement() string— returns theDROP TABLE IF EXISTS "<table>"statement for the record's table.DBTruncateTableStatement() string— returns theTRUNCATE TABLE "<table>"statement for the record's table.No descriptor, message, or query-builder code is generated. This provides a way to mark a record as completely inactive and prepare it to be removed from the database.
Implementation
proto/pgdb/v1/pgdb.proto— addedbool drop_enabled = 12;toMessageOptions(regeneratedpgdb/v1/pgdb.pb.go).pgdb/v1/schema_sql.go— added public runtime helpersDropTableStatement(tableName)andTruncateTableStatement(tableName), reusing the existingpgWriteStringidentifier quoting.internal/pgdb/pgdb_module.go— after the existingGetDisabled()skip, a newGetDropEnabled()branch renders the drop helpers and skips all other generation.internal/pgdb/pgdb_drop.go+internal/pgdb/templates/drop.tmpl(new) — the render function and template for the two generated methods, with the hashed table name baked in at codegen time.Design notes
DB-prefixed generated-method convention (DBReflect); they take no args since DROP/TRUNCATE don't vary by dialect, and are callable on a nil pointer like other generated accessors.DROP TABLE IF EXISTS(noCASCADE) for idempotency without unexpectedly dropping dependent objects.Testing
DeprecatedExhibit(adrop_enabledmessage) to the zoo example and confirmed only the two methods generate.pgdb/v1/schema_sql_test.go).example/models/zoo/v1/zoo_test.go, including a Postgres round-trip (create → insert → truncate → drop → idempotent drop).buf lint,go build ./..., gofmt, and the non-DB tests pass. The DB round-trip test requires PostgreSQL (same as all existing schema tests) and runs in CI.🤖 Generated with Claude Code