on dev help sign in
Public & DBof type families
commit3d762ab61903cfcda3f7ea48046376c7fdd2ba33 authorEitan Chatav <eitan.chatav@gmail.com> dateMon 3 Dec 2018, 23:45 (8 years ago) parenta00c12b
1 file changed+7
squeal-postgresql/src/Squeal/PostgreSQL/Schema.hs+7
squeal-postgresql/src/Squeal/PostgreSQL/Schema.hs+7
@@ -55,7 +55,9 @@ module Squeal.PostgreSQL.Schema
5555 , SchemumType (..)
5656 , SchemaType
5757 , SchemasType
58+ , Public
5859 , DBType
60+ , DBof
5961 -- * Constraints
6062 , (:=>)
6163 , ColumnConstraint (..)
@@ -686,8 +688,13 @@ type SchemaType = [(Symbol,SchemumType)]
686688
687689type SchemasType = [(Symbol,SchemaType)]
688690
691+type family Public (schema :: SchemaType) :: SchemasType
692+ where Public schema = '["public" ::: schema]
693+
689694type DBType = (FromType,SchemasType)
690695
696+type family DBof :: SchemasType -> DBType where DBof = '(,) '[]
697+
691698-- | `IsPGlabel` looks very much like the `IsLabel` class. Whereas
692699-- the overloaded label, `fromLabel` is used for column references,
693700-- `label`s are used for enum terms. A `label` is called with