Fix insert review findings and record the gap review - #14
Conversation
- returning() with no arguments returns every column, as Drizzle's bare .returning() does; it type-checked and then failed to compile. - insertInto returns CHInsertStart (values and select only), so an insert without rows no longer type-checks or reaches Database.run. - TableOptions.computed marks generated columns on table(): not insertable, still readable. - INSERT ... SELECT accepts a plain primitive into a branded column, the rule values and comparisons already use. - PGlite round trip for jsonb and array values in an upsert's SET. design/gap-review.md records the comparison with Drizzle 1.0-rc.5 and Kysely 0.28 and the order of work that follows from it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 41 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (18)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (11)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe insert builder now supports computed-column metadata, restricts the initial insert API until rows are supplied, returns all columns from bare ChangesInsert Builder Updates
Effect-ORM Gap Review
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The insert-builder changes have no identified issue requiring resolution before merge. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The changes strengthen insert construction and computed-column restrictions, but a bare returning() now returns every declared column. No introduced vulnerability is established; downstream authorization and exposure of sensitive fields remain unverified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 6 files. (5 skipped: 5 unsupported.) ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
update(table).set(...).where(...) and deleteFrom(table).where(...), with returning on Postgres and settings on ClickHouse. They share the insert's value encoding, SET record, RETURNING and settings, now factored into valueCells, setAssignments, returningOf and writeSettingsClause. A write with no where() is a defect unless allRows() says so; a where() whose conditions all came out undefined fails, since that comes from data and would widen a filtered write to every row. ClickHouse compiles UPDATE to an ALTER TABLE ... UPDATE mutation and DELETE to a lightweight DELETE, both with WHERE 1 for allRows() and settings last; checked on 26.2 and 26.8. Tenant scope is derived from the WHERE, and an update that moves rows to another tenant is cross-tenant. CompiledQuery.kind gains update and delete, and Database.run sends any write without RETURNING through command. DialectClauses.insertSettings (unreleased) becomes writeSettings; alterTableUpdate is new. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A subquery in an UPDATE or DELETE's SET or WHERE, or in an insert's VALUES or onConflictDoUpdate, was compiled for its SQL and its scope dropped, so a pinned write that read every tenant through a subquery reported single-tenant, and a write into an untenanted table reported untenanted. Writes now record each subquery's scope (a string subquery is cross-tenant) and combine it with their own, as queries do. A where() condition that renders to nothing no longer leaves a dangling WHERE, and does not count as a filter: a write left with none fails unless allRows() says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add update() and deleteFrom() for Postgres and ClickHouse
Fixes the INSERT issues found by the review against Drizzle 1.0-rc.5 and Kysely 0.28, and saves the full review as
design/gap-review.md.Fixes
returning()with no arguments returns every column, as Drizzle's bare.returning()does. Before, it type-checked and then failed to compile, which migrated Drizzle code would have hit.insertInto(table)returnsCHInsertStart, which offers onlyvaluesandselect. An insert without rows no longer type-checks or reachesDatabase.run.TableOptions.computedmarks generated columns ontable()(PostgresGENERATED ALWAYS): not insertable, still readable.INSERT ... SELECTaccepts a plain primitive into a branded column, the same rulevaluesand comparisons use.setnow have a PGlite round trip.Gap review
design/gap-review.mdlists P0/P1/P2 gaps with Maple call-site counts, where effect-orm is ahead, and the order of work. UPDATE and DELETE are next.Testing
bun run typecheckandbun run testpass: 513 unit tests and the doc checks.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
returning()is called without specifying columns.INSERT ... SELECTnow accepts plain values for branded target columns.