\~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}None0A SQL data type. Naming attempts to reflect the underlying Haskell datatypes, eg SqlString instead of SqlVarchar. Different SQL databases may have different translations for these types.Always uses UTC timezone!a backend-specific name"TA raw value which can be stored in any backend and can be marshalled to and from a  PersistField./'Intended especially for MongoDB backend0Using 0 allows you to use types specific to a particular backend For example, below is a simple example of the PostGIS geography type: data Geo = Geo ByteString instance PersistField Geo where toPersistValue (Geo t) = PersistDbSpecific t fromPersistValue (PersistDbSpecific t) = Right $ Geo $ Data.ByteString.concat ["'", t, "'"] fromPersistValue _ = Left "Geo values must be converted from PersistDbSpecific" instance PersistFieldSql Geo where sqlType _ = SqlOther "GEOGRAPHY(POINT,4326)" toPoint :: Double -> Double -> Geo toPoint lat lon = Geo $ Data.ByteString.concat ["'POINT(", ps $ lon, " ", ps $ lat, ")'"] where ps = Data.Text.pack . show PIf Foo has a geography field, we can then perform insertions like the following: insert $ Foo (toPoint 44 44) 2Generic ExceptionA>Used instead of FieldDef to generate a smaller amount of codeL|An EmbedFieldDef is the same as a FieldDef But it is only used for embeddedFields so it only has data needed for embeddingPO< can create a cycle (issue #311) when a cycle is detected, O will be Nothing and P will be JustQAn EmbedEntityDef is the same as an EntityDef But it is only used for fieldReference so it only has data needed for embeddingUpThere are 3 kinds of references 1) composite (to fields that exist in the record) 2) single field 3) embeddedWA ForeignRef has a late binding to the EntityDef it references via HaskellName and has the Haskell type of the foreign key in the form of FieldTypeZcA SelfReference stops an immediate cycle which causes non-termination at compile-time (issue #311).]name of the fieldauser annotations for a fieldb.a strict field in the data type. Default: trueeOptional module and name.|The reason why a field is nullable< is very important. A field that is nullable because of a Maybe& tag will have its type changed from A to Maybe A0. OTOH, a field that is nullable because of a nullable% tag will remain with the same type.A  should be used as a field type whenever a uniqueness constraint should guarantee that a certain kind of record may appear at most once, but other kinds of records may appear any number of times.NOTE: You need to mark any  Checkmark fields as nullable (see the following example).For example, suppose there's a Location0 entity that represents where a user has lived: mLocation user UserId name Text current Checkmark nullable UniqueLocation user current The UniqueLocation" constraint allows any number of  Locations to be current&. However, there may be at most one current Location/ per user (i.e., either zero or one per user).9This data type works because of the way that SQL treats NULLHable fields within uniqueness constraints. The SQL standard says that NULL9 values should be considered different, so we represent  as SQL NULL, thus allowing any number of , records. On the other hand, we represent  as TRUE<, so the uniqueness constraint will disallow more than one  record.Note:I There may be DBMSs that do not respect the SQL standard's treatment of NULL_ values on uniqueness constraints, please check if this data type works before relying on it.The SQL BOOLEANV type is used because it's the smallest data type available. Note that we never use FALSE, just TRUE and NULL. Provides the same behavior Maybe () would if () was a valid  PersistField.@When used on a uniqueness constraint, there may be at most one  record.BWhen used on a uniqueness constraint, there may be any number of  records.  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUYVWXZ[\^]c_`abdefghijklmnopqtvrsuwxyz{|}~+    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnop qrstuvwxyz{|}~~None /9;AIMT.A value which can be marshalled to and from a ".)& None /0:ADORT2Datatype that represents an entity, with both its ( and its Haskell record representation.CWhen using a SQL-based backend (such as SQLite or PostgreSQL), an  may take any number of columns depending on how many fields it has. In order to reconstruct your entity on the Haskell side,  persistentu needs all of your entity columns and in the right order. Note that you don't need to worry about this when using  persistent@'s API since everything is handled correctly behind the scenes.AHowever, if you want to issue a raw SQL command that returns an K, then you have to be careful with the column order. While you could use SELECT Entity.* WHERE ... and that would work most of the time, there are times when the order of the columns on your database is different from the order that  persistentz expects (for example, if you add a new field in the middle of you entity definition and then use the migration code --  persistent will expect the column to be in the middle, but your DBMS will put it as the last column). So, instead of using a query like the one above, you may use   (from the Database.Persist.GenericSqlJ module) with its /entity selection placeholder/ (a double question mark ?? ). Using rawSql$ the query above must be written as SELECT ?? WHERE ... Then rawSql will replace ??| with the list of all columns that we need from your entity in the right order. If your query returns two entities (i.e. %(Entity backend a, Entity backend b)), then you must you use SELECT ??, ?? WHERE ... , and so on. Filters which are available for select,  updateWhere and  deleteWhere. Each filter constructor specifies the field being filtered on, the type of comparison applied (equals, not equals, etc) and the argument for the comparison.0Persistent users use combinators to create these3convenient for internal use, not needed for the API query options#Persistent users use these directlyUpdating a database entity0Persistent users use combinators to create theseCPersistent serialized Haskell records to the database. A Database > (A row in SQL, a document in MongoDB, etc) corresponds to a  plus a Haskell record.NFor every Haskell record type stored in the database there is a corresponding  instance. An instance of PersistEntity contains meta-data for the record. PersistEntity also helps abstract over different record types. That way the same query interface can return a ?, with each query returning different types of Haskell records.Some advanced type system capabilities are used to make this process type-safe. Persistent users usually don't need to understand the class associated data and functions.9Persistent allows multiple different backends (databases)zBy default, a backend will automatically generate the key Instead you can specify a Primary key made up of unique values.An \ is parameterised by the Haskell record it belongs to and the additional type of that fieldUnique keys besides the Keya lower-level key operationa lower-level key operation0a meta-operation to retrieve the Key EntityField/retrieve the EntityDef meta-data for the recordreturn meta-data for a given 7A meta-operation to get the database fields of a recordKA lower-level operation to convert from database values to a Haskell record0A meta operation to retrieve all the Unique keysA lower level operationA lower level operationUse a PersistField as a lens Predefined toJSON!. The resulting JSON looks like "{"key": 1, "value": {"name": ...}}.The typical usage is: J instance ToJSON (Entity User) where toJSON = keyValueEntityToJSON  Predefined  parseJSON. The input JSON looks like "{"key": 1, "value": {"name": ...}}.The typical usage is: Q instance FromJSON (Entity User) where parseJSON = keyValueEntityFromJSON  Predefined toJSON!. The resulting JSON looks like {"id": 1, "name": ...}.The typical usage is: D instance ToJSON (Entity User) where toJSON = entityIdToJSON  Predefined  parseJSON. The input JSON looks like {"id": 1, "name": ...}.The typical usage is: K instance FromJSON (Entity User) where parseJSON = entityIdFromJSON YRealistically this is only going to be used for MongoDB, so lets use MongoDB conventions(Convenience function for getting a free - instance from a type with JSON instances.!Example usage in combination with: sinstance PersistField MyData where fromPersistValue = fromPersistValueJSON toPersistValue = toPersistValueJSON (Convenience function for getting a free  instance from a type with JSON instances. The JSON parser used will accept JSON values other that object and arrays. So, if your instance serializes the data to a JSON string, this will still work.!Example usage in combination with: sinstance PersistField MyData where fromPersistValue = fromPersistValueJSON toPersistValue = toPersistValueJSON (Convenience function for getting a free  instance from a type with an  instance. The function derivePersistFieldn from the persistent-template package should generally be preferred. However, if you want to ensure that an ORDER BYf clause that uses your field will order rows by the data constructor order, this is a better choice."Example usage in combination with : data SeverityLevel = Low | Medium | Critical | High deriving (Enum, Bounded) instance PersistField SeverityLevel where fromPersistValue = fromPersistValueEnum toPersistValue = toPersistValueEnum (Convenience function for getting a free  instance from a type with an * instance. This function also requires a - instance to improve the reporting of errors."Example usage in combination with : data SeverityLevel = Low | Medium | Critical | High deriving (Enum, Bounded) instance PersistField SeverityLevel where fromPersistValue = fromPersistValueEnum toPersistValue = toPersistValueEnum 52NoneADRT  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUYVWXZ[\^]c_`abdefghijklmnopqtvrsuwxyz{|}~|}~pqrstuvwxyz{olmnijkhdefg[\]^_`abcUVWXYZQRSTLMNOPFGHIJKBCDEA89:;<=>?@1234567"#$%&'()*+,-./0 !   None:<=?DR)Get a record by identifier, if available.kCreate a new record in the database, returning an automatically created key (in SQL an auto-increment id).Same as , but doesn't return a Key.9Create multiple records in the database and return their s.If you don't need the inserted s, use .fThe MongoDB and PostgreSQL backends insert all records and retrieve their keys in one database query.GThe SQLite and MySQL backends use the slow, default implementation of  mapM insert.Same as , but doesn't return any s.]The MongoDB, PostgreSQL, SQLite and MySQL backends insert all records in one database query.Same as , but takes an  instead of just a record.PUseful when migrating data from one entity to another and want to preserve ids.CThe MongoDB backend inserts all the entities in one database query.:The SQL backends use the slow, default implementation of mapM_ insertKey.8Create a new record in the database using the given key.;Put the record in the database with the given key. Unlike T, if a record with the given key does not exist then a new record will be inserted.Replace the record in the database with the given key. Note that the result is undefined if such record does not exist, so you must use 'insertKey or  in these cases.ODelete a specific record by identifier. Does nothing if record does not exist..Update individual fields on a specific record.aUpdate individual fields on a specific record, and retrieve the updated value from the database._Note that this function will throw an exception if the given key is not found in the database.ToBackendKey converts a   into a 8 This can be used by each backend to convert between a 7 and a plain Haskell type. For Sql, that is done with toSqlKey and  fromSqlKey.By default, a  uses the default 0 for its Key and is an instance of ToBackendKeyA < that instead uses a custom type will not be an instance of Same as get, but for a non-null (not Maybe) foreign key Unsafe unless your database is enforcing that the foreign key is validHcurry this to make a convenience function that loads an associated model foreign = belongsTo foerignIdsame as belongsTo, but uses getJust" and therefore is similarly unsafelike insert, but returns the complete Entity  NoneDR DUpdate individual fields on any record matching the given criterion.0Delete all records matching the given criterion.cGet all records matching the given criterion in the specified order. Returns also the identifiers.+get just the first record for the criterionGet the .s of all records matching the given criterion.;The total number of records fulfilling the given criterion.cGet all records matching the given criterion in the specified order. Returns also the identifiers.Get the .s of all records matching the given criterion.Call ! but return the result as a list.Call ! but return the result as a list. None:DR Queries against  keys (other than the id ).IPlease read the general Persistent documentation to learn how to create  keys.yUsing this with an Entity without a Unique key leads to undefined behavior. A few of these functions require a *single* #, so using an Entity with multiple s is also undefined. In these cases persistent's goal is to throw an exception as soon as possible, but persistent is still transitioning to that.SQL backends automatically create uniqueness constraints, but for MongoDB you must manually place a unique index on a field to have a uniqueness constraint.Some functions in this module (insertUnique, insertBy, and replaceUnique) first query the unique indexes to check for conflicts. You could instead optimistically attempt to perform the operation (e.g. replace instead of replaceUnique). However,ethere is some fragility to trying to catch the correct exception and determing the column of failure.Aan exception will automatically abort the current SQL transactionFGet a record by unique key, if available. Returns also the identifier.KDelete a specific record by unique key. Does nothing if no record matches.Like , but returns J when the record couldn't be inserted because of a uniqueness constraint.0update based on a uniquness constraint or insertlinsert the new record if it does not exist update the existing record that matches the uniqueness contraint@Throws an exception if there is more than 1 uniqueness contraintInsert a value, checking for conflicts with any unique constraints. If a duplicate exists in the database, it is returned as *. Otherwise, the new 'Key is returned as .)Return the single unique key for a recordA modification of , which takes the  itself instead of a # record. Returns a record matching oneS of the unique keys. This function makes the most sense on entities with a single  constructor.Attempt to replace the record of the given key with the given new record. First query the unique fields to make sure the replacement maintains uniqueness constraints. Return C if the replacement was made. If uniqueness is violated, return a  with the  violation Since 1.2.2.0nCheck whether there are any conflicts for unique keys with this entity and existing entities in the database.Returns m if the entity would be unique, and could thus safely be inserted. on a conflict returns the conflicting key  None$M fields in other entityvA line. We don't care about spaces in the middle of the line. Also, we don't care about the ammount of indentation.A token used by the parser.Spaces n are n consecutive spaces. Token tok is token tok already unquoted.5Whether fields are by default strict. Default value: True. Since 1.2*The name of the id column. Default value: idF The name of the id column can also be changed on a per-model basis Dhttps://github.com/yesodweb/persistent/wiki/Persistent-entity-syntax Since 2.0?Parses a quasi-quoted syntax into a list of entity definitions.Tokenize a string.VA string of tokens is empty when it has only spaces. There can't be two consecutive , so this takes O(1) time.ERemove leading spaces and remove spaces in the middle of the tokens.5Divide lines into blocks and make entity definitions.Construct an entity definition.4nameentity attributesindented lines "None:DRRepresents a value containing all the configuration options for a specific backend. This abstraction makes it easier to write code that can easily swap backends. Load the config settings from a -, most likely taken from a YAML config file.:Modify the config settings based on environment variables.@Create a new connection pool based on the given config settings.;Run a database action by taking a connection from the pool.None<=DRNoneQQNone09;<=CDIORTA single column (see rawSql). Any  PersistField may be used here, including "% (which does not do any processing).#Btable name, column names, id name, either 1 or 2 statements to run$oSQL for inserting many rows and returning their primary keys, for backends that support this functioanlity. If ,, rows will be inserted one-at-a-time using #.0Deprecated synonym for  SqlBackend.4      !"#$%&'()*+,-./012342      !+"#$%&'()*,-./01234      !"#$%&'()*+,-./01234NoneM60Create the list of columns for the given entity.565656None:ADRT7assign a field a value8assign a field by addition (+=)9"assign a field by subtraction (-=):%assign a field by multiplication (*=);assign a field by division (/=)BInCNotInDVthe OR of two lists of filters. For example: selectList([PersonAge >. 25, PersonAge  .30] ||. [PersonIncome. 15000, PersonIncome <. 25000]) [] will filter records where a person's age is between (25 and 30) OR a person's income is between (15,000 and 25000). If you are looking for an &&. operator to do (A AND B AND (C OR D)) you can use the ++ operator instead as there is no &&. For example: selectList([PersonAge >. 25, PersonAge <. 30] ++ ([PersonCategory ==. 1] ||. [PersonCategory ==. 5])) [] will filter records where a person's age is between (25 and 30) AND (person's category is either 1 or 5) 789:;<=>?@ABCDEFGH   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUYVWXZ[\^]c_`abdefghijklmnopqtvrsuwxyz{|}~789:;<=>?@ABCDEFGH789:;<=>@?ABCDEFGH789:;<=>?@ABCDEFGH738393:3;3<4=4>4?4@4A4B4C4D3None 69;DRTK1Class for data types that may be retrived from a rawSql query.LONumber of columns that this data type needs and the list of substitutions for SELECT placeholders ??.M>A string telling the user why the column count is what it is.N1Transform a row of the result into the data type. Since 1.0.1.>IJKLMN      !"#$%&IJKLMN:IJKLMN      !"#$%&None:QExecute a raw SQL statementRKExecute a raw SQL statement and return the number of rows it has modified.T>Execute a raw SQL statement and return its results as a list.If you're using s$ (which is quite likely), then you must; use entity selection placeholders (double question mark, ?? ). These ?? placeholders are then replaced for the names of the columns that we need for your entities. You'll receive an error if you don't use the placeholders. Please see the s documentation for more details.0You may put value placeholders (question marks, ?) in your SQL query. These placeholders are then replaced by the values you pass on the second parameter, already correctly escaped. You may want to use 2 to help you constructing the placeholder values.]Since you're giving a raw SQL statement, you don't get any guarantees regarding safety. If T is not able to parse the results of your query back, then an exception is raised. However, most common problems are mitigated by using the entity selection placeholder ??>, and you shouldn't see any error at all if you're not using .Some example of T based on this schema: share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase| Person name String age Int Maybe deriving Show BlogPost title String authorId PersonId deriving Show |] #Examples based on the above schema: getPerson :: MonadIO m => ReaderT SqlBackend m [Entity Person] getPerson = rawSql "select ?? from person where name=?" [PersistText "john"] getAge :: MonadIO m => ReaderT SqlBackend m [Single Int] getAge = rawSql "select person.age from person where name=?" [PersistText "john"] getAgeName :: MonadIO m => ReaderT SqlBackend m [(Single Int, Single Text)] getAgeName = rawSql "select person.age, person.name from person where name=?" [PersistText "john"] getPersonBlog :: MonadIO m => ReaderT SqlBackend m [(Entity Person, Entity BlogPost)] getPersonBlog = rawSql "select ??,?? from person,blog_post where person.id = blog_post.author_id" [] KMinimal working program for PostgreSQL backend based on the above concepts: -{-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} import Control.Monad.IO.Class (liftIO) import Control.Monad.Logger (runStderrLoggingT) import Database.Persist import Control.Monad.Reader import Data.Text import Database.Persist.Sql import Database.Persist.Postgresql import Database.Persist.TH share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase| Person name String age Int Maybe deriving Show |] conn = "host=localhost dbname=new_db user=postgres password=postgres port=5432" getPerson :: MonadIO m => ReaderT SqlBackend m [Entity Person] getPerson = rawSql "select ?? from person where name=?" [PersistText "sibi"] liftSqlPersistMPool y x = liftIO (runSqlPersistMPool y x) main :: IO () main = runStderrLoggingT $ withPostgresqlPool conn 10 $ liftSqlPersistMPool $ do runMigration migrateAll xs <- getPerson liftIO (print xs) OPQ*SQL statement, possibly with placeholders. Values to fill the placeholders.R*SQL statement, possibly with placeholders. Values to fill the placeholders.'ST*SQL statement, possibly with placeholders. Values to fill the placeholders.OPQR'STOPQR'STNone:[Same as ZV, but returns a list of the SQL commands executed instead of printing them to stderr.(QSort the alter DB statements so tables are created before constraints are added.)*UVWXYZ[+ is silent?\,(] UVWXYZ[\])*UVWXYZ[+\,(]None:T^bGet a connection from the pool, run the given action, and then return the connection to the pool.Note: This function previously timed out after 2 seconds, but this behavior was buggy and caused more problems than it solved. Since version 2.1.2, it performs no timeout checks._Like -h, but times out the operation if resource allocation does not complete within the given timeout period. Since 2.0.0 ^_Timeout period in microseconds`abcdcreate a new connectionconnection countefgh ^_`abcdefgh ^_`abcdefghNone ijklmnopq ijklmnopq pijkqlmno ijklmnopqNone 69:;DIORTu[get the SQL string for the table that a PeristEntity represents Useful for raw SQL queries`Your backend may provide a more convenient tableName function which does not operate in a Monadv>useful for a backend to implement tableName by adding escapingw[get the SQL string for the field that an EntityField represents Useful for raw SQL queries`Your backend may provide a more convenient fieldName function which does not operate in a Monadx>useful for a backend to implement fieldName by adding escaping./rst0uvwx1234567 ./rstuvwxrst0uvwx1234576./NoneDORTySame as *, but returns the number of rows affected. Since 1.1.5zSame as *, but returns the number of rows affected. Since 1.1.5{BGenerates sql for limit and offset for postgres, sqlite and mysql.89:yz;<=>include table name?include WHERE??@include table name?Ainclude the table name{Byz{ 89:yz;<=>?@A{BNoneCDCDNone|3Commit the current transaction and begin a new one. Since 1.2.0}6Roll back the current transaction and begin a new one. Since 1.2.0|}j  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUYVWXZ[\^]c_`abdefghijklmnopqtvrsuwxyz{|}~./      !+"#$%&'()*,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^`abcdefghrstuvwxyz{|}`12340 !"#$%&'()*+,-./     KLMNIJ^_`abcdefghUVWXYZ[\]rstwuvxOPQRTyz|}S65{|}E !!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQQRSTUVWXYZZ[\]]^_`abbcdeffghijklmnoopqrstuvwxyz{||}~~        .                            !"#$%&&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX YZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~           !"#$%&'()*+,-./0123456789:;<=>?@ABCDEF=GHIJKL'persistent-2.2.3-LPRRjBTEDPk7GV3g2LI4MTDatabase.Persist.TypesDatabase.Persist.ClassDatabase.PersistDatabase.Persist.QuasiDatabase.Persist.SqlDatabase.Persist.Sql.UtilDatabase.Persist.Types.Base#Database.Persist.Class.PersistField$Database.Persist.Class.PersistEntityDatabase.Persist.GenericSqlrawSql#Database.Persist.Class.PersistStore#Database.Persist.Class.PersistQuery$Database.Persist.Class.PersistUnique$Database.Persist.Class.PersistConfig$Database.Persist.Class.DeleteCascadeDatabase.Persist.Sql.TypesDatabase.Persist.Sql.InternalDatabase.Persist.Sql.ClassDatabase.Persist.Sql.RawDatabase.Persist.Sql.MigrationDatabase.Persist.Sql.Run(Database.Persist.Sql.Orphan.PersistStore(Database.Persist.Sql.Orphan.PersistQuery)Database.Persist.Sql.Orphan.PersistUnique PersistUpdateAssignAddSubtractMultiplyDivideBackendSpecificUpdateOnlyUniqueExceptionUpdateException KeyNotFound UpsertError PersistFilterEqNeGtLtGeLeInNotInBackendSpecificFilterSqlType SqlStringSqlInt32SqlInt64SqlReal SqlNumericSqlBoolSqlDaySqlTime SqlDayTimeSqlBlobSqlOther PersistValue PersistTextPersistByteString PersistInt64 PersistDoublePersistRational PersistBool PersistDayPersistTimeOfDayPersistUTCTime PersistNull PersistList PersistMapPersistObjectIdPersistDbSpecificPersistException PersistErrorPersistMarshalErrorPersistInvalidFieldPersistForeignConstraintUnmetPersistMongoDBErrorPersistMongoDBUnsupported ForeignDefforeignRefTableHaskellforeignRefTableDBNameforeignConstraintNameHaskellforeignConstraintNameDBName foreignFields foreignAttrsforeignNullableForeignFieldDef CompositeDefcompositeFieldscompositeAttrs UniqueDef uniqueHaskell uniqueDBName uniqueFields uniqueAttrs EmbedFieldDef emFieldDB emFieldEmbed emFieldCycleEmbedEntityDefembeddedHaskellembeddedFields ReferenceDef NoReference ForeignRefEmbedRef CompositeRef SelfReferenceFieldDef fieldHaskellfieldDB fieldType fieldSqlType fieldAttrs fieldStrictfieldReference FieldType FTTypeConFTAppFTListAttrDBNameunDBName HaskellName unHaskellName ExtraLine EntityDef entityHaskellentityDBentityId entityAttrs entityFields entityUniquesentityForeigns entityDerives entityExtra entitySum WhyNullable ByMaybeAttrByNullableAttr IsNullableNullable NotNullable CheckmarkActiveInactive entityPrimaryentityKeyFieldskeyAndEntityFieldstoEmbedEntityDeffromPersistValueTextSomePersistField PersistFieldtoPersistValuefromPersistValue getPersistMapEntity entityKey entityValFilter FilterAndFilterOr BackendFilter filterField filterValue filterFilter SelectOptAscDescOffsetByLimitToUpdate BackendUpdate updateField updateValue updateUpdate PersistEntityPersistEntityBackendKey EntityFieldUnique keyToValues keyFromValuespersistIdField entityDefpersistFieldDeftoPersistFieldsfromPersistValuespersistUniqueKeyspersistUniqueToFieldNamespersistUniqueToValues fieldLens entityValueskeyValueEntityToJSONkeyValueEntityFromJSONentityIdToJSONentityIdFromJSONtoPersistValueJSONfromPersistValueJSON PersistStore BackendKeygetinsertinsert_ insertMany insertMany_insertEntityMany insertKeyrepsertreplacedeleteupdate updateGet ToBackendKey toBackendKeyfromBackendKeyHasPersistBackendpersistBackend liftPersistgetJust belongsTo belongsToJust insertEntity PersistQuery updateWhere deleteWhereselectSourceRes selectFirst selectKeysRescount selectSource selectKeys selectListselectKeysList PersistUniquegetBydeleteBy insertUniqueupsertinsertBy onlyUnique getByValue replaceUnique checkUniquePersistSettings psToDBNamepsStrictFieldspsIdNameupperCaseSettingslowerCaseSettingsparsenullable$fShowParseState $fShowToken $fEqToken PersistConfigPersistConfigBackendPersistConfigPool loadConfigapplyEnvcreatePoolConfigrunPool DeleteCascade deleteCascadedeleteCascadeWhereSingleunSingleConnectionPool MigrationCautiousMigrationSql SqlPersistM SqlPersist SqlPersistTPersistentSqlExceptionStatementAlreadyFinalizedCouldn'tGetSQLConnectionColumncNamecNullcSqlTypecDefaultcDefaultConstraintNamecMaxLen cReference Statement stmtFinalize stmtReset stmtExecute stmtQueryLogFunc SqlBackend connPrepare connInsertSqlconnInsertManySql connStmtMap connCloseconnMigrateSql connBegin connCommit connRollbackconnEscapeName connNoLimit connRDBMSconnLimitOffset connLogFunc ConnectionInsertSqlResult ISRSingle ISRInsertGet ISRManyKeysdefaultAttribute mkColumns=.+=.-=.*=./=.==.!=.<.<=.>.>=.<-./<-.||. listToJSON mapToJSON toJsonTextlimitOffsetOrderPersistFieldSqlsqlTypeRawSql rawSqlColsrawSqlColCountReasonrawSqlProcessRowrawQuery rawQueryRes rawExecuterawExecuteCount getStmtConnparseMigrationparseMigration'printMigration showMigration getMigration runMigrationrunMigrationSilentrunMigrationUnsafemigrate runSqlPoolwithResourceTimeout runSqlConnrunSqlPersistMrunSqlPersistMPoolliftSqlPersistMPool withSqlPool createSqlPool askLogFunc withSqlConnclose'entityColumnNameskeyAndEntityColumnNamesentityColumnCounthasCompositeKey dbIdColumnsdbIdColumnsEsc dbColumnsparseEntityValues isIdField withRawQuerytoSqlKey fromSqlKey getTableName tableDBName getFieldName fieldDBNamedeleteWhereCountupdateWhereCountdecorateSQLWithLimitOffsettransactionSavetransactionUndo$fExceptionOnlyUniqueException$fShowOnlyUniqueException$fExceptionUpdateException$fShowUpdateException$fFromJSONPersistValue$fToJSONPersistValue$fPathPiecePersistValue$fFromHttpApiDataPersistValue$fToHttpApiDataPersistValue$fErrorPersistException$fExceptionPersistException$fPathPieceCheckmark$fFromHttpApiDataCheckmark$fToHttpApiDataCheckmarkfromPersistListfromPersistMap$fPersistFieldCheckmark$fPersistFieldSomePersistField$fPersistFieldPersistValue$fPersistFieldMap$fPersistFieldIntMap$fPersistField(,)$fPersistFieldSet$fPersistFieldVector$fPersistField[]$fPersistFieldMaybe$fPersistFieldNatural$fPersistFieldUTCTime$fPersistFieldTimeOfDay$fPersistFieldDay$fPersistFieldBool$fPersistFieldRatio$fPersistFieldFixed$fPersistFieldDouble$fPersistFieldWord64$fPersistFieldWord32$fPersistFieldWord16$fPersistFieldWord8$fPersistFieldWord$fPersistFieldInt64$fPersistFieldInt32$fPersistFieldInt16$fPersistFieldInt8$fPersistFieldInt$fPersistFieldMarkupM$fPersistFieldText$fPersistFieldText0$fPersistFieldByteString$fPersistField[]0idFieldtoPersistValueEnumbaseGHC.EnumEnumfromPersistValueEnumBoundederrMsg$fPersistFieldEntityGHC.BaseNothing Data.EitherLeftRightJustonlyUniqueEitherrequireUniques recordNamecheckUniqueKeys_unboundFieldsLineTokenSpacestokenizeempty removeSpaces parseLines mkEntityDefUnboundForeignDef_unboundForeignDefUnboundEntityDef_unboundForeignDefsunboundEntityDef lineIndenttokens ParseStatePSDonePSFail PSSuccessparseFieldTypedefaultPersistSettingsfixForeignKeysAll lookupKeyVal lookupPrefixjust1 mkAutoIdFielddefaultReferenceTypeCon keyConName splitExtras takeColsExtakeCols getDbNametakeConstrainttakeId takeCompositetakeUniq takeForeign takeDerives$aeson-1.0.2.1-JhZNpAmlJ04FJVjHHUBYQAData.Aeson.Types.InternalValue$fPersistConfigEither!$fExceptionPersistentSqlException'$fHasPersistBackendSqlBackendSqlBackendrefNameresolveTableName $fRawSqlMaybefrom3to3from4to4from5to5from6to6from7to7from8to8 extractMaybe$fPersistFieldSqlEntity$fPersistFieldSqlNatural$fPersistFieldSqlRatio$fPersistFieldSqlFixed$fPersistFieldSqlCheckmark$fPersistFieldSqlPersistValue$fPersistFieldSqlMap$fPersistFieldSqlIntMap$fPersistFieldSql(,)$fPersistFieldSqlSet$fPersistFieldSqlVector$fPersistFieldSql[]$fPersistFieldSqlUTCTime$fPersistFieldSqlTimeOfDay$fPersistFieldSqlDay$fPersistFieldSqlBool$fPersistFieldSqlDouble$fPersistFieldSqlWord64$fPersistFieldSqlWord32$fPersistFieldSqlWord16$fPersistFieldSqlWord8$fPersistFieldSqlWord$fPersistFieldSqlInt64$fPersistFieldSqlInt32$fPersistFieldSqlInt16$fPersistFieldSqlInt8$fPersistFieldSqlInt$fPersistFieldSqlMarkupM$fPersistFieldSqlText$fPersistFieldSqlText0$fPersistFieldSqlByteString$fPersistFieldSql[]0$fRawSql(,,,,,,,)$fRawSql(,,,,,,)$fRawSql(,,,,,)$fRawSql(,,,,) $fRawSql(,,,) $fRawSql(,,) $fRawSql(,)$fRawSqlEntity $fRawSqlKey$fRawSqlSinglegetStmtsortMigrationsallSqlsafeSql runMigration'executeMigrate,resource-pool-0.2.3.2-DrDbnKAVr4d6lusOB4rlhA Data.Pool withResource SqlBackendKeyunSqlBackendKeywhereStmtForKey dummyFromKeyrecordTypeFromKey insrepHelperupdateFieldDefupdatePersistValueD:R:BackendKeySqlBackend0$fPersistStoreSqlBackendOrNull OrNullYesOrNullNo fieldNamedummyFromFiltsgetFiltsValuesfilterClauseHelper filterClause orderClause$fPersistQuerySqlBackenddummyFromUnique$fPersistUniqueSqlBackend