@@ -46,6 +46,7 @@ module Squeal.PostgreSQL.Schema
46 , TableType
46 , TableType
47 -- * Schema
47 -- * Schema
48 , SchemumType (..)
48 , SchemumType (..)
49 , SchemaType
50 , SchemaType
50 -- * Constraints
51 -- * Constraints
@@ -651,6 +652,11 @@ data SchemumType
651 | View RowType
652 | View RowType
652 | Typedef PGType
653 | Typedef PGType
655+type family SchemumToType (schemum :: SchemumType) :: PGType where
656+ SchemumToType ('Typedef ty) = ty
657+ SchemumToType ('Table table) = 'PGcomposite (TableToRow table)
658+ SchemumToType ('View view) = 'PGcomposite view
654-- | The schema of a database consists of a list of aliased,
660-- | The schema of a database consists of a list of aliased,
655-- user-defined `SchemumType`s.
661-- user-defined `SchemumType`s.
656type SchemaType = [(Symbol,SchemumType)]
662type SchemaType = [(Symbol,SchemumType)]