@@ -17,26 +17,13 @@ import Rel8.Schema.Field ( Field )
1717import qualified Rel8.Schema.Kind as K
1818
1919
20−type Default :: Type -> Type
21−data Default a
22−
23−
24−type GetNecessity :: Type -> Necessity
25−type family GetNecessity a where
26− GetNecessity (Default _) = 'Optional
27− GetNecessity _ = 'Required
28−
29−
30−type UnwrapDefault :: Type -> Type
31−type family UnwrapDefault a where
32− UnwrapDefault (Default a) = a
33− UnwrapDefault a = a
34−
35−
3620-- | The @Column@ type family should be used to indicate which fields of your
3721-- data types are single columns in queries. This type family has special
3822-- support when a query is executed, allowing you to use a single data type for
3923-- both query data and rows decoded to Haskell.
4024type Column :: K.Context -> Type -> Type
41−type Column context a =
42− Field context (GetNecessity a) (UnwrapDefault a)
25+type Column context a = Field context 'Required a
26+
27+
28+type Default :: K.Context -> Type -> Type
29+type Default context a = Field context 'Optional a