Skip to content

2.7.0

Choose a tag to compare

@3m1n3nc3 3m1n3nc3 released this 15 Jun 10:16
· 471 commits to main since this release

What's Changed

Features

  • SQL join family. The query builder now supports joins on SQL-backed
    adapters: join/innerJoin, leftJoin, rightJoin, crossJoin, the
    value-comparison joinWhere/leftJoinWhere/rightJoinWhere, subquery joins
    joinSub/leftJoinSub/rightJoinSub/crossJoinSub, and lateral joins
    joinLateral/leftJoinLateral. Pass a closure to build compound ON
    conditions through the new JoinClause builder (on, orOn, where,
    whereNull, onRaw, and nested groups). Available on Model.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, including do $$ ... $$ 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

  • whereRaw identifier casing. Bare camelCase identifiers in
    whereRaw()/orWhereRaw() are now automatically double-quoted on the Kysely
    adapter, so whereRaw('createdAt < ?', [before]) compiles to
    "createdAt" < $1 instead of folding to a non-existent createdat column. SQL
    keywords, function names, already-quoted identifiers, and string literals are
    left untouched.

Adapters

  • New joins adapter 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