| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Rel8.Internal.Type.Composite
Synopsis
- newtype Composite a = Composite a
- class (DBType a, HKDable a) => DBComposite a where
- compose :: DBComposite a => HKD a Expr -> Expr a
- decompose :: DBComposite a => Expr a -> HKD a Expr
Documentation
A deriving-via helper type for column types that store a Haskell product type in a single Postgres column using a Postgres composite type.
Note that this must map to a specific extant type in your database's schema
(created with CREATE TYPE). Use DBComposite to specify the name of this
Postgres type and the names of the individual fields (for projecting with
decompose).
Constructors
| Composite a |
Instances
| DBComposite a => DBType (Composite a) Source # | |
Defined in Rel8.Internal.Type.Composite Methods | |
| (DBComposite a, EqTable (HKD a Expr)) => DBEq (Composite a) Source # | |
Defined in Rel8.Internal.Type.Composite | |
| (DBComposite a, OrdTable (HKD a Expr)) => DBMax (Composite a) Source # | |
Defined in Rel8.Internal.Type.Composite | |
| (DBComposite a, OrdTable (HKD a Expr)) => DBMin (Composite a) Source # | |
Defined in Rel8.Internal.Type.Composite | |
| (DBComposite a, OrdTable (HKD a Expr)) => DBOrd (Composite a) Source # | |
Defined in Rel8.Internal.Type.Composite | |
class (DBType a, HKDable a) => DBComposite a where Source #
DBComposite is used to associate composite type metadata with a Haskell
type.
Methods
compositeFields :: HKD a Name Source #
The names of all fields in the composite type that a maps to.
compositeTypeName :: QualifiedName Source #
The name of the composite type that a maps to.