{-# LANGUAGE ExistentialQuantification #-}{-# LANGUAGE TypeFamilies #-}{-# LANGUAGE FlexibleContexts #-}moduleDatabase.Persist(moduleDatabase.Persist.Class,moduleDatabase.Persist.Types-- * query combinators,(=.),(+=.),(-=.),(*=.),(/=.),(==.),(!=.),(<.),(>.),(<=.),(>=.),(<-.),(/<-.),(||.)-- * JSON Utilities,listToJSON,mapToJSON,getPersistMap-- * Other utililities,limitOffsetOrder)whereimportDatabase.Persist.TypesimportDatabase.Persist.ClassimportDatabase.Persist.Class.PersistField(getPersistMap)importqualifiedData.TextasTimportData.Text.Lazy(toStrict)importData.Text.Lazy.Builder(toLazyText)importData.Aeson(toJSON)importData.Aeson.Encode(fromValue)infixr3=.,+=.,-=.,*=.,/=.(=.),(+=.),(-=.),(*=.),(/=.)::forallvtyp.PersistFieldtyp=>EntityFieldvtyp->typ->Updatev-- | assign a field a valuef=.a=UpdatefaAssign-- | assign a field by addition (+=)f+=.a=UpdatefaAdd-- | assign a field by subtraction (-=)f-=.a=UpdatefaSubtract-- | assign a field by multiplication (*=)f*=.a=UpdatefaMultiply-- | assign a field by division (/=)f/=.a=UpdatefaDivideinfix4==.,<.,<=.,>.,>=.,!=.(==.),(!=.),(<.),(<=.),(>.),(>=.)::forallvtyp.PersistFieldtyp=>EntityFieldvtyp->typ->Filtervf==.a=Filterf(Lefta)Eqf!=.a=Filterf(Lefta)Nef<.a=Filterf(Lefta)Ltf<=.a=Filterf(Lefta)Lef>.a=Filterf(Lefta)Gtf>=.a=Filterf(Lefta)Geinfix4<-.,/<-.(<-.),(/<-.)::forallvtyp.PersistFieldtyp=>EntityFieldvtyp->[typ]->Filterv-- | Inf<-.a=Filterf(Righta)In-- | NotInf/<-.a=Filterf(Righta)NotIninfixl3||.(||.)::forallv.[Filterv]->[Filterv]->[Filterv]-- | the OR of two lists of filtersa||.b=[FilterOr[FilterAnda,FilterAndb]]listToJSON::[PersistValue]->T.TextlistToJSON=toStrict.toLazyText.fromValue.toJSONmapToJSON::[(T.Text,PersistValue)]->T.TextmapToJSON=toStrict.toLazyText.fromValue.toJSONlimitOffsetOrder::PersistEntityval=>[SelectOptval]->(Int,Int,[SelectOptval])limitOffsetOrderopts=foldrgo(0,0,[])optswherego(LimitTol)(_,b,c)=(l,b,c)go(OffsetByo)(a,_,c)=(a,o,c)gox(a,b,c)=(a,b,x:c)