[Feature Request] Add support for partial indexes
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from zenstackhq/zenstack
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
zenstackhq/zenstack#2873 ·
Maintainers usually reply within 1 day
-
runtime
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
zenstackhq/zenstack#2868 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
zenstackhq/zenstack#2694 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
zenstackhq/zenstack#2659 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
zenstackhq/zenstack#2542 · 1 comment ·
Maintainers usually reply within 1 day
All issues in zenstackhq/zenstack
Similar issues
-
area/frontend area/v2 kind/bug priority/needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
kubeflow/notebooks#1498 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
P1
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
SuruchBoss/Cwork#90 ·
-
bug cli service
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
521xueweihan/HelloGitHub#3922 ·