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

Schema autocompletion intellisense don't match custom datasource name #1223

Closed
allanmarianodev opened this issue Aug 10, 2022 · 1 comment · Fixed by #1277
Closed

Schema autocompletion intellisense don't match custom datasource name #1223

allanmarianodev opened this issue Aug 10, 2022 · 1 comment · Fixed by #1277
Assignees
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/schema Issue for team Schema. topic: autocompletion
Milestone

Comments

@allanmarianodev
Copy link

allanmarianodev commented Aug 10, 2022

Bug description

When defining a custom name for the datasource object, the autocompletion feature inserts the default db name even though vscode intellisense popup shows the custom name defined in the schema.

How to reproduce

  1. Create a datasource with custom name (e.g. datasource postgresql { ... }
  2. Define a native database type mapping using autocompletion intellisense (e.g. type @post and activate autocompletion).

Expected behavior

The custom datasource name (e.g. @postgresql) should be inserted.

Prisma information

generator client {
  provider = "prisma-client-js"
}

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

model Product {
  productId String   @id @default(dbgenerated("gen_random_uuid()")) @map("product_id") @postgres.Uuid
  name      String   @unique
  price     Decimal  @postgresql.Money
  createdAt DateTime @default(now()) @map("created_at")
  updatedAt DateTime @updatedAt @map("updated_at")

  @@map("products")
}

Environment & setup

  • OS: Pop_OS! 22.04
  • Database: PostgreSQL 14-alpine docker image
  • Node.js version: 16.16.0

Prisma Version

prisma                  : 4.2.1
@prisma/client          : 4.2.1
Current platform        : debian-openssl-3.0.x
Query Engine (Node-API) : libquery-engine 2920a97877e12e055c1333079b8d19cee7f33826 (at node_modules/@prisma/engines/libquery_engine-debian-openssl-3.0.x.so.node)
Migration Engine        : migration-engine-cli 2920a97877e12e055c1333079b8d19cee7f33826 (at node_modules/@prisma/engines/migration-engine-debian-openssl-3.0.x)
Introspection Engine    : introspection-core 2920a97877e12e055c1333079b8d19cee7f33826 (at node_modules/@prisma/engines/introspection-engine-debian-openssl-3.0.x)
Format Binary           : prisma-fmt 2920a97877e12e055c1333079b8d19cee7f33826 (at node_modules/@prisma/engines/prisma-fmt-debian-openssl-3.0.x)
Default Engines Hash    : 2920a97877e12e055c1333079b8d19cee7f33826
Studio                  : 0.469.0
@allanmarianodev allanmarianodev added the kind/bug A reported bug. label Aug 10, 2022
@janpio janpio transferred this issue from prisma/prisma Aug 10, 2022
@janpio janpio added bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. topic: autocompletion bug/2-confirmed Bug has been reproduced and confirmed. and removed bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. labels Aug 10, 2022
@janpio
Copy link
Member

janpio commented Aug 10, 2022

I can confirm this. What a stupid bug - we will fix this.

@janpio janpio added the team/schema Issue for team Schema. label Aug 10, 2022
@Jolg42 Jolg42 added the process/candidate Candidate for next Milestone. label Aug 11, 2022
@janpio janpio removed the process/candidate Candidate for next Milestone. label Sep 28, 2022
@Druue Druue self-assigned this Nov 3, 2022
@Jolg42 Jolg42 added this to the 4.6.0 milestone Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/schema Issue for team Schema. topic: autocompletion
Development

Successfully merging a pull request may close this issue.

4 participants