Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Feature Request] Add support for partial indexes

Open
#2,621 0 comments 2 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

  • #2622 by @lsmith77 — closed without merging

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
typescript
Domain
databases

Research direction

The request states the target syntax but gives no code pointers, so start from where ZModel attributes like @@index/@@unique are parsed and where the schema is translated into a Prisma schema/migration, since the where clause has to survive both stages. The linked Prisma docs show the expected generated output. Closed PR #2622 is a prior attempt worth reading before restarting. Done means a ZModel schema using @@index([email], where: raw(...)) yields an equivalent Prisma schema, with a test covering it.

Written by the indexing model from the issue text.

Description

Is your feature request related to a problem? Please describe.
I would like to see support for partial indexes, since they are supported in Prisma Migration.

Describe the solution you'd like
Same syntax as prisma:

  @@unique([email], where: raw("status = 'active'"))
  @@index([email], where: raw("\"deletedAt\" IS NULL"))

Describe alternatives you've considered
Using @meta with a custom plugin to tweak the prisma schema generation.

Additional context
https://discord.com/channels/1035538056146595961/1087761218049167380/1494007717076140114

Dominant language
TypeScript
Stars
2.9k
Forks
157
Avg merge
11h 42m
Merged PRs (30d)
20

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from zenstackhq/zenstack

All issues in zenstackhq/zenstack

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.