@@ -68,12 +68,16 @@ module Squeal.PostgreSQL.Schema
6868 -- * Generics
6969 , SameField
7070 , SameFields
71+ -- * PostgreSQL Constraints
72+ , (:=>)
73+ , ColumnConstraint (..)
7174 ) where
7275
7376import Control.DeepSeq
7477import Data.ByteString
7578import Data.Monoid
7679import Data.String
80+import Data.Type.Set
7781import Generics.SOP (AllZip)
7882import GHC.Generics (Generic)
7983import GHC.Exts
@@ -322,3 +326,10 @@ type family SameFields
322326 ('Type.Newtype _module _datatype ('Type.Record _constructor fields))
323327 columns
324328 = AllZip SameField fields columns
329+
330+type (:=>) constraints ty = '(AsSet constraints,ty)
331+
332+data ColumnConstraint
333+ = Default
334+ | Unique
335+ | References Symbol Symbol