postgresql-named: Generic deserialization of PostgreSQL rows based on column names

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

See README.md


[Skip to ReadMe]

Properties

Versions0.1.0, 0.1.0
Change logCHANGELOG.md
Dependenciesbase (>=4.9 && <5), bytestring (==0.10.*), extra (==1.5.*), generics-sop (==0.3.*), mtl (==2.2.*), postgresql-libpq (==0.9.*), postgresql-simple (==0.5.*), utf8-string [details]
LicenseBSD-3-Clause
Copyright(C) 2017 Moritz Kiefer
AuthorMoritz Kiefer
Maintainermoritz.kiefer@purelyfunctional.org
CategoryWeb
Home pagehttps://github.com/cocreature/postgresql-named#readme
Source repositoryhead: git clone https://github.com/cocreature/postgresql-named
UploadedThu Jun 15 20:27:41 UTC 2017 by cocreature

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees


Readme for postgresql-named-0.1.0

[back to package description]

postgresql-named

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.

Example

{-# 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