Skip to content
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

Add support for view and type blocks in Prisma schema #2176

Closed
infomiho opened this issue Jul 11, 2024 · 1 comment
Closed

Add support for view and type blocks in Prisma schema #2176

infomiho opened this issue Jul 11, 2024 · 1 comment
Labels
enhancement New feature or request prisma

Comments

@infomiho
Copy link
Contributor

infomiho commented Jul 11, 2024

In the Prisma grammar, the model and the view and type blocks are the same thing, they just differ in a keyword: https://github.com/prisma/prisma-engines/blob/main/psl/schema-ast/src/parser/datamodel.pest#L30

We can easily add support for the view and type blocks by reusing the model parser.

Something like this:

model :: Parser Model
model = makeModelLikeParser "model"

view :: Parser View
view = makeModelLikeParser "view"

type :: Parser Type
type = makeModelLikeParser "type"
@infomiho infomiho added enhancement New feature or request prisma labels Jul 11, 2024
@infomiho
Copy link
Contributor Author

Completed by #2179

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request prisma
Projects
None yet
Development

No branches or pull requests

1 participant