on f47423e help sign in
rel8/src/Rel8/Schema/Spec.hs
34 lines 690 B history raw
1{-# language FlexibleContexts #-}
2{-# language MonoLocalBinds #-}
3{-# language StandaloneKindSignatures #-}
5module Rel8.Schema.Spec
6 ( Spec( Spec, labels, info, nullity )
7 , specification
8 )
9where
11-- base
12import Data.Kind ( Type )
13import Prelude
15-- rel8
16import Rel8.Schema.Null ( Nullity, Sql, Unnullify, nullable )
17import Rel8.Type ( DBType, typeInformation )
18import Rel8.Type.Information ( TypeInformation )
21type Spec :: Type -> Type
22data Spec a = Spec
23 { labels :: [String]
24 , info :: TypeInformation (Unnullify a)
25 , nullity :: Nullity a
26 }
29specification :: Sql DBType a => Spec a
30specification = Spec
31 { labels = []
32 , info = typeInformation
33 , nullity = nullable
34 }