Repository navigation
feat: add ID-based and field-based knex database loaders for use with locking modifiers - #706
Merged
wschurman merged 1 commit intoSep 28, 2026
Conversation
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #706 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 109 109
Lines 18169 18485 +316
Branches 1564 1596 +32
==========================================
+ Hits 18169 18485 +316
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
wschurman
force-pushed
the
09-25-feat_add_id_and_field_knex_database_loaders
branch
from
September 25, 2026 22:34
8f6f53e to
9d9d299
Compare
wschurman
force-pushed
the
09-25-feat_add_id_and_field_knex_database_loaders
branch
from
September 28, 2026 18:42
9d9d299 to
39d0252
Compare
wschurman
marked this pull request as ready for review
September 28, 2026 19:19
byronkarlen
approved these changes
Sep 28, 2026
ide
approved these changes
Sep 28, 2026
Comment on lines
+72
to
+88
| /** | ||
| * Row locking modifier that locks the selected rows for update using `SELECT ... FOR UPDATE`. | ||
| * The lock is held until the end of the transaction, so the query context must be transactional. | ||
| */ | ||
| export interface EntityLoaderForUpdateRowLockingModifier { | ||
| forUpdate: true; | ||
| forShare?: never; | ||
| } | ||
|
|
||
| /** | ||
| * Row locking modifier that locks the selected rows in share mode using `SELECT ... FOR SHARE`. | ||
| * The lock is held until the end of the transaction, so the query context must be transactional. | ||
| */ | ||
| export interface EntityLoaderForShareRowLockingModifier { | ||
| forShare: true; | ||
| forUpdate?: never; | ||
| } |
wschurman
deleted the
09-25-feat_add_id_and_field_knex_database_loaders
branch
September 28, 2026 23:29
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
For #704 and #705, these only exposed the modifiers on
loadManyByEqualityConjunction/loadManyBySQL, but a decent proportion of the callsites in the Expo server would preferloadByIdsince the existence semantics are stronger (throws anEntityNotFoundErrorwhen not found).The alternative is to require these callsites use
loadManyByEqualityConjunctionand then manually throw aEntityNotFoundErrorwhen null in the application, but this violates the abstraction responsibility as only the library should be throwing its errors if we can help it.How
Expose similar-error-semantic loader methods on the knex loader, but with distinct names, that require a modifier (otherwise the normal loader should be used).
Agent use
Fully-agent-generated. Prompt was:
Test Plan
Run updated tests.