feat(query): add support for composite primary keys in where clause.#590
Conversation
Supports `whereId` and `whereIdIn` methods.
Codecov Report
@@ Coverage Diff @@
## master #590 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 47 47
Lines 1888 1904 +16
Branches 265 270 +5
=========================================
+ Hits 1888 1904 +16
Continue to review full report at Codecov.
|
|
The only addition I would like to consider is error handling. For example, there is no fishnet for While this isn’t a major concern, it would make sense for such methods to warn the user or throw an error when passing malformed values. I.e. throwing an error using Thoughts? |
|
Yea, agree. Since both (a) and (b), it wouldn't work as users would expect, so having error is really nice in this case 👍 |
|
Error handling has been implemented. I've escalated this to both The new method In addition, there is a new type guard called @kiaking let me know if you have any further input or comments. |
|
@kiaking this PR is stable and ready to merge 👍 |
|
Niiice! 🎉 |
Description
This PR adds support for composite primary keys when using
whereIdandwhereIdInquery criteria methods.Type of PR:
Breaking changes:
Details
Query execution with
findandfindInsupport composite primary keys and it seems fitting to provide consistent behaviour for criteria predicates using methodswhereIdandwhereIdIn.Using
whereIdwith composite primary keys:Using
whereIdInwith composite primary keys:Maintains ID filters and gracefully cancels ID filters as per normal: