An Entity stores the following information about the structure of a database table:
Its name
Its primary key
The fields it contains
Example
data ExampleEntity = E
{ key :: Key
, field1 :: Int
, field2 :: Bool
}
deriving stock (Eq, Show, Generic)
deriving anyclass (FromRow, ToRow)
deriving Entity
via (GenericEntity '[TableName "entities"] ExampleEntity)When using the functions provided by this library, you will sometimes need to be explicit about the Entity you are referring to.
Instances2Entity
Entity a => Entity (UpdateRow a)Defined in pg-entity-0.0.4.4 · Database.PostgreSQL.Entity.Types(EntityOptions t, GetTableName (Rep e), GetFields (Rep e)) => Entity (GenericEntity t e)Defined in pg-entity-0.0.4.4 · Database.PostgreSQL.Entity.Types