prisma-dbml-generator
prisma-dbml-generator copied to clipboard
Feature Request: Option to exclude relation fields
This request is similar to #33 but is different because I need the ability to exclude all relation fields from the generated DBML. Relation fields are not present in the database and can be confusing to consumers of my DBML.
For example, given the below schema
model User {
id Int @id @default(autoincrement())
posts Post[]
profile Profile?
}
model Profile {
id Int @id @default(autoincrement())
user User @relation(fields: [userId], references: [id])
userId Int
}
model Post {
id Int @id @default(autoincrement())
author User @relation(fields: [authorId], references: [id])
authorId Int
}
I need the DBML to be
Table User {
id Int [pk, increment]
}
Table Profile {
id Int [pk, increment]
userId Int [unique, not null]
}
Table Post {
id Int [pk, increment]
authorId Int [not null]
}
Ref: Profile.userId - User.id
Ref: Post.authorId > User.id
PR: https://github.com/notiz-dev/prisma-dbml-generator/pull/35
@marcjulian is this something you're willing to add? I agree with @jon-lewis that this would be very useful for users.