Fixed
- Explicit scoped projections preserve nullable column types, including nested selection objects.
- Left-joined columns in explicit projections are nullable, matching Drizzle, including nested objects from the optional table.
- Whole-row
select()with.leftJoin(...)/.innerJoin(...)is typed as Drizzle's nested per-table rows with left-joined tables nullable, instead of flat root rows.
Changed
InferSelectionand scoped projections resolve through Drizzle's ownSelectResultFields, so inference is identical before and after joins and whole-table entries resolve to rows. Unsupported leaf shapes arenever, as in Drizzle, instead ofunknown.orderBy(...)andgroupBy(...)acceptColumn | SQL | SQL.Aliasedinstead ofany.insert(...).values(...)andupdate(...).set(...)payloads use the dialect's own Drizzle types (PgInsertValue,SQLiteInsertValue,MySqlInsertValue, and the matching update set sources), selected by the table's dialect, so placeholders and column references are accepted exactly as in raw Drizzle.select(...),selectDistinct(...), andselectDistinctOn(...)projections are constrained to Drizzle'sSelectedFields, so non-selection objects are rejected at compile time.
These are type-only changes. Generated SQL and runtime behavior are unchanged. Callers may see new compile errors where a left-joined field was used without a null check or where a projection contained a non-Drizzle value; both point at code that was already wrong at runtime.
Install
npm install @modem-dev/drizzle-scoped-db@0.17.0 drizzle-ormVerification
- 151 tests passed with 100% statement, branch, function, and line coverage on the locked and Drizzle 1.0 RC matrices.
- The release benchmark gate passed against
0.16.0with no accepted regressions. - The new type-check benchmark gate passed against
0.16.0: type count +17.1%, instantiation count +16.5%, under the +20% threshold.