Skip to content

v4.0.0

Choose a tag to compare

@lehni lehni released this 16 Oct 19:13
· 33 commits to main since this release

Upgrading from 3.x? Start with the migration guide. All changes are in the changelog.

Highlights

  • objection is an ES module package, requires Node 20.19 or newer, knex 3.3, MySQL 8 and TypeScript 5.8
  • upsertGraph() and insertGraph() are rewritten:
    • they write graphs in dependency order, and move rows between owners and slots without failing
    • they reject conflicting graphs before writing anything
    • #ref and #ref{} work across the whole graph, also below related models
  • Static hooks get the result in the shape that the query returns, and withGraphFetched() assigns what afterFind returns
  • limit(), offset() and first() in graph modifiers apply per parent by default
  • BelongsToManyRelation, for owners that hold an array of keys
  • JSON field expressions work on MySQL and SQLite
  • The typings check columns against the models in strict mode, and narrow results after select()

3.x keeps getting fixes on the 3.x branch, published under the legacy dist-tag.