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

[ bsd3, library, web ] [ Propose Tags ]

See README.md


[Skip to Readme]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0
Change log CHANGELOG.md
Dependencies base (>=4.9 && <5), bytestring (>=0.10 && <0.11), extra (>=1.5 && <1.6), generics-sop (>=0.3 && <0.4), mtl (>=2.2 && <2.3), postgresql-libpq (>=0.9 && <0.10), postgresql-simple (>=0.5 && <0.6), utf8-string [details]
License BSD-3-Clause
Copyright (C) 2017 Moritz Kiefer
Author Moritz Kiefer
Maintainer moritz.kiefer@purelyfunctional.org
Category Web
Home page https://github.com/cocreature/postgresql-named#readme
Source repo head: git clone https://github.com/cocreature/postgresql-named
Uploaded by cocreature at 2017-06-15T20:27:55Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 852 total (6 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

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