@@ -73,6 +73,10 @@ import Squeal.PostgreSQL.Alias
73import Squeal.PostgreSQL.List
73import Squeal.PostgreSQL.List
74import Squeal.PostgreSQL.Schema
74import Squeal.PostgreSQL.Schema
77+-- >>> import Squeal.PostgreSQL
78+-- >>> import Data.Text (Text)
76{- | The `PG` type family embeds a subset of Haskell types
80{- | The `PG` type family embeds a subset of Haskell types
77as Postgres types. As an open type family, `PG` is extensible.
81as Postgres types. As an open type family, `PG` is extensible.
@@ -115,8 +119,8 @@ type instance PG Value = 'PGjson
115Haskell enum type.
119Haskell enum type.
117>>> data Schwarma = Beef | Lamb | Chicken deriving GHC.Generic
121>>> data Schwarma = Beef | Lamb | Chicken deriving GHC.Generic
118−>>> instance Generic Schwarma
122+>>> instance SOP.Generic Schwarma
119−>>> instance HasDatatypeInfo Schwarma
123+>>> instance SOP.HasDatatypeInfo Schwarma
120>>> :kind! LabelsPG Schwarma
124>>> :kind! LabelsPG Schwarma
121LabelsPG Schwarma :: [Type.ConstructorName]
125LabelsPG Schwarma :: [Type.ConstructorName]
122= '["Beef", "Lamb", "Chicken"]
126= '["Beef", "Lamb", "Chicken"]
@@ -132,8 +136,8 @@ type family LabelsPG (hask :: Type) :: [Type.ConstructorName] where
132have the `Generic` and `HasDatatypeInfo` instances;
136have the `Generic` and `HasDatatypeInfo` instances;
134>>> data Person = Person { name :: Text, age :: Int32 } deriving GHC.Generic
138>>> data Person = Person { name :: Text, age :: Int32 } deriving GHC.Generic
135−>>> instance Generic Person
139+>>> instance SOP.Generic Person
136−>>> instance HasDatatypeInfo Person
140+>>> instance SOP.HasDatatypeInfo Person
137>>> :kind! RowPG Person
141>>> :kind! RowPG Person
138RowPG Person :: [(Symbol, NullityType)]
142RowPG Person :: [(Symbol, NullityType)]
139= '["name" ::: 'NotNull 'PGtext, "age" ::: 'NotNull 'PGint4]
143= '["name" ::: 'NotNull 'PGtext, "age" ::: 'NotNull 'PGint4]
@@ -180,8 +184,8 @@ type family ColumnsOf (record :: [(Symbol, Type)]) :: ColumnsType where
180have the `Generic` and `HasDatatypeInfo` instances;
184have the `Generic` and `HasDatatypeInfo` instances;
182>>> data Person = Person { name :: Text, age :: Int32 } deriving GHC.Generic
186>>> data Person = Person { name :: Text, age :: Int32 } deriving GHC.Generic
183−>>> instance Generic Person
187+>>> instance SOP.Generic Person
184−>>> instance HasDatatypeInfo Person
188+>>> instance SOP.HasDatatypeInfo Person
185>>> :kind! Entity Person
189>>> :kind! Entity Person
186Entity Person :: [(Symbol, (ColumnConstraint, NullityType))]
190Entity Person :: [(Symbol, (ColumnConstraint, NullityType))]
187= '["name" ::: ('NoDef :=> 'NotNull 'PGtext),
191= '["name" ::: ('NoDef :=> 'NotNull 'PGtext),