persistent-0.4.1: Type-safe, non-relational, multi-backend persistence.

Database.Persist.TH

Description

This module provides utilities for creating backends. Regular users do not need to use this module.

Synopsis

Documentation

mkPersist :: [EntityDef] -> Q [Dec]Source

Create data types and appropriate PersistEntity instances for the given EntityDefs. Works well with the persist quasi-quoter.

share :: [[EntityDef] -> Q [Dec]] -> [EntityDef] -> Q [Dec]Source

share2 :: ([EntityDef] -> Q [Dec]) -> ([EntityDef] -> Q [Dec]) -> [EntityDef] -> Q [Dec]Source

derivePersistField :: String -> Q [Dec]Source

Automatically creates a valid PersistField instance for any datatype that has valid Show and Read instances. Can be very convenient for Enum types.