m,      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~^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 +Instances of this type can be converted to    IUsed to uniformly represent fields, literals and arithmetic expressions.  A value should be convertec to   for usage in expressions -Datatypes which can be converted directly to  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. The same goals as for N. Certain types like String which have order in Haskell may not have it in DB .Constraint for use in arithmetic expressions. I is not used to explicitly include only types supported by the library . ! TODO: consider replacement with  =Arithmetic expressions which can include fields and literals HA raw value which can be stored in any backend and can be marshalled to  and from a .  !"#$%&It is used to store type ' and persist name of a value '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. ()*+,-./012345LConstraint name and list of the field names that form a unique combination.  Only fields of # types can be used in a constraint 6rPhantom constructors are made instances of this class. This class should be used only by Template Haskell codegen 789 Describes an entity constructor :;%Number of the constructor in the ADT <Constructor name =&Parameter names with their named type >0Uniqueness constraints on the constructor fiels ?Describes an ADT. @A Emtity name B<Named types of the instantiated polymorphic type parameters C(List of entity constructors definitions D=Either error messages or migration queries with safety flags E,Datatype names and corresponding migrations FGHI1Insert a new record to a database and return its on JlTry to insert a record and return Right newkey. If there is a constraint violation, Left oldkey is returned  , where oldkey is an identifier of the record with the same constraint values. Note that if several constraints are violated, a key of an arbitrary matching record is returned. KWReplace a record with the given key. Result is undefined if the record does not exist. LReturn a list of all records limit offset M$Get all records. Order is undefined N6Return a list of the records satisfying the condition limit offset O1Return a list of all records. Order is undefined P Fetch an entity from a database Q,Update the records satisfying the condition R,Remove the records satisfying the condition SERemove the record with given key. No-op if the record does not exist T7Count total number of records satisfying the condition U4Count total number of records with all constructors VXCheck database schema and create migrations for the entity and the entities it contains WExecute raw query keep in cache query positional parameters XExecute raw query with results keep in cache query positional parameters results processing function YZ[\]^_`#Defines sort order of a result-set abcde"Represents condition for a query. fLookup will be performed only in table for the specified constructor c. To fetch value by key without constructor limitation use P ghijklmn4A unique identifier of a value stored in a database op<Only instances of this class can be persisted in a database qNThis type is used for typesafe manipulation of separate fields of datatype v.  Each constructor in q+ corresponds to its field in a datatype v. F It is parametrised by constructor phantom type and field value type. r+Returns a complete description of the type sMarshalls value to a list of  ready for insert to a database t&Constructs the value from the list of  ujReturns constructor number and a list of constraint names and corresponding field names with their values vwx Update field yBoolean "and" operator. zBoolean "or" operator. {|}~%Convert field to an arithmetic value 8By default during converting values of certain types to  ), the types can be changed. For example, on a is transformed into a. ^ It is convenient because the fields usually contain reference to a certain datatype, not its on. F But sometimes when automatic transformation gets in the way function 7 will help. Use it when a field in a datatype has type (Key a) or  Maybe (Key a) . Example:  Ddata Example = Example {entity1 :: Maybe Smth, entity2 :: Key Smth} Entity1Field ==. Just k &&. Entity2Field ==. wrapPrim k   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~pqrstuvw%$#"! noemlkjihgfcdxyz{|}~   `ba'43210/.-,+*)(&?@ABC9:;<=>6785DEFHIJKLMNOPQRSTUVWXYZ[\G]^_    %$#"!  !"#$%&' 43210/.-,+*)(()*+,-./012345678789:;<=>:;<=>?@ABC@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\IJKLMNOPQRSTUVWXYZ[\]^_^_`baabcddemlkjihgffghijklmnoopqrstuvwqrstuvwxyz{|}~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 migrate entity migrate tuple  migrate list initial entity 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 7Get full entity name with the names of its parameters. - getEntityName (entityDef v) == persistName vCall L! but return the result as a list Call M! but return the result as a list +&Set name of the table in the datatype Modify constructor $Set name used to parametrise fields +Set name of the constructor specific table USet constraints of the constructor. The names should be database names of the fields Modify field. Field name is a regular field name in record constructor. Otherwise, it is lower-case constructor name with field number. +Set name of the field column in a database 2Set name of field constructor used in expressions hCreates the auxiliary structures for a user datatype, which are required by Groundhog to manipulate it. It creates GADT q. data instance for referring to the fields in } expressions and phantom types for data constructors. For record constructors the Field name is the regular field name with ) first letter capitalized and postpended "Field"H. If the field is an ordinary constructor, its name is constructor name e and postponed field name. The constructor phantom datatypes have the same name as constructors with " Constructor" postpended. NThe generation can be adjusted using the optional modifier function. Example:  H data SomeData a = Normal Int | Record { bar :: Maybe String, asc :: a} % deriveEntity ''SomeData $ Just $ do # setDbEntityName "SomeTableName"  setConstructor 'Normal $ do ? setPhantomName "NormalConstructor" -- the same as default =It will generate these new datatypes and required instances.  data NormalConstructor  data RecordConstructor  instance PersistEntity where " data Fields (SomeData a) where 2 Normal0Field :: Fields NormalConstructor Int 9 BarField :: Fields RecordConstructor (Maybe String) , AscField :: Fields RecordConstructor a  ...  9HIJKLMNOPQRSTUVWXYZ[\]^_`abefghijklmnoxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>??@ABCDDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`aabcdeffghijklmnoppqrstuvwxyz{|}~,groundhog-0.0.1.1Database.Groundhog.CoreDatabase.Groundhog.GenericDatabase.Groundhog.THDatabase.Groundhog.Generic.SqlDatabase.Groundhog PersistField persistNametoPersistValuefromPersistValuedbType ExpressionFuncVFuncCFuncAwrapExpr ExprPlain ExprArith ExprFieldExprPrim PrimitivetoPrimfromPrim NeverNullHasOrderNumericArithLit ArithFieldAbsMultMinusPlus PersistValue PersistNullPersistUTCTimePersistTimeOfDay PersistDay PersistBool PersistDouble PersistInt64PersistByteString PersistString NamedTypeDbTypeDbEntityDbTupleDbListDbMaybeDbBlob DbDayTimeDbTimeDbDayDbBoolDbRealDbInt64DbInt32DbString Constraint ConstructorphantomConstrNamephantomConstrNumConstructorDef constrNum constrName constrParams constrConstrs EntityDef entityName typeParams constructorsSingleMigrationNamedMigrations Migration RowPopperPersistBackendinsertinsertByreplace selectEnum selectAllEnumselect selectAllgetupdatedelete deleteByKeycountcountAllmigrate executeRawqueryRaw insertTuplegetTuple insertListgetList DbPersist unDbPersistOrderDescAscUpdateCondKeyIs NotEqualsEqualsGreaterLesserNotOrAndKey PersistEntityFields entityDeftoPersistValuesfromPersistValuesgetConstraints showFieldeqField=.&&.||.==./=.<.<=.>.>=. runDbPersist namedTypegetNamegetTypetoArithwrapPrimmigrateRecursivelycreateMigrationexecuteMigrationexecuteMigrationUnsafeprintMigration runMigrationrunMigrationUnsafesilentMigrationLoggerdefaultMigrationLoggermergeMigrations getEntityName defaultSelectdefaultSelectAllsetDbEntityNamesetConstructorsetPhantomNamesetDbConstrNamesetConstraintssetFieldsetDbFieldNamesetExprFieldName deriveEntityRenderS<> renderArith renderConddefRenderEqualsdefRenderNotEquals renderExprdefaultShowPrim renderOrders renderUpdatesdefIddefDelimbaseGHC.NumNumTypeCast TypesCastC TypesEqualC TypesCastV MoreSpecificAnyunsafeCoerceExpr readHelpergetCorrectMigrationsexecuteMigrateFieldDef fieldName dbFieldNameexprName fieldTypeTHConstructorDef thConstrNamethPhantomConstrName dbConstrNamethConstrParamsthConstrConstrs THEntityDefdataName dbEntityName thTypeParamsthConstructors replaceOne runModifyvalidate mkTHEntityDef firstLettermkDecsmkPhantomConstructorsmkPhantomConstructorInstancesmkPersistEntityInstancemkPersistFieldInstance paramsContextfoldType hasFreeVars insideMaybeparensstringcharisNull renderPrim isNullable