Skip to content

test(client): push item/items to scalar list#29206

Closed
bre7 wants to merge 2 commits intoprisma:mainfrom
bre7:test-scalar-list-push
Closed

test(client): push item/items to scalar list#29206
bre7 wants to merge 2 commits intoprisma:mainfrom
bre7:test-scalar-list-push

Conversation

@bre7
Copy link
Copy Markdown
Contributor

@bre7 bre7 commented Feb 16, 2026

Related to issue #29200 and #29212

Same as json test but uses TEXT[] instead

Docs: https://www.prisma.io/docs/orm/prisma-client/special-fields-and-types/working-with-scalar-lists-arrays#adding-items-to-a-scalar-list

Summary by CodeRabbit

  • Tests
    • Added functional tests validating scalar-list "push" behavior (single and multiple elements) with PostgreSQL, including opt-outs for unsupported databases.
    • Added a test matrix targeting PostgreSQL and dynamic test schema generation to support provider-specific test runs.

Copilot AI review requested due to automatic review settings February 16, 2026 14:23
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Feb 16, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 16, 2026

Walkthrough

Adds a new functional test suite for scalar-list-push: a test matrix targeting PostgreSQL, a Prisma schema generator producing a User model with a String[] field, and tests that validate pushing single and array values into the scalar list with appropriate database skips.

Changes

Cohort / File(s) Summary
Test Configuration
packages/client/tests/functional/scalar-list-push/_matrix.ts
Adds a test matrix export using defineMatrix with a single configuration specifying Providers.POSTGRESQL.
Schema Definition
packages/client/tests/functional/scalar-list-push/prisma/_schema.ts
Adds a dynamic Prisma schema via testMatrix.setupSchema that defines a prisma-client generator, a datasource using the provided provider, and a User model with an id and content (String[]).
Functional Tests
packages/client/tests/functional/scalar-list-push/tests.ts
Adds tests that seed a user with content = ["prisma1","prisma2"] and assert push behavior for a single element and for an array push; marks unsupported DB providers to skip (sqlite, mysql, sqlserver).
🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (9 files):

⚔️ packages/client-generator-js/package.json (content)
⚔️ packages/client-generator-ts/package.json (content)
⚔️ packages/client/package.json (content)
⚔️ packages/engines/package.json (content)
⚔️ packages/fetch-engine/package.json (content)
⚔️ packages/internals/package.json (content)
⚔️ packages/migrate/package.json (content)
⚔️ packages/schema-files-loader/package.json (content)
⚔️ pnpm-lock.yaml (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'test(client): push item/items to scalar list' accurately describes the main change: adding functional tests for pushing values into scalar list fields in Prisma client.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch test-scalar-list-push
  • Post resolved changes as copyable diffs in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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.

@bre7 bre7 changed the title Add test case for scalar list push test(client):scalar list push Feb 16, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds test coverage for scalar list push operations in response to issue #29200, which reported fatal errors when pushing multiple items to scalar lists in Prisma 7. The test suite validates both single element and array push operations on String[] fields, similar to the existing json-list-push test but using scalar arrays instead.

Changes:

  • Added test cases for scalar list push with single element and array values
  • Created Prisma schema with String[] field for testing scalar list operations
  • Configured test matrix to run only on PostgreSQL (where scalar lists are supported)

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/client/tests/functional/scalar-list-push/tests.ts Test suite with two test cases validating push operations on scalar String[] fields
packages/client/tests/functional/scalar-list-push/prisma/_schema.ts Schema definition with User model containing String[] content field
packages/client/tests/functional/scalar-list-push/_matrix.ts Test matrix configuration limiting tests to PostgreSQL provider

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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: 1

@bre7 bre7 changed the title test(client):scalar list push test(client): push item/items to scalar list Feb 16, 2026
@jacek-prisma
Copy link
Copy Markdown
Contributor

Closing since the linked issue has been closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants