Skip to main content
Version: 3.0 Alpha

Enum

Enums are simple constructs that allow you to define a set of named values.

enum Role {
USER
ADMIN
}

They can be used to type model fields:

model User {
id Int @id
role Role @default(USER)
}

Enum field names are added to the global scope and are resolved without qualification. You need to make sure they don't collide with other global names.

Comments
Feel free to ask questions, give feedback, or report issues.

Don't Spam


You can edit/delete your comments by going directly to the discussion, clicking on the 'comments' link below