![]() The name of the index in the underlying database (Prisma generates an index name that respects identifier length limits if you do not specify a name. The name that Prisma Client will expose for the argument covering all fields, e.g. The underlying ID field name is always _id, and must be mapped with be defined on any scalar field ( String, Int, enum) unless you want to use ObjectId in your databaseĪnnotate your field with list of field names - for example, Remarks GeneralĬan be annotated with a value that uses functions to auto-generate an ID:Ĭan be defined on any scalar field ( String, Int, enum)Ĭorresponding database type: Any valid BSON type, except arrays ![]() Note: The leading underscore in a signature means the argument name can be omitted. Arguments in attributes are always named, but in most cases the argument name can be omitted. Field attributes are prefixed with Block attributes are prefixed with attributes take arguments.There are two ways to add attributes to your data model: Relation fields are listed after scalar fields.Įxamples A model named User with two scalar fieldsĪttributes modify the behavior of a field or block (e.g. In version 2.3.0 and later, introspection lists model fields same order as the corresponding columns in the database.Note: You can use the attribute to map a model (for example, User) to a table with a different name that does not match model naming conventions (for example, users). ![]() You can find the reserved words here and here.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |