aurora
aurora copied to clipboard
Feature Request: Integration with the prisma VSC extension + Aurora VSC extension for auto completing relations.
Is your feature request related to a problem? Please describe.
- It's very annoying to duplicate a target relation model in the file when we need to use it in a model field.
// Author.prisma
model Author {
id Int @id @default(autoincrement())
books Book[]
}
model Book {
id Int @id
authorId Int
author Author @relation(fields: [authorId], references: [id])
}
- There's no auto-completion in the relation models that are defined in other files.
Describe the solution you'd like
-
Make a VSC extension for Aurora and Its job will be as the following:
- Read the
aurora.config.json
file to get the files array so that we can addonChange
watchers on the matching files using VSC SDK. - Add
provideCompletionItems
to the IntelliSense with the models specified in the files that we're watching to provide auto completion when writing relations in model fields. - Add an
onChange
watcher for theaurora.config.json
to reset the files' watchers if it changes.
- Read the
-
Add an Integration for Aurora with Prisma's VSC extension as the following:
- Ignore throwing errors on missing models in relationships when an
aurora.config.json
file is found in the project so that handling missing models will beAurora
's responsibility as it has all of the information about all of the models that are defined in the project.
- Ignore throwing errors on missing models in relationships when an
-
Add an optional config object to
getDMMF
so that we can optionally apply a feature to useAurora
which will skip throwing errors related to missing models in relations.
Additional context
I'm willing to contribute to this repo and the Prisma extension repo to implement this feature, just let me know WDYT?
The problem/solution was inspired by the talk that I've just watched an hour ago by the Prisma advocacy team in What's new in Prisma (v3.12.0)
when you were talking about potential solutions to fix this problem.