Support index ops classes added by extensions (like `pg_trgm` or `btree_gin`)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 47.6k
- Forks
- 2.5k
- Avg merge
- 21h 59m
- Merged PRs (30d)
- 95
Description
Problem
Fields in advanced indexes in PostgreSQL, like Gin or Gist, have an operator class "which defines the operators handled by the index", for example: https://www.prisma.io/docs/concepts/components/prisma-schema/indexes#generalized-inverted-index-gin Prisma supports the default operator classes of the different index types, and allows you to define any operator class by using the raw("...") escape hatch.
PostgreSQL extensions like pg_trgm, btree_gist or btree_gin can add additional operator classes for other types to these indexes. Although these extensions can be managed in the Prisma schema via extensions (currently preview feature postgresqlExtensions), this currently leads to validation errors in Prisma Schema, as Prisma does not know that the extension is installed and what operator classes it brings.
Suggested Solution
For common extensions like the ones named above Prisma can know and validate the operator classes and their types.
Contributor guide
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.
Research direction
Start by tracing PostgreSQL schema validation around the extensions configuration and the postgresqlExtensions preview feature. Compare how built-in operator classes are recognized, then define completion as common classes from extensions such as pg_trgm, btree_gist, and btree_gin validating with their supported types without requiring raw(...).
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, typescript
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100