Skip to content

Conversation

@jay-l-e-e
Copy link
Contributor

fix: support where argument on field-level @unique for partial indexes

Summary

  • Add where clause parsing to field-level @unique, fixing "No such argument" validation error when db pull generates @unique(where: raw("...")) for single-column partial unique indexes.

Changes

  • psl/parser-database/src/attributes.rs: Call parse_where_clause() in visit_field_unique, matching the existing behavior in model_unique / model_index.
  • psl/psl/tests/attributes/partial_index.rs: 4 new tests covering raw syntax, object syntax, missing preview feature error, and map + where combination.

Test plan

Closes #5773

@jay-l-e-e
Copy link
Contributor Author

@jacek-prisma Please review this PR. Thank you!

@jay-l-e-e jay-l-e-e changed the title Fix support where argument on field-level @unique for partial indexes fix: support where argument on field-level @unique for partial indexes Feb 12, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 13, 2026

Merging this PR will not alter performance

✅ 11 untouched benchmarks
⏩ 11 skipped benchmarks1


Comparing jay-l-e-e:fix/field-level-unique-where-clause (c06c2ce) with main (ab56fe7)

Open in CodSpeed

Footnotes

  1. 11 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

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.

Field-level @unique does not accept where argument for partial indexes.

1 participant