@@ -115,9 +115,10 @@ module Squeal.PostgreSQL.Schema
115 , Jsonb (..)
115 , Jsonb (..)
116 , Composite (..)
116 , Composite (..)
117 , Enumerated (..)
117 , Enumerated (..)
118− -- , EnumFrom
119+ , EnumFrom
119 , LabelsFrom
120 , LabelsFrom
120− -- , CompositeFrom
121+ , CompositeFrom
121 , PGFieldsFrom
122 , PGFieldsFrom
123 , PGFieldOf
124 , PGFieldOf
@@ -749,8 +750,8 @@ newtype Enumerated enum = Enumerated {getEnumerated :: enum}
749-- >>> :kind! EnumFrom Schwarma
750-- >>> :kind! EnumFrom Schwarma
750-- EnumFrom Schwarma :: PGType
751-- EnumFrom Schwarma :: PGType
751-- = 'PGenum '["Beef", "Lamb", "Chicken"]
752-- = 'PGenum '["Beef", "Lamb", "Chicken"]
752−-- type family EnumFrom (hask :: Type) :: PGType where
753+type family EnumFrom (hask :: Type) :: PGType where
753−-- EnumFrom hask = 'PGenum (LabelsFrom hask)
754+ EnumFrom hask = PG (Enumerated hask)
755-- | The `LabelsFrom` type family calculates the constructors of a
756-- | The `LabelsFrom` type family calculates the constructors of a
756-- Haskell enum type.
757-- Haskell enum type.
@@ -777,7 +778,7 @@ type family LabelsFrom (hask :: Type) :: [Type.ConstructorName] where
777-- CompositeFrom Row :: PGType
778-- CompositeFrom Row :: PGType
778-- = 'PGcomposite '["a" ::: 'Null 'PGint2, "b" ::: 'Null 'PGtimestamp]
779-- = 'PGcomposite '["a" ::: 'Null 'PGint2, "b" ::: 'Null 'PGtimestamp]
779type family CompositeFrom (hask :: Type) :: PGType where
780type family CompositeFrom (hask :: Type) :: PGType where
780− CompositeFrom hask = 'PGcomposite (PGFieldsFrom hask)
781+ CompositeFrom hask = PG (Composite hask)
782type family PGFieldsFrom (hask :: Type) :: RowType where
783type family PGFieldsFrom (hask :: Type) :: RowType where
783 PGFieldsFrom hask = RowOf (RecordCodeOf hask)
784 PGFieldsFrom hask = RowOf (RecordCodeOf hask)