Safe Haskell | None |
---|---|
Language | Haskell2010 |
Database.Persist.EntityDef.Internal
Description
The EntityDef
type, fields, and constructor are exported from this
module. Breaking changes to the EntityDef
type are not reflected in
the major version of the API. Please import from
Database.Persist.EntityDef instead.
If you need this module, please file a GitHub issue why.
Since: 2.13.0.0
Synopsis
- data EntityDef = EntityDef {
- entityHaskell :: !EntityNameHS
- entityDB :: !EntityNameDB
- entityId :: !EntityIdDef
- entityAttrs :: ![Attr]
- entityFields :: ![FieldDef]
- entityUniques :: ![UniqueDef]
- entityForeigns :: ![ForeignDef]
- entityDerives :: ![Text]
- entityExtra :: !(Map Text [ExtraLine])
- entitySum :: !Bool
- entityComments :: !(Maybe Text)
- entityPrimary :: EntityDef -> Maybe CompositeDef
- entitiesPrimary :: EntityDef -> NonEmpty FieldDef
- keyAndEntityFields :: EntityDef -> NonEmpty FieldDef
- toEmbedEntityDef :: EntityDef -> EmbedEntityDef
- data EntityIdDef
Documentation
An EntityDef
represents the information that persistent
knows
about an Entity. It uses this information to generate the Haskell
datatype, the SQL migrations, and other relevant conversions.
Constructors
EntityDef | |
Fields
|
Instances
Eq EntityDef Source # | |
Ord EntityDef Source # | |
Read EntityDef Source # | |
Show EntityDef Source # | |
Lift EntityDef Source # | |
entitiesPrimary :: EntityDef -> NonEmpty FieldDef Source #
Return the [
for the entity keys.FieldDef
]
data EntityIdDef Source #
The definition for the entity's primary key ID.
Since: 2.13.0.0
Constructors
EntityIdField !FieldDef | The entity has a single key column, and it is a surrogate key - that
is, you can't go from Since: 2.13.0.0 |
EntityIdNaturalKey !CompositeDef | The entity has a natural key. This means you can write A natural key can have one or more columns. Since: 2.13.0.0 |
Instances
Eq EntityIdDef Source # | |
Defined in Database.Persist.Types.Base | |
Ord EntityIdDef Source # | |
Defined in Database.Persist.Types.Base Methods compare :: EntityIdDef -> EntityIdDef -> Ordering # (<) :: EntityIdDef -> EntityIdDef -> Bool # (<=) :: EntityIdDef -> EntityIdDef -> Bool # (>) :: EntityIdDef -> EntityIdDef -> Bool # (>=) :: EntityIdDef -> EntityIdDef -> Bool # max :: EntityIdDef -> EntityIdDef -> EntityIdDef # min :: EntityIdDef -> EntityIdDef -> EntityIdDef # | |
Read EntityIdDef Source # | |
Defined in Database.Persist.Types.Base Methods readsPrec :: Int -> ReadS EntityIdDef # readList :: ReadS [EntityIdDef] # readPrec :: ReadPrec EntityIdDef # readListPrec :: ReadPrec [EntityIdDef] # | |
Show EntityIdDef Source # | |
Defined in Database.Persist.Types.Base Methods showsPrec :: Int -> EntityIdDef -> ShowS # show :: EntityIdDef -> String # showList :: [EntityIdDef] -> ShowS # | |
Lift EntityIdDef Source # | |
Defined in Database.Persist.Types.Base |