postgresql-query-2.3.0: Sql interpolating quasiquote plus some kind of primitive ORM using it

Safe HaskellNone
LanguageHaskell2010

Database.PostgreSQL.Query.TH.Enum

Description

Helps to map enum types to postgresql enums.

Synopsis

Documentation

derivePgEnum Source

Arguments

:: InflectorFunc

mapping function from haskell constructor name to PG enum label

-> Name

type to derive instances for

-> DecsQ 

derives FromField and ToField instances for a sum-type enum like

data Entity = Red | Green | Blue

type InflectorFunc = String -> String Source

Function to transform constructor name into its PG enum conterpart.