Skip to content

fix(deps): update dependency objection to v4 - #893

Open
renovate[bot] wants to merge 1 commit into
devfrom
renovate/objection-4.x
Open

renovate[bot] wants to merge 1 commit into
devfrom
renovate/objection-4.x

Conversation

@renovate

@renovate renovate Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
objection (source) 3.9.1 → 4.4.3 age confidence

Release Notes

ditojs/objection (objection)

v4.4.3

Compare Source

Fixes
  • Queries that mix withGraphJoined() and withGraphFetched() and select all columns of the root table, e.g. with select('*') or select('Person.*'), load the fetched relations again. Since 3.8.0, withGraphJoined() replaces the * with the table's columns, which made the query skip the build step of withGraphFetched(), so its relations were missing from the result without an error #​2269
  • An onBuild() hook that removes operations, e.g. with clearSelect(), no longer makes the query skip building the operation after them, e.g. the where of findById(), which made the query read, update or delete all rows

v4.4.2

Compare Source

Fixes
  • upsertGraph() doesn't update models whose given props are unchanged apart from props that aren't written to the database, like props that $formatDatabaseJson() or pickJsonSchemaProperties leave out. They counted as changed, and the update ran the $beforeUpdate() hooks, which could still write e.g. timestamps #​546

v4.4.1

Compare Source

Changes
  • Strict insertGraph() and upsertGraph() resolve the settings of each relation path once instead of for every model and option, which speeds up large graphs with many relations entries

v4.4.0

Compare Source

Changes
  • Add Model.getGraphSettings(), which resolves the strict mode settings of insertGraph() or upsertGraph() for a relation path from the options of a call, with the same rules and defaults as the call itself #​537
Fixes
  • Strict insertGraph() with added: 'relate' throws a NotFoundError for related models whose ids don't exist, before anything is written, like upsertGraph() does. Since 4.3.0, it related them unchecked, writing keys that point to no row unless a foreign key constraint rejected them #​538

v4.3.0

Compare Source

Changes
  • Add a strict option to insertGraph() and upsertGraph() that makes graphs say what they mean. Options are given per relation, as root and relations settings for the rows that a graph leaves out (removed), the rows with ids that aren't in their relation yet (added), the rows that stay (kept) and the new rows (created). In strict mode, they replace the per-path options like relate, unrelate and noDelete. See strict mode #​429
  • Strict graphs throw where other graphs skip or override data: for rows they don't write, for key props that contradict their relations, and for values they don't write that differ from the stored rows. Equal values pass, so fetched graphs can be sent back unchanged #​429
  • Strict insertGraph() and upsertGraph() are atomic: they run in a transaction, their own unless the query already runs in one, so a database error halfway leaves nothing written. Hooks that run queries need to use context.transaction, or they wait for the transaction, and deadlock on SQLite #​477
Fixes
  • The typings of the upsertGraph() options declare fetchStrategy, which TypeScript rejected since 1.6.4 added the option #​531

v4.2.0

Compare Source

All changes are in the changelog.

Changes
  • Running the same patchAndFetch() or updateAndFetch() query a second time, e.g. awaiting it twice, throws. The second run wrote back the row that the first one fetched, undoing other writes in between.
Fixes
  • patchAndFetch() and updateAndFetch() with an empty patch return the unchanged model instead of undefined
  • asFindQuery() in static after hooks runs the onBuild hooks of the query's context only once

v4.1.0

Compare Source

All changes are in the changelog.

Changes
  • On PostgreSQL, JSON field expressions with a single key use -> / ->> instead of #> / #>>, so expression indexes like ((props->>'points')) match them. An index built on the #>>'{key}' form needs to be rebuilt with ->>.
Fixes
  • ref().castText() on JSON paths works with mysql2 on MySQL, e.g. in JSON relation joins
  • JSON keys with backslashes read the right values on PostgreSQL with standard_conforming_strings off
  • In strict mode, editors suggest column names in where({ }), findOne({ }) and having({ })

v4.0.0

Compare Source

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.

v3.9.3

Compare Source

Fixes
  • Queries that mix withGraphJoined() and withGraphFetched() and select all columns of the root table, e.g. with select('*') or select('Person.*'), load the fetched relations again. Since 3.8.0, withGraphJoined() replaces the * with the table's columns, which made the query skip the build step of withGraphFetched(), so its relations were missing from the result without an error #​2269
  • An onBuild() hook that removes operations, e.g. with clearSelect(), no longer makes the query skip building the operation after them, e.g. the where of findById(), which made the query read, update or delete all rows

v3.9.2

Compare Source

Fixes
  • upsertGraph() doesn't update models whose given props are unchanged apart from props that aren't written to the database, like props that $formatDatabaseJson() or pickJsonSchemaProperties leave out. They counted as changed, and the update ran the $beforeUpdate() hooks, which could still write e.g. timestamps #​547

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
renovate Bot force-pushed the renovate/objection-4.x branch 14 times, most recently from 4a65f8c to 23e454c Compare October 25, 2026 05:41
@renovate
renovate Bot force-pushed the renovate/objection-4.x branch 9 times, most recently from 03e8485 to ad96c05 Compare October 30, 2026 08:36
@renovate
renovate Bot force-pushed the renovate/objection-4.x branch from ad96c05 to 8c998f6 Compare November 2, 2026 04:48
@renovate
renovate Bot force-pushed the renovate/objection-4.x branch from 8c998f6 to c02c879 Compare November 5, 2026 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants