Type-safe, non-relational, multi-backend persistence.

Version on this page:2.5.4@rev:4
LTS Haskell 13.29:2.5.4@rev:4
Stackage Nightly 2019-07-21:2.6.0@rev:1
Latest on Hackage:2.7.2

See all snapshots persistent-template appears in

MIT licensed by Michael Snoyman

Module documentation for 2.5.4

This version can be pinned in stack with:persistent-template-2.5.4@sha256:216ff6f3578c10c3bb11c03744d7b9e63df841dbaaaecc2928b5e25bd924cb23,2272


Provides Template Haskell helpers for persistent. For more information, see the chapter in the Yesod book.

code organization

The TH.hs module contains code generators. persistent-template uses EntityDefs that it gets from the quasi-quoter. The quasi-quoter is in persistent Quasi.hs Similarly mant of the types come from the persistent library



  • Slight improvement to the error message when a Persistent field can’t be parsed from database results


  • Exposed parseReferences to allow custom QuasiQuoters


  • Fix incorrect ToJSON/FromJSON instance generation for generic backends

Allow non-null self-references in a list

  • Allow composite Primary keys for tables that contain nullable fields.
  • Support foreign keys to non-integer ids

  • fix GHC 7.8 bug when a field name is “type”

  • fix a bad Eq instance /= definition for Key when mpsGenetric=True

  • workaround TH bug in GHC 7.10


  • read/write typeclass split


  • aeson 0.11
  • transformers 0.5


support http-api-data for url serialization

By default explicitly use Int64 for foreign key references. This avoids confusion on a 32 bit system.

Support foreign key references to composite primary keys

Support for monad-control 1.0

comments powered byDisqus