Repository navigation
2.7.0
What's Changed
Features
-
SQL join family. The query builder now supports joins on SQL-backed
adapters:join/innerJoin,leftJoin,rightJoin,crossJoin, the
value-comparisonjoinWhere/leftJoinWhere/rightJoinWhere, subquery joins
joinSub/leftJoinSub/rightJoinSub/crossJoinSub, and lateral joins
joinLateral/leftJoinLateral. Pass a closure to build compoundON
conditions through the newJoinClausebuilder (on,orOn,where,
whereNull,onRaw, and nested groups). Available onModel.query()and
DB.table(). -
Configurable migration timestamps.
table.timestamps()now accepts
timestamps(casing?, mapCasing?), where each argument is'camel','snake',
or an explicit{ createdAt?, updatedAt? }object. The first controls the
attribute names; the second controls the mapped physical column names via
.map(). The no-argument default (createdAt/updatedAt) is unchanged. -
Multi-statement raw SQL.
DB.raw()now runs scripts containing more than
one statement, includingdo $$ ... $$blocks. The Kysely adapter splits the
script into individual statements — ignoring semicolons inside string
literals, dollar-quoted bodies, and comments — and executes them sequentially
inside a transaction.
Fixes
whereRawidentifier casing. Bare camelCase identifiers in
whereRaw()/orWhereRaw()are now automatically double-quoted on the Kysely
adapter, sowhereRaw('createdAt < ?', [before])compiles to
"createdAt" < $1instead of folding to a non-existentcreatedatcolumn. SQL
keywords, function names, already-quoted identifiers, and string literals are
left untouched.
Adapters
- New
joinsadapter capability. The Kysely adapter advertises and implements
it; the Prisma compatibility adapter rejects join clauses with a clear
UnsupportedAdapterFeatureException.
Full Changelog: 2.6.1...2.7.0