on dev help sign in
docs
commit02bbfc66477d138c6fda53ebeff602c58b1cce46 authorEitan Chatav <eitan@Eitans-MacBook-Pro.local> dateSat 2 Mar 2019, 11:06 (8 years ago) parent533eae9
1 file changed+9
squeal-postgresql/src/Squeal/PostgreSQL/Definition.hs+9
squeal-postgresql/src/Squeal/PostgreSQL/Definition.hs+9
@@ -982,6 +982,15 @@ createTypeCompositeFrom ty = createTypeComposite ty
982982 :: NP (Aliased (TypeExpression schemas)) (RowPG hask))
983983
984984{-|
985+`createDomain` creates a new domain. A domain is essentially a data type
986+with constraints (restrictions on the allowed set of values).
987+
988+Domains are useful for abstracting common constraints on fields
989+into a single location for maintenance. For example, several tables might
990+contain email address columns, all requiring the same `check` constraint
991+to verify the address syntax. Define a domain rather than setting up
992+each table's constraint individually.
993+
985994>>> :{
986995let
987996 createPositive :: Definition (Public '[]) (Public '["positive" ::: 'Typedef 'PGfloat4])