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 add onChange 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 the aurora.config.json to reset the files' watchers if it changes.
-
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 be Aurora's responsibility as it has all of the information about all of the models that are defined in the project.
-
Add an optional config object to getDMMF so that we can optionally apply a feature to use Aurora 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?
Is your feature request related to a problem? Please describe.
Describe the solution you'd like
Make a VSC extension for Aurora and Its job will be as the following:
aurora.config.jsonfile to get the files array so that we can addonChangewatchers on the matching files using VSC SDK.provideCompletionItemsto the IntelliSense with the models specified in the files that we're watching to provide auto completion when writing relations in model fields.onChangewatcher for theaurora.config.jsonto reset the files' watchers if it changes.Add an Integration for Aurora with Prisma's VSC extension as the following:
aurora.config.jsonfile 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.Add an optional config object to
getDMMFso that we can optionally apply a feature to useAurorawhich 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?