Skip to content

fix: render tuple functions#29243

Merged
jacek-prisma merged 7 commits intomainfrom
fix/render-tuple-functions
Feb 24, 2026
Merged

fix: render tuple functions#29243
jacek-prisma merged 7 commits intomainfrom
fix/render-tuple-functions

Conversation

@jacek-prisma
Copy link
Copy Markdown
Contributor

@jacek-prisma jacek-prisma commented Feb 24, 2026

TML-1922

Enables the interpreter to render tuples of parameters wrapped in function calls. Needed for properly rendering ? IN (LOWER(?), LOWER(?)).

Fixes #29215

Summary by CodeRabbit

  • Bug Fixes

    • Parameter tuples in generated SQL now format each item with the configured prefix, separator, and suffix while remaining parenthesized.
  • Tests

    • Added functional tests for case-insensitive IN and NOT IN filters (matrix excludes unsupported engines).
    • Added dynamic test schema and updated unit tests to reflect tuple formatting.
  • Chores

    • CI workflow updated to use a newer action release.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 24, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

ParameterTuple fragment now carries itemPrefix/itemSeparator/itemSuffix; rendering wraps each placeholder with those and joins by separator. Added functional tests (case-insensitive IN/NOT IN for Attachment.fileName) and updated a CI action to v2.1.0.

Changes

Cohort / File(s) Summary
Parameter Tuple Formatting
packages/client-engine-runtime/src/query-plan.ts, packages/client-engine-runtime/src/interpreter/render-query.ts, packages/client-engine-runtime/src/interpreter/render-query.test.ts
parameterTuple fragment type extended with itemPrefix, itemSeparator, itemSuffix. Renderer now wraps each placeholder with prefix/suffix and joins them using the separator. Tests updated to use the new fragment shape.
Case-Insensitive IN Filter Tests
packages/client/tests/functional/issues/29215-case-insensitive-in/_matrix.ts, packages/client/tests/functional/issues/29215-case-insensitive-in/prisma/_schema.ts, packages/client/tests/functional/issues/29215-case-insensitive-in/tests.ts
New test matrix, provider-driven Prisma schema, and functional tests for case-insensitive IN and NOT IN on Attachment.fileName. Tests opt out of MySQL, SQLite, and SQLServer providers.
CI Workflow Pin
.github/workflows/build-engine-branch.yml
Updated GitHub Actions step to use v2.1.0 of the Binaryen installer action (patch-level version change).
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: render tuple functions' directly addresses the core change: extending parameterTuple fragment type to support wrapped formatting (itemPrefix/Separator/Suffix) for proper SQL generation of tuple parameters in function calls, which fixes issue #29215.
Linked Issues check ✅ Passed The PR restores case-insensitive IN query behavior by enabling parameterTuple rendering with wrapper functions (LOWER). The code changes extend Fragment.parameterTuple with formatting fields and update render logic to wrap each parameter, directly fulfilling #29215's requirement to restore v7.3.0 SQL generation.
Out of Scope Changes check ✅ Passed All changes directly support the linked issue: query-plan.ts extends Fragment type, render-query.ts implements the new formatting logic, tests validate both implementations, and the workflow update supports build infrastructure.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/render-tuple-functions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3


ℹ️ Review info

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cb5e8a1 and 5aa1aea.

📒 Files selected for processing (5)
  • packages/client-engine-runtime/src/interpreter/render-query.ts
  • packages/client-engine-runtime/src/query-plan.ts
  • packages/client/tests/functional/issues/29215-case-insensitive-in/_matrix.ts
  • packages/client/tests/functional/issues/29215-case-insensitive-in/prisma/_schema.ts
  • packages/client/tests/functional/issues/29215-case-insensitive-in/tests.ts

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
packages/client/tests/functional/issues/29215-case-insensitive-in/tests.ts (1)

7-69: LGTM — both previously raised issues are correctly resolved:

  • Provider guard: optOut for mysql/sqlite at lines 65–68 correctly excludes providers that don't support mode: 'insensitive'.
  • IN test ordering: toHaveLength(2) + arrayContaining at lines 31–37 makes the assertion order-independent.
  • NOT IN test: expects exactly one result, so toEqual([...]) is deterministic and safe as-is.
  • afterEach cleanup is scoped correctly and each test uses distinct file names, ensuring isolation.

ℹ️ Review info

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b0fd4dd and bd72764.

📒 Files selected for processing (1)
  • packages/client/tests/functional/issues/29215-case-insensitive-in/tests.ts

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 24, 2026

size-limit report 📦

Path Size
packages/client/runtime/index-browser.js 2.23 KB (0%)
packages/client/runtime/index-browser.d.ts 3.28 KB (0%)
packages/cli/build/index.js 2.5 MB (0%)
packages/client/prisma-client-0.0.0.tgz 26.81 MB (+0.01% 🔺)
packages/cli/prisma-0.0.0.tgz 12.84 MB (0%)
packages/bundle-size/da-workers-libsql/output.tgz 1.33 MB (+0.01% 🔺)
packages/bundle-size/da-workers-neon/output.tgz 1.39 MB (+0.01% 🔺)
packages/bundle-size/da-workers-pg/output.tgz 1.38 MB (+0.01% 🔺)
packages/bundle-size/da-workers-planetscale/output.tgz 1.33 MB (+0.01% 🔺)
packages/bundle-size/da-workers-d1/output.tgz 1.3 MB (+0.01% 🔺)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 24, 2026

🟢 All good, this PR is no longer uses custom engine.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 24, 2026
jacek-prisma added a commit to prisma/prisma-engines that referenced this pull request Feb 24, 2026
[TML-1922](https://linear.app/prisma-company/issue/TML-1922/fix-case-insensitive-in-regression)

Enables the query compiler to render tuples of parameters wrapped in
function calls. Needed for properly rendering `? IN (LOWER(?),
LOWER(?))`.

Client PR: prisma/prisma#29243
@jacek-prisma jacek-prisma merged commit 87d2313 into main Feb 24, 2026
253 of 254 checks passed
@jacek-prisma jacek-prisma deleted the fix/render-tuple-functions branch February 24, 2026 19:51
dimsssss pushed a commit to dimsssss/prisma-engines that referenced this pull request Feb 26, 2026
[TML-1922](https://linear.app/prisma-company/issue/TML-1922/fix-case-insensitive-in-regression)

Enables the query compiler to render tuples of parameters wrapped in
function calls. Needed for properly rendering `? IN (LOWER(?),
LOWER(?))`.

Client PR: prisma/prisma#29243
jacek-prisma added a commit that referenced this pull request Feb 27, 2026
[TML-1922](https://linear.app/prisma-company/issue/TML-1922/fix-case-insensitive-in-regression)

Enables the interpreter to render tuples of parameters wrapped in
function calls. Needed for properly rendering `? IN (LOWER(?),
LOWER(?))`.

Fixes #29215

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Parameter tuples in generated SQL now format each item with the
configured prefix, separator, and suffix while remaining parenthesized.

* **Tests**
* Added functional tests for case-insensitive IN and NOT IN filters
(matrix excludes unsupported engines).
* Added dynamic test schema and updated unit tests to reflect tuple
formatting.

* **Chores**
  * CI workflow updated to use a newer action release.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change in query generation related to case insensitive 'in'

2 participants