Skip to content

Field can't be named view #735

@iksemot

Description

@iksemot

Description and expected behavior

Similar to #391, zenstack generate breaks if the field name in the model is named view

Given model like:

model MyModel {
  view String
}

Then npx zenstack generate gives:

Validation errors:
line 762: Expecting token of type '}' but found `view`. [view]
line 762: Expecting: one of these possible Token sequences:
  1. [ID]
  2. [model]
  3. [enum]
  4. [attribute]
  5. [datasource]
  6. [plugin]
  7. [abstract]
  8. [in]
  9. [sort]
but found: 'String' [String]
line 762: Expecting token of type '{' but found `String`. [String]
line 762: Expecting token of type 'EOF' but found `String`. [String]

Environment (please complete the following information):

  • ZenStack version: 1.0.2
  • Prisma version: 5.3.1
  • Database type: Postgresql

Additional context

  • Prisma allows such field name.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions