groundhog-th-0.7.0: Type-safe datatype-database mapping library.

Safe HaskellNone
LanguageHaskell98

Database.Groundhog.TH.Settings

Documentation

data THEmbeddedDef Source

Constructors

THEmbeddedDef 

Fields

thEmbeddedName :: Name
 
thEmbeddedConstructorName :: Name
 
thDbEmbeddedName :: String

It is used only to set polymorphic part of name of its container

thEmbeddedTypeParams :: [TyVarBndr]
 
thEmbeddedFields :: [THFieldDef]
 

data THPrimitiveDef Source

Constructors

THPrimitiveDef 

Fields

thPrimitiveName :: Name
 
thPrimitiveDbName :: String

It is used only to set polymorphic part of name of its container

thPrimitiveStringEnumRepresentation :: Bool

Store in database as string using Show/Read instances (True) or as integer using Enum instance (False).

data THUniqueDef Source

Constructors

THUniqueDef 

Fields

thUniqueName :: String
 
thUniqueType :: UniqueType
 
thUniqueFields :: [Either String String]

Either name of field, i.e, thFieldName, or expression

data THUniqueKeyDef Source

Constructors

THUniqueKeyDef 

Fields

thUniqueKeyName :: String
 
thUniqueKeyPhantomName :: String
 
thUniqueKeyConstrName :: String
 
thUniqueKeyDbName :: String

It is used only to set polymorphic part of name of its container | It should repeat fields from THUniqueDef but it may give different settings for them. It is done to allow foreign key fields to be different from parent fields of the entity. These fields are used for creating a the key constructor and instances for it. For example, it can have a default value, or even a different type (INT8 may reference INT4).

thUniqueKeyFields :: [THFieldDef]
 
thUniqueKeyMakeEmbedded :: Bool

If True, make it an instance of Embedded

thUniqueKeyIsDef :: Bool
 

data PSEmbeddedDef Source

Constructors

PSEmbeddedDef 

Fields

psEmbeddedName :: String
 
psDbEmbeddedName :: Maybe String

It is used only to set polymorphic part of name of its container

psEmbeddedFields :: Maybe [PSFieldDef String]
 

data PSPrimitiveDef Source

Constructors

PSPrimitiveDef 

Fields

psPrimitiveName :: String
 
psPrimitiveDbName :: Maybe String

It is used only to set polymorphic part of name of its container

psPrimitiveStringEnumRepresentation :: Maybe Bool

Store in database as string using Show/Read instances (True) or as integer using Enum instance (False).