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

feat(ls): completions for PostgreSQL index types #1178

Merged
merged 3 commits into from
Jun 22, 2022
Merged

Conversation

Jolg42
Copy link
Member

@Jolg42 Jolg42 commented Jun 22, 2022

Closes #1139

schema for manual testing

datasource db {
    provider = "postgresql"
    url      = env("DATABASE_URL")
}

model ops {
    id    Int @id
    title   String
    content String
    
    @@index([title( )], type: Gist)
//                 ^ sort, ops
}

model type {
    id    Int @id
    title   String
    content String
    
    @@index([title], )
//                  ^ fields, map, type
}

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

  @@index([title(ops: )], type: Gist)
//                   ^ See the native type of `title` is `Inet` and
//                     the index type is GiST
//                     it suggests `InetOps` & `raw`.
}

model B {
  id  Int    @id
  title String @db.Inet

  @@index([title], type: )
//                       ^ Gist, Gin, SpGist, Brin, Hash or BTree
}

model C {
    id    Int @id
    title   String
    content String
    
    @@index([title(ops: )], type: Gist)
//                      ^ raw
}

@Jolg42 Jolg42 added this to the 4.0.0 milestone Jun 22, 2022
@Jolg42 Jolg42 requested a review from jkomyno June 22, 2022 08:57
@github-actions
Copy link

github-actions bot commented Jun 22, 2022

🤖 Pull request artifacts

file commit
pr1178-prisma.vsix 68e4395

github-actions bot added a commit that referenced this pull request Jun 22, 2022
@github-actions
Copy link

@Jolg42 Jolg42 marked this pull request as draft June 22, 2022 09:03
github-actions bot added a commit that referenced this pull request Jun 22, 2022
@Jolg42 Jolg42 marked this pull request as ready for review June 22, 2022 10:02
@Jolg42 Jolg42 changed the title fix(ls): remove completions for postgres type: (done from prisma-fmt) fix(ls): completions for PostgreSQL index types Jun 22, 2022
@Jolg42 Jolg42 changed the title fix(ls): completions for PostgreSQL index types feat(ls): completions for PostgreSQL index types Jun 22, 2022
Copy link
Contributor

@jkomyno jkomyno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

packages/language-server/src/completion/completions.ts Outdated Show resolved Hide resolved
[skip ci]

Co-authored-by: Alberto Schiabel <jkomyno@users.noreply.github.com>
@Jolg42 Jolg42 merged commit 4aacab5 into main Jun 22, 2022
@Jolg42 Jolg42 deleted the joel/postgres-indices branch June 22, 2022 11:07
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.

Completions for PostgreSQL GIN/GiST/SP-GiST/BRIN Indices
2 participants