xmT      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Safe  None:Used for creating instances of ToAudit when the original model database is Mongo and the audit model database is SQL. ==== Example User ident Text password Text Maybe UniqueUser ident UserAudit ident Text password Text Maybe originalId ByteString auditAction AuditAction editedBy Text editedOn UTCTime instance ToAudit User where type AuditResult User = UserAudit toAudit v k auditAction editedBy editedOn = UserAudit (userIdent v) (userPassword v) (mongoKeyToByteString k) auditAction editedBy editedOnbUsed for when Mongo stored in SQL needs to be converted to a Key to query the original MongoDB.None5FAnnotations for each Audit Model to keep track of why it was inserted.,Haskell style comments that start with "-- "SAny white spaces that the user might want to maintain when generating Audit Models.'Foreign Tree fkparent parent''Primary name'!$'deriving Eq', 'deriving Show', etc.$"A unique idenfitier for an Entity.(An entity data row's type. If , is  than this type is a list.. Table rows can be strict or lazy/3Persist Model types are strict without any notation04"!" can be used to reemphasize that a type is strict1"~" means that a type is Lazy2A data row from an Entity.7 MigrationOnly8 SafeToRemove94default=Nothing, default=now(), default=CURRENT_DATE:sql=my_id_name;sqltype=varchar(255)<`All of the child elements of a Persist Model Entity. | They are all indented in the Model File.DA single Persist Model Entity.H Person jsonIPerson sql=peoplesJ)Top level pieces of a Persist Model file.NnA collection of data types with which you can recontruct a Persist Model file | or create an altered version.C !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNxyz{? !"#$%&'()*+,-./1023456789:;<=>?@ABCDEFGHIJKLMNDNJKLMDEFGHI<=>?@ABC23456789:;./01()*+,-$%&'!"# {{zyx !"#$%&'()*+,-./012 3456789:;<=>?@ABCDEFGHIJKLMNxyz{None:}+All foreign keys are kept in the audit models but derefenced so the original models | can be deleted without affecting the audit models. This is a work around in case the | original models and the audit models are stored in different databases. | Persist cannot handle keys across SQL and Mongo.~LDefault setting. Link the ids as the original type with a "noreference" tag.'Store Mongo Key as a ByteString in SQL.&Store SQL Key as an Int64 in Mongo. ?Five options for generating Audit Models and ToAudit Instances.KThe number of spaces to add for all items that appear under an EntityName. XThe tag that will be added to the original model name in the generated audit models. If  is History then User will become  UserHistory.If ^, the generated Audit Models will maintain the same derived Type Classes as the original file.If R, the generated Audit Models will maintain the same comments as the original file.If Q, the generated Audit Models will maintain the same spacing as the original file.;Foreign Keys can be the original type, ByteString or Int64.6Settings that the author assumed would be most common.Convert a list of TopLevel to a list of Audit Models in .XSelect the correct type from Audit Model to original Model. Used for cross database. |  is the type and = is the original type in comment for if using cross database. Convert a TopLevel. to an Audit Model, white space or comment in . Convert an <! to a piece of an Audit Model in . | It does not generate anything for EntityUnique, EntityPrimary or EntityForeign | because Audits do not need to be unique, they will have an automatically produced Key | and should not have any foreign keys connecting back to the original model.Convert a list of TopLevel to a to a list of ToAudit in .Convert TopLevel to an instance of ToAudit in .Convert < to a Model accessor.6Select the correct function for handling foreign keys.If $ True then prefix the function with +Return true if the last two characters are Id.Convert the first letter of a ' to the corresponding uppercase letter.Convert the first letter of a ' to the corresponsing lowercase letter.}~}~}~}~None5T SParse Persist Models that are in quasi-quoters. The source could be a haskell file.Parse a Persist Model file.Parse a single Persist EntityWrap a Parser in 2 because it might fail. Useful for making choices.Parse a lowercase .Parse an uppercase .Parse an underline.,Parse strict marker "!" for haskellTypeName.*Parse lazy marker "~" for haskellTypeName.Parse any space  excluding "n".Parse a Haskell function name. It starts with underscore or lowercase letter then is followed by a combination of underscores, single quotes, letters and digits. E.g., "get", "_get", "get_1", etc.Parse a Haskell type name. It starts with an uppercase letter then is followed by a combination of underscores, single quotes, letters and digits. E.g., Person, Address,  PhoneNumber, etc.&Parse a comment that starts with "--".....NoneDRKPersistent Model types that have a corresponding Audit type as produced by  need to implement # in order to use the queries from   ,. Given the following two Persistent models: Person name String age Int Maybe PersonAudit name String age Int Maybe originalId PersonId noreference auditAction AuditAction editedBy Text editedOn UTCTime The  instance should look like this: .instance ToAudit Person where type AuditResult Person = PersonAudit toAudit v k auditAction editedBy editedOn = PersonAudit (personName v) (personAge v) k auditAction editedBy editedOn # can help automate these instances.None :<=?DR     !!"##$%&&'(()**+,--./01234566789:;<=>?@ABCDEFGGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~.persistent-audit-0.1.0.3-WYasNlGBPCASFhx6N35OC#Database.Persist.Audit.Parser.Types#Database.Persist.Audit.MongoDB.UtilDatabase.Persist.Audit.Types Database.Persist.Audit.GeneratorDatabase.Persist.Audit.ParserDatabase.Persist.Audit.ClassDatabase.Persist.Audit.QueriesgenerateAuditModelsDatabase.Persist.AuditQueriesEntityFieldLastItem FieldDefault FieldSqlRow FieldSqlType FieldMaxLen"MigrationOnlyAndSafeToRemoveOption MigrationOnly SafeToRemove$fEqEntityFieldLastItem&$fEqMigrationOnlyAndSafeToRemoveOption($fReadMigrationOnlyAndSafeToRemoveOption($fShowMigrationOnlyAndSafeToRemoveOption$fReadEntityFieldLastItem$fShowEntityFieldLastItemmongoKeyToByteStringbyteStringToMongoKey AuditActionCreateDeleteUpdateComment _getComment WhiteSpace_getWhiteSpace EntityForeign_getEntityForeignTable_getEntityForeignTypes EntityPrimary_getEntityPrimeType EntityDerive_getEntityDeriveTypes EntityUnique_getEntityUniqueName_getEntityUniqueEntityFieldNameEntityFieldType_getEntityFieldTypeText_getEntityFieldStrictness_isEntityFieldTypeList_isEntityFieldTypeMaybe StrictnessStrictExplicitStrictLazy EntityField_getEntityFieldName_getEntityFieldType_isEntityFieldMigrationOnly_isEntityFieldSafeToRemove_getEntityFieldDefault_getEntityFieldSqlRow_getEntityFieldSqlType_getEntityFieldMaxLen EntityChildEntityChildEntityFieldEntityChildEntityUniqueEntityChildEntityDeriveEntityChildEntityPrimaryEntityChildEntityForeignEntityChildCommentEntityChildWhiteSpaceEntity_getEntityName_isEntityDeriveJson_getEntitySqlTable_getEntityChildrenPersistModelFilePiecePersistModelFileEntityPersistModelFileCommentPersistModelFileWhiteSpacePersistModelFile$fEqStrictness$fShowStrictness$fReadStrictness$fEqEntityFieldType$fShowEntityFieldType$fReadEntityFieldType$fEqEntityField$fShowEntityField$fReadEntityField$fEqEntityUnique$fShowEntityUnique$fReadEntityUnique$fEqEntityDerive$fShowEntityDerive$fReadEntityDerive$fEqEntityPrimary$fShowEntityPrimary$fReadEntityPrimary$fEqEntityForeign$fShowEntityForeign$fReadEntityForeign$fEqWhiteSpace$fShowWhiteSpace$fReadWhiteSpace $fEqComment $fShowComment $fReadComment$fEqEntityChild$fShowEntityChild$fReadEntityChild $fEqEntity $fShowEntity $fReadEntity$fEqPersistModelFilePiece$fShowPersistModelFilePiece$fReadPersistModelFilePiece$fShowAuditAction$fReadAuditAction$fEqAuditAction$fOrdAuditAction$fGenericAuditAction$fToJSONAuditAction$fFromJSONAuditAction$fHashableAuditAction$fPersistFieldSqlAuditAction$fPersistFieldAuditActionForeignKeyType OriginalKey MongoKeyInSQL SQLKeyInMongoAuditGeneratorSettings childSpacingauditTagkeepEntityDerive keepComments keepSpacingforeignKeyTypedefaultSettingsprintForeignKey printTopLevelprintEntityChildgenerateToAuditInstancesprintToAuditInstanceprintModelAccessorprintIfForeignKeyAlternateprintIfForeignKeyAlternate2%printEntityFieldTypeFunctionConnectorstringEndsInIdfirstLetterToUpperCasefirstLetterToLowerCase$fEqForeignKeyType$fReadForeignKeyType$fShowForeignKeyType$fEqAuditGeneratorSettings$fReadAuditGeneratorSettings$fShowAuditGeneratorSettingsparseQuasiQuoterFileparseModelsFileparsePersistQuasiQuoters parseEntities parseEntityparseEntitySqlTable maybeOption lowerCase upperCase underlineexclamationMarktildespaceNoNewLinehaskellFunctionNamehaskellTypeNamehaskellTypeNameWithoutPrefixsingleLineCommentcollectWhiteSpaceparseEntityNameparseEntityField deleteItemsparseMigrationOnlyparseSafeToRemove%getMigrationOnlyAndSafeToRemoveOption!parseMigrationOnlyAndSafeToRemovegetFieldDefaultgetFieldSqlRowgetFieldSqlTypegetFieldMaxLengetEntityFieldLastItemParserparseFieldDefaultparseFieldSqlRowparseFieldSqlTypeparseFieldMaxLenparseEntityFieldLastItemparseEntityFieldNameparseStrictnessparseEntityFieldType parseMaybeparseEntityUniqueparseEntityUniqueName parseEntityUniqueEntityFieldNameparseEntityDeriveparseEntityPrimaryparseEntityForeignparseForeignKeyTypeToAudit AuditResulttoAuditinsertAndAuditinsertUniqueAndAuditdeleteAndAuditupdateAndAuditdeleteWhereAndAuditdeleteByAndAuditupdateWhereAndAuditrepsertAndAuditreplaceAndAuditghc-prim GHC.TypesTrue#text-1.2.2.1-9Yh8rJoh8fO2JMLWffT3QsData.Text.InternalTextbase Data.TuplefstsndGHC.BasefmapStringMaybeChar