feat(prisma): add string concatenation and hierarchy operators#157
feat(prisma): add string concatenation and hierarchy operators#157alexolivier merged 11 commits intomainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4fb9bb4ca9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…segment-based hierarchy prefixes - buildImpossibleFilter now wraps contradiction in buildNestedRelationFilter when the field reference has relations, preventing Prisma validation errors - Hierarchy prefix construction uses segments re-joined with the target delimiter instead of raw strings, fixing false negatives with mismatched delimiters - Constant/constant ancestor check compares segment arrays directly Signed-off-by: Alex Olivier <alex@alexolivier.me>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f3973fbb5b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…cestor/descendant - buildImpossibleFilter delegates each condition to buildFieldFilter so relation field aliases are handled correctly per-condition - handleOverlapsOperator supports field-type hierarchies by combining prefix/equality/startsWith checks - normalizeHierarchy converts all-constant segmented hierarchies to constant type for ancestor/descendant and overlaps operators Signed-off-by: Alex Olivier <alex@alexolivier.me>
- Reuse getStrictPrefixes in handleFieldOverlaps instead of manual loop - Fix unsafe type cast in handleFieldOverlaps with proper narrowing - Move normalizeHierarchy into extractHierarchyOperands - Use CERBOS_TO_PRISMA_OPERATOR map instead of manual ternary - Remove unreachable buildImpossibleFilterFromHierarchies - Short-circuit tryFoldValueExpression on non-value left operand - Deduplicate descendentOf operator name string Signed-off-by: Alex Olivier <alex@alexolivier.me>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4b71fa9457
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…field delimiter for prefixes - buildImpossibleFilter now builds the AND contradiction as a single unit wrapped in one relation traversal, ensuring to-many relations can't satisfy each condition with different rows - Use ancestor field's delimiter when building prefixes from constant descendant segments, fixing mismatch when segmented hierarchies are normalized with default delimiter Signed-off-by: Alex Olivier <alex@alexolivier.me>
buildImpossibleFilter now uses the deepest relation's field alias when constructing the contradiction, matching the remapping behavior in buildNestedRelationFilter. Signed-off-by: Alex Olivier <alex@alexolivier.me>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5f0d0c0549
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Replace null-based contradiction (equals: null / not: null) with
{ in: [] } which works for all field types including non-nullable
required fields. Also simplifies buildImpossibleFilter to a single
buildFieldFilter call.
Signed-off-by: Alex Olivier <alex@alexolivier.me>
Signed-off-by: Alex Olivier <alex@alexolivier.me>
Summary
addoperator support for string/numeric concatenation with algebraic solving (e.g.P.attr.context == "projects:" + R.attr.id→{ id: { equals: "123" } })overlaps,ancestorOf,descendentOffor segment-wise prefix comparisonshierarchy(string),hierarchy(string, delimiter),hierarchy([segments])Closes #155, closes #156
Test plan