Generic deserialization of PostgreSQL rows based on column names

Latest on Hackage:0.1.0

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow to host generated Haddocks.

BSD3 licensed by Moritz Kiefer


Travis Hackage

Library for deserializing rows in postgresql-simple (or any other library that uses FromRow) based on column names instead of the positions of columns.


{-# LANGUAGE DeriveGeneric #-}
import           Database.PostgreSQL.Simple.FromRow
import           Database.PostgreSQL.Simple.FromRow.Named
import qualified GHC.Generics as GHC
import           Generics.SOP

data Foobar = Foobar
  { foo :: !String
  , bar :: !Int
  } deriving (Show, Eq, Ord, GHC.Generic)

instance Generic Foobar

instance HasDatatypeInfo Foobar

instance FromRow Foobar where
  fromRow = gFromRow



  • Initial release.
comments powered byDisqus