persistent-2.14.6.3: Type-safe, multi-backend data serialization.
Safe HaskellNone
LanguageHaskell2010

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

Documentation

data EntityDef Source #

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

Instances details
Read EntityDef Source # 
Instance details

Defined in Database.Persist.Types.Base

Methods

readsPrec :: Int -> ReadS EntityDef

readList :: ReadS [EntityDef]

readPrec :: ReadPrec EntityDef

readListPrec :: ReadPrec [EntityDef]

Show EntityDef Source # 
Instance details

Defined in Database.Persist.Types.Base

Methods

showsPrec :: Int -> EntityDef -> ShowS

show :: EntityDef -> String

showList :: [EntityDef] -> ShowS

Eq EntityDef Source # 
Instance details

Defined in Database.Persist.Types.Base

Methods

(==) :: EntityDef -> EntityDef -> Bool

(/=) :: EntityDef -> EntityDef -> Bool

Ord EntityDef Source # 
Instance details

Defined in Database.Persist.Types.Base

Methods

compare :: EntityDef -> EntityDef -> Ordering

(<) :: EntityDef -> EntityDef -> Bool

(<=) :: EntityDef -> EntityDef -> Bool

(>) :: EntityDef -> EntityDef -> Bool

(>=) :: EntityDef -> EntityDef -> Bool

max :: EntityDef -> EntityDef -> EntityDef

min :: EntityDef -> EntityDef -> EntityDef

Lift EntityDef Source # 
Instance details

Defined in Database.Persist.Types.Base

Methods

lift :: Quote m => EntityDef -> m Exp

liftTyped :: forall (m :: Type -> Type). Quote m => EntityDef -> Code m EntityDef

entitiesPrimary :: EntityDef -> NonEmpty FieldDef Source #

Return the [FieldDef] for the entity keys.

keyAndEntityFields :: EntityDef -> NonEmpty FieldDef Source #

Returns a NonEmpty list of FieldDef that correspond with the key columns for an EntityDef.

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 rec -> Key rec.

Since: 2.13.0.0

EntityIdNaturalKey !CompositeDef

The entity has a natural key. This means you can write rec -> Key rec because all the key fields are present on the datatype.

A natural key can have one or more columns.

Since: 2.13.0.0

Instances

Instances details
Read EntityIdDef Source # 
Instance details

Defined in Database.Persist.Types.Base

Methods

readsPrec :: Int -> ReadS EntityIdDef

readList :: ReadS [EntityIdDef]

readPrec :: ReadPrec EntityIdDef

readListPrec :: ReadPrec [EntityIdDef]

Show EntityIdDef Source # 
Instance details

Defined in Database.Persist.Types.Base

Methods

showsPrec :: Int -> EntityIdDef -> ShowS

show :: EntityIdDef -> String

showList :: [EntityIdDef] -> ShowS

Eq EntityIdDef Source # 
Instance details

Defined in Database.Persist.Types.Base

Methods

(==) :: EntityIdDef -> EntityIdDef -> Bool

(/=) :: EntityIdDef -> EntityIdDef -> Bool

Ord EntityIdDef Source # 
Instance details

Defined in Database.Persist.Types.Base

Lift EntityIdDef Source # 
Instance details

Defined in Database.Persist.Types.Base

Methods

lift :: Quote m => EntityIdDef -> m Exp

liftTyped :: forall (m :: Type -> Type). Quote m => EntityIdDef -> Code m EntityIdDef