A FieldDef represents the inormation that persistent knows about
a field of a datatype. This includes information used to parse the field
out of the database and what the field corresponds to.
Constructors
FieldDeffieldHaskell :: !FieldNameHSThe name of the field. Note that this does not corresponds to the record labels generated for the particular entity - record labels are generated with the type name prefixed to the field, so a FieldDef that contains a
FieldNameHS "name"for a typeUserwill have a record fielduserName.fieldDB :: !FieldNameDBThe name of the field in the database. For SQL databases, this corresponds to the column name.
fieldType :: !FieldTypeThe type of the field in Haskell.
fieldSqlType :: !SqlTypeThe type of the field in a SQL database.
fieldAttrs :: ![FieldAttr]User annotations for a field. These are provided with the
!operator.fieldStrict :: !BoolfieldReference :: !ReferenceDeffieldCascade :: !FieldCascadeDefines how operations on the field cascade on to the referenced tables. This doesn't have any meaning if the fieldReference is set to NoReference or SelfReference. The cascade option here should be the same as the one obtained in the fieldReference.
fieldComments :: !Maybe TextOptional comments for a
Field.fieldGenerated :: !Maybe TextWhether or not the field is a
GENERATEDcolumn, and additionally the expression to use for generation.fieldIsImplicitIdColumn :: !Bool
Instances5Eq, Ord, Read, Show, Lift
Eq FieldDefDefined in persistent-2.14.6.3 · Database.Persist.Types.BaseOrd FieldDefDefined in persistent-2.14.6.3 · Database.Persist.Types.BaseRead FieldDefDefined in persistent-2.14.6.3 · Database.Persist.Types.BaseShow FieldDefDefined in persistent-2.14.6.3 · Database.Persist.Types.BaseLift FieldDefDefined in persistent-2.14.6.3 · Database.Persist.Types.Base