A      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@NoneJ-Datatypes which can be converted directly to . The no-value parameter DbDescriptor db => Proxy dbF allows conversion depend the database details while keeping it pure. bRepresents all datatypes that map into several columns. Getting values for those columns is pure. Represents all datatypes that map into a single column. Getting value for that column might require monadic actions to access other tables. Represents everything which can be put into a database. This data can be stored in multiple columns and tables. To get value of those columns we might need to access another table. That is why the result type is monadic. ^Return name of the type. If it is polymorhic, the names of parameter types are separated with  symbol IConvert a value into something which can be stored in a database column. I Note that for complex datatypes it may insert them to return identifier Constructs a value from a 2. For complex datatypes it may query the database Description of value type JUsed to uniformly represent fields, constants and arithmetic expressions.  A value should be converted to  for usage in expressions Types which when converted to  are never NULL.  Consider the type Maybe (Maybe a)o. Now Nothing is stored as NULL, so we cannot distinguish between Just Nothing and Nothing which is a problem. 4 The purpose of this class is to ban the inner Maybe's. = Maybe this class can be removed when support for inner Maybe' s appears. .Constraint for use in arithmetic expressions. AH is not used to explicitly include only types supported by the library. ! TODO: consider replacement with A =Arithmetic expressions which can include fields and literals Avoid orphan instances. HA raw value which can be stored in any backend and can be marshalled to  and from a  . *The first argument is a flag which defines if the field names should be concatenated with the outer field name (False) or used as is which provides full control over table column names (True).  Value False should be the default value so that a datatype can be embedded without name conflict concern. The second argument list of field names and field types. ,BA DB data type. Naming attempts to reflect the underlying Haskell F datatypes, eg DbString instead of DbVarchar. Different databases may . have different translations for these types. ;HUnique name and list of the field names that form a unique combination.  Only fields of * types can be used in a unique definition CrPhantom constructors are made instances of this class. This class should be used only by Template Haskell codegen F Describes an entity constructor H%Number of the constructor in the ADT IConstructor name JAutokey name if any K&Parameter names with their named type L0Uniqueness constraints on the constructor fiels MDescribes an ADT. O Entity name. )entityName (entityDef v) == persistName v P<Named types of the instantiated polymorphic type parameters Q(List of entity constructors definitions RPEither error messages or migration queries with safety flag and execution order S,Datatype names and corresponding migrations WjA token which defines the DB type. For example, different monads working with Sqlite, return Sqlite type. X1Insert a new record to a database and return its  YTry to insert a record and return Right newkey. If there is a constraint violation for the given constraint, Left oldkey is returned I , where oldkey is an identifier of the record with the matching values. ZTry to insert a record and return Right newkey. If there is a constraint violation for any constraint, Left oldkey is returned  , where oldkey is an identifier of the record with the matching values. Note that if several constraints are violated, a key of an arbitrary matching record is returned. [eReplace a record with the given autogenerated key. Result is undefined if the record does not exist. \6Return a list of the records satisfying the condition ]iReturn a list of all records. Order is undefined. It is useful for datatypes with multiple constructors. ^ Fetch an entity from a database _2Fetch an entity from a database by its unique key `,Update the records satisfying the condition a,Remove the records satisfying the condition bERemove the record with given key. No-op if the record does not exist c7Count total number of records satisfying the condition d4Count total number of records with all constructors e Fetch projection of some fields fXCheck database schema and create migrations for the entity and the entities it contains gExecute raw query hExecute raw query with results lPType of the database default autoincremented key. For example, Sqlite has Int64 {-Any data that can be fetched from a database | It is like a A for many fields. Difflist is used for concatenation efficiency. } It is like B. However, we cannot use it for projections in all cases. For the  instances 1 expects entity id instead of the entity values. uIt can be used in expressions like a regular field. Note that the constructor should be specified for the condition.  For example, delete (AutoKeyField B* (undefined :: f v SomeConstructor) ==. k)  or -delete (AutoKeyField ==. k ||. SomeField ==. " DUPLICATE") VGeneralises data that can occur in expressions (so far there are Field and SubField). It is used to map field to column names. It can be either a column name for a regular field of non-embedded type or a list of this field and the outer fields in reverse order. Eg, fieldChain $ SomeField ~> Tuple2_0Selector may result in Right [("val0", DbString), ("some", DbEmbedded False [dbType "" , dbType True])]. F Function fieldChain can be simplified to f v c a -> [(String, DbType)]Q. Datatype Either is used for optimisation of the common case, eg Field v c Int. #Defines sort order of a result-set "Represents condition for a query. .A holder for DB type in backend-specific keys 3A phantom datatype to make instance head diffirent u (UniqueMarker, v) 3A phantom datatype to make instance head diffirent c (ConstructorMarker, v) 9Key marked with this type can have value for any backend  A holder for Unique constraints <Only instances of this class can be persisted in a database NThis type is used for typesafe manipulation of separate fields of datatype v.  Each constructor in + corresponds to its field in a datatype v. F It is parametrised by constructor phantom type and field value type. A unique identifier of a value stored in a database. This may be a primary key, a constraint or unique indices. The second parameter is the key description. oThis type is the default autoincremented key for the entity. If entity does not have such key, AutoKey v = (). -This type is the default key for the entity. +Returns a complete description of the type Marshalls value to a list of  ready for insert to a database &Constructs the value from the list of  VReturns constructor number and a list of uniques names and corresponding field values /Is internally used by FieldLike Field instance  We could avoid this function if class FieldLike allowed FieldLike Fields Data or FieldLike (Fields Data). However that would require additional extensions in user-space code 8Accesses fields of the embedded datatypes. For example, SomeField ==. ("abc", "def"() ||. SomeField ~> Tuple2_0Selector ==. "def" %Convert field to an arithmetic value   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefgkeep in cache query positional parameters hkeep in cache query positional parameters results processing function ijklmnopqrstuvwxyz{|}~CDEFGHIJKL  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~)('&%$#"!  {|}~pqrstuvwxyz,:9876543210/.-MNOPQ*+FGHIJKLCDE?@AB;<=>RSTVWXYZ[\]^_`abcdefghijklUmno?   )('&%$#"! *+,:9876543210/.-;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ CDEFGHIJKLNone TProduce the migrations but not execute them. Fails when an unsafe migration occurs. &Execute the migrations and log them. QExecute migrations and log them. Executes the unsafe migrations without warnings Pretty print the migrations DRun migrations and log them. Fails when an unsafe migration occurs. MRun migrations and log them. Executes the unsafe migrations without warnings No-op Prints the queries to stdout MJoins the migrations. The result is either all error messages or all queries LReturns only old elements, only new elements, and matched pairs (old, new).  The new ones exist only in datatype, the old are present only in DB, match is typically by name (the properties of the matched elements may differ). (MNcomputation to run first ?computation to run afterward (even if an exception was raised) computation to run first (acquire resource) computation to run last (release resource) computation to run in-between &&$MNNone_OPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~_OPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None+Instances of this type can be converted to E. It is useful for uniform manipulation over fields and plain values  Update field Boolean "and" operator. Boolean "or" operator. * )NonevSql pieces for the create table statement that add constraints and alterations for running after the table is created +Trigger name, table name, field name, body Trigger name, table name, body Trigger name, table name cTable name, create statement, structure of table from DB, structure of table from datatype, alters constraint name and reference :Foreign table name and names of the corresponding columns  DCreate migration for a given entity and all entities it depends on. L The stateful Map is used to avoid duplicate migrations when an entity type $ occurs several times in a datatype C      migrate entity  migrate list initial entity !"#$@      !"#$@      !"#$       !"#$None-ERenders conditions for SQL backend. Returns Nothing if the fields don't have any columns. %&'()*+,-./0123%&'()*+,-./0123-/,031.2%&'()*+%&'()*+,-./0123NoneIreceives constructor number and row of values from the constructor table 456789:;<=>?@ 456789:;<=>?@ 456789:;<=>?@456789:;<=>?@ NoneXAVWXYZ[\]^_`abcdefghijmno  !"#$%&'()**+,-./01234566789:;<=>?@ABCDEFFGHIJKLMNOPPQRSTUVVWXYZ[\]^_`abcdefghijklmnopqrstuuvwxyz{||}~      !"#$%&'()*+,fdegmkchibjla -. /0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~groundhog-0.1.0.2Database.Groundhog.Generic.SqlDatabase.Groundhog.CoreDatabase.Groundhog.GenericDatabase.Groundhog.Expression$Database.Groundhog.Generic.Migration0Database.Groundhog.Generic.PersistBackendHelpersdelimDatabase.Groundhog.InstancesDatabase.Groundhogbase Data.String fromString Data.Monoid<>PrimitivePersistFieldtoPrimitivePersistValuefromPrimitivePersistValuePurePersistFieldtoPurePersistValuesfromPurePersistValuesSinglePersistFieldtoSinglePersistValuefromSinglePersistValue PersistField persistNametoPersistValuesfromPersistValuesdbTypeExprExprPure ExprArith ExprField NeverNullNumericArithLit ArithFieldAbsMultMinusPlusZT PersistValue PersistNullPersistZonedTimePersistUTCTimePersistTimeOfDay PersistDay PersistBool PersistDouble PersistInt64PersistByteString PersistString EmbeddedDefDbTypeDbEntity DbEmbeddedDbListDbMaybeDbBlobDbDayTimeZoned DbDayTimeDbTimeDbDayDbBoolDbRealDbInt64DbInt32DbString UniqueDef uniqueName uniqueFields IsUniqueKey UniqueConstr extractUnique uniqueNum ConstructorphantomConstrNamephantomConstrNumConstructorDef constrNum constrNameconstrAutoKeyName constrParams constrUniques EntityDef entityName typeParams constructorsSingleMigrationNamedMigrations Migration RowPopperPersistBackend PhantomDbinsertinsertBy insertByAllreplaceselect selectAllgetgetByupdatedelete deleteByKeycountcountAllprojectmigrate executeRawqueryRaw insertListgetList DbDescriptor AutoKeyType DbPersist unDbPersistHasSelectOptionsHasLimit HasOffsetHasOrdergetSelectOptions SelectOptions condOptions limitOptions offsetOptions orderOptions ProjectionprojectionFieldChainsprojectionResultRestrictionHolder AutoKeyFieldSubFieldEmbeddedSelector selectorNum FieldLike fieldChain FieldChainOrderDescAscUpdate ExprRelationLeGeLtGtNeEqCondCompareNotOrAndHTrueHFalseProxy KeyForBackend UniqueMarkerConstructorMarkerBackendSpecificUnique PersistEntityFieldKeyAutoKey DefaultKey entityDeftoEntityPersistValuesfromEntityPersistValues getUniquesentityFieldChain~>limitTooffsetByorderBy runDbPersisttoArithPSEmbeddedFieldDefpsEmbeddedFieldNamepsDbEmbeddedFieldName psSubEmbeddedcreateMigrationexecuteMigrationexecuteMigrationUnsafeprintMigration runMigrationrunMigrationUnsafesilentMigrationLoggerdefaultMigrationLoggermergeMigrations failMessagefinallybracket onExceptionapplyEmbeddedDbTypeSettingsprimToPersistValueprimFromPersistValuepureToPersistValuepureFromPersistValuesingleToPersistValuesingleFromPersistValuetoSinglePersistValueUniquefromSinglePersistValueUniquetoPersistValuesUniquefromPersistValuesUniquetoSinglePersistValueAutoKeyfromSinglePersistValueAutoKey replaceOnefindOne matchElements haveSameElems mapAllRows phantomDbisSimple Expressionwrap=.&&.||.==./=.<.<=.>.>=. MigrationPackcompareColumns compareRefs compareUniqs checkTablemigTriggerOnDeletemigTriggerOnUpdate migConstrescapeprimaryKeyTypeforeignKeyType mainTableIddefaultPriority convertTypeaddUniquesReferences showColumn showAlterDb UniqueDef'AlterDB DropFunctionCreateOrReplaceFunctionAddTriggerOnUpdateAddTriggerOnDelete DropTrigger AlterTableAddTable AlterColumn DropReference AddReferenceDropConstraintAddUniqueConstraint AlterColumn' UpdateValue NoDefaultDefault AddPrimaryKeyDropAddNotNullIsNullType TableInfotablePrimaryKeyName tableColumns tableUniquestableReferences ReferenceColumncolNamecolNullcolType colDefault mkColumnsmigrateRecursively migrateEntity migrateList getAltersdefaultMigConstrRenderSgetQuery getValues StringLikefromCharparens renderArith renderCond renderChaindefaultShowPrim renderOrders renderFields intercalateS renderUpdatesGHC.NumNumGHC.BaseasTypeOf $fNumArith $fShowArith $fEqArith$fOrdZT$fEqZT$fMonadBaseControlIODbPersist$fMonadTransControlDbPersist$fMonadBaseIODbPersist!$fHasSelectOptionsSelectOptionsvc$fHasSelectOptionsCondvcgetCorrectMigrationsexecuteMigrate readHelper$fFieldLikeura'$fFieldLikeFieldra'$fFieldLikeSubFieldra'$fFieldLikeAutoKeyFieldra'$fProjection(,,,,)r(,,,,)$fProjection(,,,)r(,,,)$fProjection(,,)r(,,)$fProjection(,)r(,)$fProjectionurKey$fProjectioncRestrictionHolderv,$fProjectionAutoKeyFieldRestrictionHolderKey&$fProjectionSubFieldRestrictionHoldera#$fProjectionFieldRestrictionHoldera$fPersistFieldKeyForBackend$fPersistField(,,,,)$fPersistField(,,,)$fPersistField(,,)$fPersistField(,)$fPersistField()$fPersistField[]$fPersistFieldMaybe$fPersistFieldZonedTime$fPersistFieldUTCTime$fPersistFieldTimeOfDay$fPersistFieldDay$fPersistFieldBool$fPersistFieldDouble$fPersistFieldWord64$fPersistFieldWord32$fPersistFieldWord16$fPersistFieldWord8$fPersistFieldInt64$fPersistFieldInt32$fPersistFieldInt16$fPersistFieldInt8$fPersistFieldInt$fPersistFieldText$fPersistField[]0$fPersistFieldByteString$fNeverNullKeyForBackend$fNeverNullKey$fNeverNullUTCTime$fNeverNullTimeOfDay$fNeverNullDay$fNeverNullBool$fNeverNullDouble$fNeverNullInt64$fNeverNullInt$fNeverNullByteString$fNeverNullText $fNeverNull[]$$fPrimitivePersistFieldKeyForBackend$fPrimitivePersistFieldMaybe $fPrimitivePersistFieldZonedTime$fPrimitivePersistFieldUTCTime $fPrimitivePersistFieldTimeOfDay$fPrimitivePersistFieldDay$fPrimitivePersistFieldBool$fPrimitivePersistFieldDouble$fPrimitivePersistFieldWord64$fPrimitivePersistFieldWord32$fPrimitivePersistFieldWord16$fPrimitivePersistFieldWord8$fPrimitivePersistFieldInt64$fPrimitivePersistFieldInt32$fPrimitivePersistFieldInt16$fPrimitivePersistFieldInt8$fPrimitivePersistFieldInt!$fPrimitivePersistFieldByteString$fPrimitivePersistFieldText$fPrimitivePersistField[]$fNumericDouble$fNumericWord64$fNumericWord32$fNumericWord16$fNumericWord8$fNumericInt64$fNumericInt32$fNumericInt16 $fNumericInt8 $fNumericInt$fPurePersistField(,,,,)$fPurePersistField(,,,)$fPurePersistField(,,)$fPurePersistField(,)$fPurePersistField()$fPurePersistFieldMaybe$fPurePersistFielda$fSinglePersistFieldMaybe$fSinglePersistFielda$fEmbedded(,,,,)$fEmbedded(,,,)$fEmbedded(,,) $fEmbedded(,)Tuple5_4SelectorTuple5_3SelectorTuple5_2SelectorTuple5_1SelectorTuple5_0SelectorTuple4_3SelectorTuple4_2SelectorTuple4_1SelectorTuple4_0SelectorTuple3_2SelectorTuple3_1SelectorTuple3_0SelectorTuple2_1SelectorTuple2_0Selector NormalizeKeyTypeEqNormalizeValue'NormalizeValue ExtractValue Normalize Unifiable$fTypeEqxxHTrue $fTypeEqxyb$fNormalizeValue'ar$fNormalizeValue'Keyr$fNormalizeValue'Mayber$fNormalizeValueHTrueisPlaintr$fNormalizeValueHFalseHTruet(,) $fNormalizeValueHFalseHFalset(,)$fExtractValuear$fExtractValueur$fExtractValueAutoKeyFieldr$fExtractValueSubFieldr$fExtractValueFieldr$fExtractValueArithr$fNormalizecounterparttr' $fUnifiableab $fUnifiableaa$fExpressionuv'c'$fExpressionAutoKeyFieldv'c'$fExpressionSubFieldv'c'$fExpressionFieldv'c'$fExpressionArithv'c'$fExpressionavc migrateColumn migrateUniq mkDeletesstringchar renderFieldflattenflattenP commasJoincommasJoinRenders$fStringLike[]$fMonoidRenderSmkEntitygetConstructorTypes getDbTypesconstrIdtoEntityPersistValues'