Skip to content

field can't be named model #391

@he-la

Description

@he-la

Description and expected behavior
Create a model with a field named model:

model MyModel {
  model  String
}

npx zenstack generate errors with

Validation errors:
line 548: Expecting: expecting at least one iteration which starts with one of these possible Token sequences::
  <[TRIPLE_SLASH_COMMENT] ,[ID] ,[in] ,[@@]>
but found: 'model' []
line 548: Expecting: one of these possible Token sequences:
  1. [ID]
  2. [in]
but found: 'String' []
line 548: Expecting token of type '{' but found `String`. []
line 548: Expecting token of type 'EOF' but found `String`. []

Environment (please complete the following information):

  • ZenStack version: 1.0.0-alpha.113
  • Prisma version: 4.11.0
  • Database type: PostgreSQL

Additional context
Yup, I actually have a legit usecase for a field named model. Don't ask...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions