feat!: Move knex-specific loader methods to knexLoader#407
Open
feat!: Move knex-specific loader methods to knexLoader#407
Conversation
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
78b4db1 to
8efee7b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #407 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 91 96 +5
Lines 12694 13144 +450
Branches 1122 1140 +18
==========================================
+ Hits 12694 13144 +450
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
5148002 to
fd886c7
Compare
This was referenced Jan 31, 2026
Open
fd886c7 to
a0423c5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Why
This is a long stack, but the goal is to make a place to put postgres-specific loading logic to avoid polluting the core dataloader-based library with logic specific to knex/postgres. And potentially even postgres-specific mutation logic but that's way down the road.
The best place for this stuff is in the
entity-database-adapter-knexlibrary. Therefore, the strategy is (in PR order):knexLoader. I'm also open to calling this a "Postgres Loader" since theentity-database-adapter-knexpackage already uses postgres-specific queries (and more are added here since this stack eventually produces raw queries) within knex even though technically knex is database agnostic.entity-database-adapter-knexpackage. This requires creating a "plugin" system for database adapters, where when they are included their methods are added to the prototype so that seamless loading continues to work.Future other things that could be added here (after thorough thought on authorization) are:
For Reviewers
The most critical things to assess are:
How
This is part 1. It refactors the loaders by moving
loadManyByFieldEqualityConjunctionAsync,loadFirstByFieldEqualityConjunctionAsync, andloadManyByRawWhereClauseAsyncto a separate loader.The new pattern for these is:
Test Plan
This has full coverage in new tests.