e      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ NoneZ/Wraps the passed action into a named savepoint This connection manager always returns the same connection. This constraint is useful when performing operations which make sense only within one connection, for example, nested savepoints.. Connection manager provides connection to the passed function handles transations. Manager can be a connection itself, a pool, Snaplet in Snap, foundation datatype in Yesod, etc. @Extracts the connection from manager and opens the transaction. Extracts the connection. -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 HExpr with phantom type helps to keep type safety in complex expressions eUsed to uniformly represent fields, constants and more complex things, e.g., arithmetic expressions.  A value should be converted to  for usage in expressions -Types which are never NULL when converted to .  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. Avoid orphan instances. HA raw value which can be stored in any backend and can be marshalled to  and from a . Creating some datatypes may require calling a function, using a special constructor, or other syntax. The string (which can have placeholders) is included into query without escaping. The recursive constructions are not allowed, i.e., [PersistValue]& cannot contain PersistCustom values. +.Datatype for incremental building SQL queries -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. / Stores name for a database type 1BA 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. 2Nothing means autokey, Just contains a unique key definition and a name of unique constraint. Then there are actions on delete and on update. 4)List table name and type of its argument 7 ByteString G=Defines how to treat the unique set of fields for a datatype KGUnique name and list of the field names that form a unique combination TrPhantom constructors are made instances of this class. This class should be used only by Template Haskell codegen W Describes an entity constructor Y%Number of the constructor in the ADT ZConstructor name [Autokey name if any \&Parameter names with their named type ]0Uniqueness constraints on the constructor fiels ^Describes an ADT. ` Entity name. )entityName (entityDef v) == persistName v aDDatabase schema for the entity table and tables of its constructors b<Named types of the instantiated polymorphic type parameters c(List of entity constructors definitions dPEither error messages or migration queries with safety flag and execution order e,Datatype names and corresponding migrations ijA token which defines the DB type. For example, different monads working with Sqlite, return Sqlite type. jIInsert a new record to a database and return its autogenerated key or () kKInsert a new record to a database. For some backends it may be faster than j. lTry 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. mTry 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. neReplace a record with the given autogenerated key. Result is undefined if the record does not exist. o6Return a list of the records satisfying the condition piReturn a list of all records. Order is undefined. It is useful for datatypes with multiple constructors. q Fetch an entity from a database r2Fetch an entity from a database by its unique key s,Update the records satisfying the condition t,Remove the records satisfying the condition uERemove the record with given key. No-op if the record does not exist v7Count total number of records satisfying the condition w4Count total number of records with all constructors x Fetch projection of some fields yXCheck database schema and create migrations for the entity and the entities it contains zExecute raw query {Execute raw query with results PType of the database default autoincremented key. For example, Sqlite has Int64 Value of this type can be used as a part of a query. For example, it can be RenderS for relational databases, or BSON for MongoDB. Name of backend uIt can be used in expressions like a regular field. Note that the constructor should be specified for the condition.  For example, delete (AutoKeyField * (undefined :: f v SomeConstructor) ==. k)  or -delete (AutoKeyField ==. k ||. SomeField ==. " DUPLICATE") 8This subset of Assignable is for plain database fields. This subset of Projection instances is for things that behave like fields. Namely, they can occur in condition expressions (for example, Field and SubField) and on the left side of update statements. For example " lower(field)"y is a valid Projection, but not Field like because it cannot be on the left side. Datatypes that index PostgreSQL arrays "arr[5]" or access composites "(comp).subfield"$ are valid instances of Assignable. -Any data that can be fetched from a database It returns multiple expressions that can be transformed into values which can be selected. 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. 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 [("val0", DbString), ("some", DbEmbedded False [dbType "" , dbType True])]. #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" WRuns action within connection. It can handle a simple connection, a pool of them, etc.   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyzkeep in cache query positional parameters {keep in cache query positional parameters results processing function |}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~*)('&%$#"!   +,1@?>=<;:98765432^_`abc-./0WXYZ[\]TUVPQRSKLMNOGJIHAFEDCBdefhijklmnopqrstuvwxyz{|}~gJ   *)('&%$#"! +,-./01@?>=<;:98765432AFEDCBGJIHKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ None FThis class helps to shorten the type signatures of user monadic code. 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). CIt helps to run database operations within your application monad. It helps to run  within a monad. .computation 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 ++) NoneZZNone+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. ,       +     NoneThis class distinguishes databases which support SQL-specific expressions. It contains ad hoc members for features whose syntax differs across the databases. Escape function, priority of the outer operator. The result is a list for the embedded data which may expand to several RenderS. ERenders conditions for SQL backend. Returns Nothing if the fields don't have any columns. <Returns escaped table name optionally qualified with schema AReturns escaped main table name optionally qualified with schema (     escape render equals render not equals  !"#$!+,     !   +,  "      !"#$None 4vSql pieces for the create table statement that add constraints and alterations for running after the table is created =Function schema, function name >%Statement which creates the function ?ITrigger schema, trigger name, table schema, table name, field name, body @=Trigger schema, trigger name, table schema, table name, body A7Trigger schema, trigger name, table schema, table name BqTable schema, table name, create statement, structure of table from DB, structure of table from datatype, alters Xconstraint name and reference ]child column, parent column d8contains DbType that maps to one column (no DbEmbedded) gDCreate 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 R ! Schema name " Schema name  Table name # Schema name  Table name $ Schema name  Trigger name % Schema name Function name &'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefgmigrate entity  migrate list initial entity hijFrom database From datatype %&'k(lmN !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmN`abcde789:;YZ[\]^_TUVWXMSRQPONDLKJIHGFE<CBA@?>=&'()*+,-./0123456 !"#$%fghijklm !"#$%&'()*+,-./0123456789:;<CBA@?>=DLKJIHGFEMSRQPONTUVWXYZ[\]^_`abcdefghij%&'k(lmNonesConvert field to an arithmetic value. It is kept for compatibility with older Groundhog versions and can be replaced with liftExpr. nopqrsnopqrspnoqrsnopqrsNone)Ireceives constructor number and row of values from the constructor table tuvwxyz{|}~*+,)- tuvwxyz{|}~ tuvwxyz{|}~tuvwxyz{|}~*+,)- None[Rhijklmnopqrstuvwxyz{|}.  !"#$$%&'()**+,-./0123456778899:;<=>?@ABCDEFGHIJKLMNOPQRSTTUVWXYZ[\]^__`abcdeefghijklmnopqrstuvwxyz{|}~      !""#$%&'()*+,-./01223456789:;<=<>?@ABCDE>FGHIJKLLMNOPPQRSTUVVWXYZ[\]^_`abcdefghwuvx~|tyzs{}r ijklmnopqrstuvwxyz { | } ~                                                                                                         groundhog-0.3.0Database.Groundhog.Generic.SqlDatabase.Groundhog.CoreDatabase.Groundhog.GenericDatabase.Groundhog.Expression$Database.Groundhog.Generic.Migration(Database.Groundhog.Generic.Sql.Functions0Database.Groundhog.Generic.PersistBackendHelpersdelimDatabase.Groundhog.InstancesDatabase.Groundhogbase Data.String fromString Data.Monoid<> SavepointwithConnSavepointSingleConnectionManagerConnectionManagerwithConnwithConnNoTransactionPrimitivePersistFieldtoPrimitivePersistValuefromPrimitivePersistValuePurePersistFieldtoPurePersistValuesfromPurePersistValuesSinglePersistFieldtoSinglePersistValuefromSinglePersistValue PersistField persistNametoPersistValuesfromPersistValuesdbTypeExpr UntypedExprExprPure ExprFieldExprRaw NeverNullZT PersistValue PersistCustom PersistNullPersistZonedTimePersistUTCTimePersistTimeOfDay PersistDay PersistBool PersistDouble PersistInt64PersistByteString PersistStringUtf8 EmbeddedDef OtherTypeDefDbTypeDbEntity DbEmbeddedDbListDbMaybeDbOtherDbBlobDbDayTimeZoned DbDayTimeDbTimeDbDayDbBoolDbRealDbInt64DbInt32DbStringReferenceActionType SetDefaultSetNullCascadeRestrictNoAction UniqueType UniquePrimary UniqueIndexUniqueConstraint UniqueDef uniqueName uniqueType uniqueFields IsUniqueKey UniqueConstr extractUnique uniqueNum ConstructorphantomConstrNamephantomConstrNumConstructorDef constrNum constrNameconstrAutoKeyName constrParams constrUniques EntityDef entityName entitySchema typeParams constructorsSingleMigrationNamedMigrations Migration RowPopperPersistBackend PhantomDbinsertinsert_insertBy insertByAllreplaceselect selectAllgetgetByupdatedelete deleteByKeycountcountAllprojectmigrate executeRawqueryRaw insertListgetList DbDescriptor AutoKeyTypeQueryRaw backendName DbPersist unDbPersistHasSelectOptionsHasLimit HasOffsetHasOrdergetSelectOptions SelectOptions condOptions limitOptions offsetOptions orderOptionsRestrictionHolder AutoKeyFieldSubFieldEmbeddedSelector selectorNum FieldLike fieldChain Assignable ProjectionprojectionExprsprojectionResult FieldChainOrderDescAscUpdate ExprRelationLeGeLtGtNeEqCondCondRawCompareNotOrAndHTrueHFalseProxy KeyForBackend UniqueMarkerConstructorMarkerBackendSpecificUnique PersistEntityFieldKeyAutoKey DefaultKey entityDeftoEntityPersistValuesfromEntityPersistValues getUniquesentityFieldChain~>limitTooffsetByorderBy runDbPersistfromUtf8 runDbConnHasConnPSEmbeddedFieldDefpsEmbeddedFieldNamepsDbEmbeddedFieldNamepsDbEmbeddedTypeName psSubEmbeddedcreateMigrationexecuteMigrationexecuteMigrationUnsafeprintMigration runMigrationrunMigrationUnsafesilentMigrationLoggerdefaultMigrationLoggermergeMigrations failMessagefinallybracket onExceptionapplyEmbeddedDbTypeSettingsapplyReferencesSettingsprimToPersistValueprimFromPersistValuepureToPersistValuepureFromPersistValuesingleToPersistValuesingleFromPersistValuetoSinglePersistValueUniquefromSinglePersistValueUniquetoPersistValuesUniquefromPersistValuesUniquetoSinglePersistValueAutoKeyfromSinglePersistValueAutoKey replaceOnefindOne matchElements haveSameElems mapAllRows phantomDbisSimplerunDb withSavepoint Unifiable ExpressionOf ExpressiontoExpr=.&&.||.==./=.<.<=.>.>=.SqlDbappendSnippetRenderSgetQuery getValues StringLikefromChar renderExprrenderExprPriorityrenderExprExtendedrenderPersistValueparensoperatorfunction renderCond renderChaindefaultShowPrim renderOrders renderFields commasJoin intercalateS renderUpdatesliftExpr tableName mainTableNameSchemaAnalyzer listTableslistTableTriggers analyzeTableanalyzeTriggeranalyzeFunction MigrationPack compareTypes compareRefs compareUniqsmigTriggerOnDeletemigTriggerOnUpdate migConstrescapeprimaryKeyTypeprimaryKeyTypeNameforeignKeyTypeName mainTableIddefaultPriorityaddUniquesReferences showColumn showAlterDb UniqueDef' uniqueDefName uniqueDefTypeuniqueDefColumnsAlterDB DropFunctionCreateOrReplaceFunctionAddTriggerOnUpdateAddTriggerOnDelete DropTrigger AlterTableAddTable AlterColumn AddColumn DropColumn DropReference AddReference DropIndexDropConstraint AddUnique UpdateValue NoDefaultDefaultNotNullIsNullType TableInfo tableColumns tableUniquestableReferences ReferencereferencedTableSchemareferencedTableNamereferencedColumnsreferenceOnDeletereferenceOnUpdateColumncolNamecolNullcolType colDefault mkColumnsmigrateRecursively migrateEntity migrateList getAltersdefaultMigConstrshowReferenceActionreadReferenceActionin_notIn_likeloweruppertoArithGHC.BaseasTypeOf$fEqExpr $fShowExpr$fOrdZT$fEqZT $fShowUtf8$fEqUtf8$fShowOtherTypeDef$fEqOtherTypeDef$fMonadBaseControlIODbPersist$fMonadTransControlDbPersist$fMonadBaseIODbPersist"$fHasSelectOptionsSelectOptionsdbr$fHasSelectOptionsConddbrgetCorrectMigrationsexecuteMigrate$fHasConnmcmconn readHelper$fFieldLikeudbra'$fFieldLikeFielddbra'$fFieldLikeSubFielddbra'$fFieldLikeAutoKeyFielddbra'$fAssignableudbra'$fAssignableFielddbra'$fAssignableSubFielddbra'$fAssignableAutoKeyFielddbra'$fProjection(,,,,)dbr(,,,,)$fProjection(,,,)dbr(,,,)$fProjection(,,)dbr(,,)$fProjection(,)dbr(,)$fProjectionudbrKey!$fProjectioncdbRestrictionHolderv.$fProjectionAutoKeyFielddbRestrictionHolderKey$fProjectionExprdbra($fProjectionSubFielddbRestrictionHoldera%$fProjectionFielddbRestrictionHoldera$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[]$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$fTypeEqxxHTrue $fTypeEqxyb$fNormalizeValue'ar$fNormalizeValue'Keyr$fNormalizeValue'Mayber$fNormalizeValueHTrueisPlaintr$fNormalizeValueHFalseHTruet(,) $fNormalizeValueHFalseHFalset(,)$fExtractValuear$fExtractValueur$fExtractValueAutoKeyFieldr$fExtractValueExprr$fExtractValueSubFieldr$fExtractValueFieldr$fNormalizecounterparttr' $fUnifiableab $fUnifiableaa$fExpressiondbr'u$fExpressiondbr'AutoKeyField$fExpressiondbr'SubField$fExpressiondbr'Field$fExpressiondb'r'Expr$fExpressiondbra$fExpressionOfdbraa'flattenflattenP liftExpr' qualifySchema $fNumExpr$fStringLike[]$fStringLikeRenderS$fIsStringRenderS$fMonoidRenderS$fStringLikeUtf8$fIsStringUtf8 $fMonoidUtf8 migrateColumn migrateUniq dropUnique mkDeletesmkEntitygetConstructorTypes getDbTypesconstrIdtoEntityPersistValues'