@@ -67,6 +67,23 @@ import GHC.Generics
67-- in a single row of the query result. Otherwise, a 'ConversionFailed'
67-- in a single row of the query result. Otherwise, a 'ConversionFailed'
68-- exception will be thrown.
68-- exception will be thrown.
70+-- You can also derive 'FromRow' for your data type using GHC generics, like
74+-- \{-# LANGUAGE DeriveAnyClass \#-}
75+-- \{-# LANGUAGE DeriveGeneric \#-}
77+-- import "GHC.Generics" ('GHC.Generics.Generic')
78+-- import "Database.PostgreSQL.Simple" ('FromRow')
80+-- data User = User { name :: String, fileQuota :: Int }
81+-- deriving ('GHC.Generics.Generic', 'FromRow')
84+-- Note that this only works for product types (e.g. records) and does not
85+-- support sum types or recursive types.
70-- Note that 'field' evaluates its result to WHNF, so the caveats listed in
87-- Note that 'field' evaluates its result to WHNF, so the caveats listed in
71-- mysql-simple and very early versions of postgresql-simple no longer apply.
88-- mysql-simple and very early versions of postgresql-simple no longer apply.
72-- Instead, look at the caveats associated with user-defined implementations
89-- Instead, look at the caveats associated with user-defined implementations