-
Notifications
You must be signed in to change notification settings - Fork 52
Missing code autocomplete for referential actions with mongodb #1676
Copy link
Copy link
Closed
prisma/prisma-engines
#4844Labels
bug/2-confirmedBug has been reproduced and confirmed.Bug has been reproduced and confirmed.domain/schemaIssue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc.Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc.kind/bugA reported bug.A reported bug.topic: autocompletionLSP text document completionLSP text document completiontopic: mongodb
Milestone
Description
Bug description
Not sure if this is a bug or a missing feature, but when adding any referential actions (onDelete or onUpdate), it does not give any auto-suggestion in vscode even while using the Prisma extension.
Normally it gives fields, names, references when creating any type of relation between models but it does not give for onDelete or onUpdate. Also all the support actions with it (Cascade, SetNull, etc).
How to reproduce
- Create a relation between 2 models,
- Try adding a referential action for say onDelete.
- Here, you have to type it it up all manually.
Expected behavior
the actions gets auto-suggested as to what type of relation you want to set.
Prisma information
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}
model Post {
id String @id @default(auto()) @map("_id") @db.ObjectId
title String
author User @relation(fields: [authorId], references: [id], onDelete: Cascade)
authorId String @db.ObjectId
}
model User {
id String @id @default(auto()) @map("_id") @db.ObjectId
posts Post[]
}Environment & setup
- OS: Windows 11
- Database: MongoDB
- Node.js version: v20.10.0
Prisma Version
Environment variables loaded from .env
prisma : 5.10.2
@prisma/client : 5.10.2
Computed binaryTarget : windows
Operating System : win32
Architecture : x64
Node.js : v20.10.0
Query Engine (Node-API) : libquery-engine 5a9203d0590c951969e85a7d07215503f4672eb9 (at node_modules\@prisma\engines\query_engine-windows.dll.node)
Schema Engine : schema-engine-cli 5a9203d0590c951969e85a7d07215503f4672eb9 (at node_modules\@prisma\engines\schema-engine-windows.exe)
Schema Wasm : @prisma/prisma-schema-wasm 5.10.0-34.5a9203d0590c951969e85a7d07215503f4672eb9
Default Engines Hash : 5a9203d0590c951969e85a7d07215503f4672eb9
Studio : 0.499.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bug/2-confirmedBug has been reproduced and confirmed.Bug has been reproduced and confirmed.domain/schemaIssue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc.Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc.kind/bugA reported bug.A reported bug.topic: autocompletionLSP text document completionLSP text document completiontopic: mongodb