| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Rel8.Internal.Type.Enum
Documentation
A deriving-via helper type for column types that store an "enum" type
(in Haskell terms, a sum type where all constructors are nullary) using a
Postgres enum type.
Note that this should map to a specific type in your database's schema
(explicitly created with CREATE TYPE ... AS ENUM). Use DBEnum to
specify the name of this Postgres type and the names of the individual
values. If left unspecified, the names of the values of the Postgres
enum are assumed to match exactly exactly the names of the constructors
of the Haskell type (up to and including case sensitivity).
Constructors
| Enum a |
Instances
| DBEnum a => DBType (Enum a) Source # | |
Defined in Rel8.Internal.Type.Enum Methods typeInformation :: TypeInformation (Enum a) Source # | |
| DBEnum a => DBEq (Enum a) Source # | |
Defined in Rel8.Internal.Type.Enum | |
| DBEnum a => DBMax (Enum a) Source # | |
Defined in Rel8.Internal.Type.Enum | |
| DBEnum a => DBMin (Enum a) Source # | |
Defined in Rel8.Internal.Type.Enum | |
| DBEnum a => DBOrd (Enum a) Source # | |
Defined in Rel8.Internal.Type.Enum | |
class DBType a => DBEnum a where Source #
DBEnum contains the necessary metadata to describe a PostgreSQL enum type.
Minimal complete definition
Methods
enumValue :: a -> String Source #
Map Haskell values to the corresponding element of the enum type. The
default implementation of this method will use the exact name of the
Haskell constructors.
enumTypeName :: QualifiedName Source #
The name of the PostgreSQL enum type that a maps to.
List of all possible values of the enum type.