-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Adds support for view and type blocks #2179
Conversation
Signed-off-by: Mihovil Ilakovac <[email protected]>
e9516cb
to
1c74597
Compare
@Martinsos Now I've implemented the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Approved but also left a couple of smaller comments.
data Type | ||
= Type | ||
Name | ||
Body |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So does type actually support anything that can go into Model body, or is it a subset? That is relevant both here for AST and also for parser. If it is indeed anything that goes into model, then great. If not (and I would guess so, at least for view), then I would consider putting a comment here explaining that a bit.
Same goes for view
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So does type actually support anything that can go into Model body, or is it a subset?
I'm only looking at this from the point of view of Prisma grammar and type
and view
are separate blocks. They are not subsets of model in any way.
You can however, use composite types (type
block) in models by using them as field types e.g.:
model MyModel {
id String @id
someType SomeType
}
type SomeType {
name String
age Int
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some comments to both view and type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i meant in the sense that their ast/parser is subset of model's
Adds support for
view
andtype
blocks by reusing themodel
parser.