on 6c20afa help sign in
rel8/src/Rel8/Schema/Column.hs
29 lines 823 B history raw
1{-# language DataKinds #-}
2{-# language TypeFamilies #-}
3{-# language StandaloneKindSignatures #-}
5module Rel8.Schema.Column
6 ( Column, Default
7 )
8where
10-- base
11import Data.Kind ( Type )
12import Prelude ()
14-- rel8
15import Rel8.Kind.Necessity ( Necessity( Required, Optional ) )
16import Rel8.Schema.Field ( Field )
17import qualified Rel8.Schema.Kind as K
20-- | The @Column@ type family should be used to indicate which fields of your
21-- data types are single columns in queries. This type family has special
22-- support when a query is executed, allowing you to use a single data type for
23-- both query data and rows decoded to Haskell.
24type Column :: K.Context -> Type -> Type
25type Column context a = Field context 'Required a
28type Default :: K.Context -> Type -> Type
29type Default context a = Field context 'Optional a