on dev help sign in
Public & DBof type families
3d762abEitan Chatav
squeal-postgresql/src/Squeal/PostgreSQL/Schema.hs+7
@@ -55,7 +55,9 @@ module Squeal.PostgreSQL.Schema
55 , SchemumType (..)
55 , SchemumType (..)
56 , SchemaType
56 , SchemaType
57 , SchemasType
57 , SchemasType
58+ , Public
58 , DBType
59 , DBType
60+ , DBof
59 -- * Constraints
61 -- * Constraints
60 , (:=>)
62 , (:=>)
61 , ColumnConstraint (..)
63 , ColumnConstraint (..)
@@ -686,8 +688,13 @@ type SchemaType = [(Symbol,SchemumType)]
686
688
687type SchemasType = [(Symbol,SchemaType)]
689type SchemasType = [(Symbol,SchemaType)]
688
690
691+type family Public (schema :: SchemaType) :: SchemasType
692+ where Public schema = '["public" ::: schema]
693+
689type DBType = (FromType,SchemasType)
694type DBType = (FromType,SchemasType)
690
695
696+type family DBof :: SchemasType -> DBType where DBof = '(,) '[]
697+
691-- | `IsPGlabel` looks very much like the `IsLabel` class. Whereas
698-- | `IsPGlabel` looks very much like the `IsLabel` class. Whereas
692-- the overloaded label, `fromLabel` is used for column references,
699-- the overloaded label, `fromLabel` is used for column references,
693-- `label`s are used for enum terms. A `label` is called with
700-- `label`s are used for enum terms. A `label` is called with