Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completions for PostgreSQL GIN/GiST/SP-GiST/BRIN Indices #1139

Closed
Tracked by #12376
pimeys opened this issue Apr 25, 2022 · 0 comments · Fixed by #1178
Closed
Tracked by #12376

Completions for PostgreSQL GIN/GiST/SP-GiST/BRIN Indices #1139

pimeys opened this issue Apr 25, 2022 · 0 comments · Fixed by #1178
Assignees
Labels
kind/feature A request for a new feature. team/schema Issue for team Schema. tech/engines/datamodel Issue about parsing/validation/rendering of the Prisma schema topic: autocompletion topic: extendedIndex
Milestone

Comments

@pimeys
Copy link
Contributor

pimeys commented Apr 25, 2022

We'll be introducing new index types for PostgreSQL. The catch here is all of them either require or allow you to define the operator classes per indexed field. For example:

model A {
  id  Int    @id
  val String @db.Inet

  @@index(val(ops: InetOps), type: Gist)
}

The language server should offer proper auto-completion items here:

model A {
  id  Int    @id
  val String @db.Inet

  @@index(val(ops: |), type: Gist)
//                 ^ See the native type of `val` is `Inet` and
//                   the index type is GiST, offer `InetOps`.
}

and here:

model A {
  id  Int    @id
  val String @db.Inet

  @@index(val(ops: InetOps), type: |)
//                                 ^ offer Gist, Gin, SpGist, Brin, Hash or BTree
}

Rules:

  • The operator class must match the native type and the index type (see the lists here)
  • The extendedIndexes preview feature must be on
  • Provider must be postgresql
@pimeys pimeys added process/candidate Candidate for next Milestone. topic: autocompletion tech/engines/datamodel Issue about parsing/validation/rendering of the Prisma schema team/schema Issue for team Schema. topic: extendedIndex labels Apr 25, 2022
@janpio janpio added kind/feature A request for a new feature. and removed process/candidate Candidate for next Milestone. labels Apr 25, 2022
@Jolg42 Jolg42 changed the title PostgreSQL BRIN/SP-GiST/GIN/GiST Indices Completions for PostgreSQL BRIN/SP-GiST/GIN/GiST Indices May 4, 2022
@Jolg42 Jolg42 self-assigned this May 4, 2022
@janpio janpio added this to the 3.14.0 milestone May 4, 2022
@janpio janpio changed the title Completions for PostgreSQL BRIN/SP-GiST/GIN/GiST Indices Completions for PostgreSQL GIN/GiST/SP-GiST/BRIN Indices Jun 7, 2022
@Jolg42 Jolg42 modified the milestones: 3.14.0, 4.0.x Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature A request for a new feature. team/schema Issue for team Schema. tech/engines/datamodel Issue about parsing/validation/rendering of the Prisma schema topic: autocompletion topic: extendedIndex
Development

Successfully merging a pull request may close this issue.

4 participants