W      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUV Safe-Infered*%(Internal) Class that implements the JOIN B magic  (see ). +(Internal) Class that implements the tuple B magic (see  ). Phantom type for a SET% operation on an entity of the given  type (see < and '(=.)'). Phantom type used by #, $ and %. ((Internal) Phantom type used to process B (see ). Exception thrown whenever " is used to create an ON  clause but no matching JOIN is found. <(Internal) Functions that operate on types (that should be)  of kind  .  (Internal)  smartJoin a b is a JOIN of the correct kind. (Internal) Reify a JoinKind from a JOIN. This  function is non-strict. (Internal) A kind of JOIN. FULL OUTER JOIN RIGHT OUTER JOIN LEFT OUTER JOIN  CROSS JOIN  INNER JOINData type that represents a FULL OUTER JOIN (see  for an example). Data type that represents a RIGHT OUTER JOIN (see  for an example). Data type that represents a LEFT OUTER JOIN. For example,    select $  from $ \(person `` pet) ->  ... is translated into    SELECT ... ! FROM Person LEFT OUTER JOIN Pet  ...  See also: B. Data type that represents a  CROSS JOIN (see  for an example). Data type that represents an  INNER JOIN (see  for an example). <A single value (as opposed to a whole entity). You may use  (() or ()) to get a  from an W. "Finally tagless representation of  esqueleto's EDSL. (Internal) Start a B query with an entity. B  does two kinds of magic using ,  and   : 8 The simple but tedious magic of allowing tuples to be  used. & The more advanced magic of creating JOINs. The  JOIN1 is processed from right to left. The rightmost  entity of the JOIN is created with . Each  JOIN( step is then translated into a call to .  In the end,   is called to materialize the  JOIN. (Internal) Same as , but entity may be missing. (Internal) Do a JOIN. (Internal) Finish a JOIN. !WHERE clause: restrict the query' s result. "ON clause: restrict the a JOIN's result. The ON  clause will be applied to the last JOIN that does not  have an ON clause yet. If there are no JOIN s without  ON! clauses (either because you didn' t do any JOIN, or  because all JOINs already have their own ON clauses), a  runtime exception  is  thrown. ON! clauses are optional when doing JOINs. %On the simple case of doing just one JOIN, for example    select $  from $ \(foo `` bar) -> do ) on (foo ^. FooId ==. bar ^. BarFooId)  ... there'2s no ambiguity and the rules above just mean that  you're allowed to call " only once (as in SQL). If you  have many joins, then the "s are applied on the reverse  order that the JOINs appear. For example:    select $  from $ \(foo `` bar `` baz) -> do ) on (baz ^. BazId ==. bar ^. BarBazId) ) on (foo ^. FooId ==. bar ^. BarFooId)  ...  The order is reversed$ in order to improve composability.  For example, consider query1 and query2 below:    let query1 =  from $ \(foo `` bar) -> do / on (foo ^. FooId ==. bar ^. BarFooId)  query2 =  from $ \(mbaz `` quux) -> do ( return (mbaz ?. BazName, quux)  test1 = (,) <$> query1 <*> query2  test2 = flip (,) <$> query2 <*> query1 If the order was not reversed, then test2 would be  broken: query1's " would refer to query2's  . #ORDER BY clause. See also $ and %. $-Ascending order of this field or expression. %.Descending order of this field or expression. &Execute a subquery SELECT in an expression. 'Execute a subquery SELECT_DISTINCT in an expression. (Project a field of an entity. )/Project a field of an entity that may be null. *6Lift a constant value from Haskell-land to the query. +IS NULL comparison. , Analogous to X, promotes a value of type typ into  one of type  Maybe typ. It should hold that  val . Just  === just . val. -NULL value. .COUNT(*) value. <SET clause used on UPDATEs. Note that while it's not ( a type error to use this function on a SELECT , it will + most certainly result in a runtime error. BFROM$ clause: bring entities into scope. ;This function internally uses two type classes in order to > provide some flexibility of how you may call it. Internally = we refer to these type classes as the two different magics. &The innermost magic allows you to use from with the  following types:  expr (Entity val)$, which brings a single entity into  scope.  expr (Maybe (Entity val)), which brings a single entity  that may be NULL into scope. Used for  OUTER JOINs.  A JOIN1 of any other two types allowed by the innermost  magic, where a JOIN may be an , a , a  , a , or a .  The JOINs( have right fixity, the same as in SQL. &The outermost magic allows you to use from on any tuples of @ types supported by innermost magic (and also tuples of tuples,  and so on), up to 8-tuples. Note that using from) for the same entity twice does work and % corresponds to a self-join. You don't even need to use two  different calls to from, you may use a JOIN or a tuple. ,The following are valid examples of uses of from (the types = of the arguments of the lambda are inside square brackets):    from $ \person -> ...  from $ \(person, blogPost) -> ...  from $ \(p `` mb) -> ...  from $ \(p1 `` f `` p2) -> ...  from $ \((p1 `` f) `` p2) -> ... 5The types of the arguments to the lambdas above are,  respectively:    person % :: ( Esqueleto query expr backend  , PersistEntity Person . , PersistEntityBackend Person ~ backend  ) => expr (Entity Person)  (person, blogPost) > :: (...) => (expr (Entity Person), expr (Entity BlogPost))  (p `` mb) Q :: (...) => InnerJoin (expr (Entity Person)) (expr (Maybe (Entity BlogPost)))  (p1 `` f `` p2)  :: (...) => InnerJoin ( (expr (Entity Person)) 3 (InnerJoin (expr (Entity Follow)) 4 (expr (Entity Person)))  ((p1 `` f) `` p2) ::  :: (...) => InnerJoin 3 (InnerJoin (expr (Entity Person)) 4 (expr (Entity Follow))) ( (expr (Entity Person)) 5Note that some backends may not support all kinds of JOINs. > For example, when using the SQL backend with SQLite, it will ? not accept the last example above (which is associated to the : left, instead of being to the right) and will not accept  s or s. Z  !"#$%&'()*+,-./0123456789:;<=>?@ABYZ[\]^_`abcdefghijklmnoC  !"#$%&'()*+,-./0123456789:;<=>?@ABC !"#$%&'()*+,-./0123456789:;<=>?@AB   '  % !"#$%&'()*+,-./0123456789:;<=>?@ABYZ[\]^_`abcdefghijklmno Safe-InferedC1(Internal) Class for mapping results coming from K  into actual results. This looks very similar to RawSql, and it is! However, 7 there are some crucial differences and ultimately they're  different classes. D,(Internal) Mode of query being converted by U. I4(Internal) Backend-specific function that escapes a p. J"An expression on the SQL backend. KSQL backend for  esqueleto using q. L(Internal) Execute an  esqueleto SELECT K inside   persistent's q monad. M Execute an  esqueleto SELECT query inside  persistent's  q monad and return a r of rows. N Execute an  esqueleto SELECT query inside  persistent's  q" monad and return a list of rows. We' ve seen that B% has some magic about which kinds of ( things you may bring into scope. This N function also @ has some magic for which kinds of things you may bring back to  Haskell-land by using SqlQuery's return:  You may return a  SqlExpr (W v) for an entity v  (i.e., like the *$ in SQL), which is then returned to  Haskell-land as just Entity v.  You may return a SqlExpr (Maybe (Entity v)) for an entity  v that may be NULL, which is then returned to  Haskell-land as Maybe (Entity v) . Used for  OUTER JOINs.  You may return a  SqlExpr ( t) for a value t ! (i.e., a single column), where t is any instance of  s,, which is then returned to Haskell-land as  Value t. You may use Value to return projections of an  Entity (see (() and ())) or to return any other ' value calculated on the query (e.g., . or  &). The  SqlSelect a r( class has functional dependencies that * allow type information to flow both from a to r and ! vice-versa. This means that you'll almost never have to give  any type signatures for  esqueleto queries. For example, the  query select $ from $ \ p -> return p alone is ambiguous, but  in the context of    do ps < - select $  from $ \p ->  return p : liftIO $ mapM_ (putStrLn . personName . entityVal) ps &we are able to infer from that single personName . entityVal  function composition that the p inside the query is of type  SqlExpr (Entity Person). O Execute an  esqueleto SELECT DISTINCT query inside   persistent's q monad and return a r of  rows. P Execute an  esqueleto SELECT DISTINCT query inside   persistent's q" monad and return a list of rows. Q(Internal) Run a r of rows. R(Internal) Execute an  esqueleto statement inside   persistent's q monad. S Execute an  esqueleto DELETE query inside  persistent's  q/ monad. Note that currently there are no type 3 checks for statements that should not appear on a DELETE  query. Example of usage:    delete $  from $ \appointment -> ( where_ (appointment ^. AppointmentDate < . val now) Unlike N!, there is a useful way of using S that @ will lead to type ambiguities. If you want to delete all rows  (i.e., no ! clause), you'!ll have to use a type signature:   delete $  from $ \1(appointment :: SqlExpr (Entity Appointment)) ->  return () T Execute an  esqueleto UPDATE query inside  persistent's  q/ monad. Note that currently there are no type 3 checks for statements that should not appear on a UPDATE  query. Example of usage:   update $ p -> do = set p [ PersonAge =. just (val thisYear) -. p ^. PersonBorn ] " where_ $ isNull (p ^. PersonAge) U(Internal) Pretty prints a K into a SQL query.  Note: if you'2re curious about the SQL query being generated by   esqueleto4, instead of manually using this function (which is > possible but tedious), you may just turn on query logging of   persistent. t<You may return tuples (up to 8-tuples) and tuples of tuples  from a N query. u<You may return any single value (i.e. a single column) from  a N query. vYou may return a possibly-NULL W from a N query. wYou may return an W from a N query. xNot useful for N, but used for T and S. $CDEFGHIJKLMNOPQRSTUyz{|}~tuvwxCDEFGHIJKLMNOPQRSTUKJNMPOSTLQRUDHGFEIC CDHGFEIJKLMNOPQRSTUyz{|}~tuvwx Safe-InferedV Synonym for  that does not  clash with  esqueleto's S. VqsW!"#$%&'()*+,-./0123456789:;<=>?@ABJKMNOPSTV;!"#$%&'()*+,-./0123456789:;<=>?@ABKJNPMOSTVV       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopTqrTstuvwTUxyz{|}~TUPTTTTTTTTTTTTTTTTTTTTsTstTTTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUVTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUesqueleto-0.2.2$Database.Esqueleto.Internal.LanguageDatabase.Esqueleto.Internal.SqlDatabase.EsqueletoFromPreprocessFromUpdateOrderByPreprocessedFrom$OnClauseWithoutMatchingJoinException IsJoinKind smartJoin reifyJoinKindJoinKindFullOuterJoinKindRightOuterJoinKindLeftOuterJoinKind CrossJoinKind InnerJoinKind FullOuterJoinRightOuterJoin LeftOuterJoin CrossJoin InnerJoinValue Esqueleto fromStartfromStartMaybefromJoin fromFinishwhere_onorderByascdesc sub_selectsub_selectDistinct^.?.val isNothingjustnothing countRowsnot_==.>=.>.<=.<.!=.&&.||.+.-./.*.set=.+=.-=.*=./=.from SqlSelectModeUPDATEDELETESELECT_DISTINCTSELECTEscapeSqlExprSqlQueryrawSelectSource selectSourceselectselectDistinctSourceselectDistinct runSource rawExecutedeleteupdatetoRawSql deleteKeypersistent-1.0.1Database.Persist.StoreEntitybase Data.MaybeJust$$fFromPreprocessqueryexprbackendjoin$$fFromPreprocessqueryexprbackendexpr%$fFromPreprocessqueryexprbackendexpr0$fFromqueryexprbackend(,,,,,,,)$fFromqueryexprbackend(,,,,,,)$fFromqueryexprbackend(,,,,,)$fFromqueryexprbackend(,,,,)$fFromqueryexprbackend(,,,)$fFromqueryexprbackend(,,)$fFromqueryexprbackend(,)#$fFromqueryexprbackendFullOuterJoin$$fFromqueryexprbackendRightOuterJoin#$fFromqueryexprbackendLeftOuterJoin$fFromqueryexprbackendCrossJoin$fFromqueryexprbackendInnerJoin$fFromqueryexprbackendexpr$fFromqueryexprbackendexpr0/$fExceptionOnClauseWithoutMatchingJoinException$fIsJoinKindFullOuterJoin$fIsJoinKindRightOuterJoin$fIsJoinKindLeftOuterJoin$fIsJoinKindCrossJoin$fIsJoinKindInnerJoinDatabase.Persist.EntityDefDBNameDatabase.Persist.GenericSql.Raw SqlPersistconduit-0.5.2.3Data.Conduit.InternalSource PersistField$fSqlSelect(,)(,)$fSqlSelectSqlExprValue$fSqlSelectSqlExprMaybe$fSqlSelectSqlExprEntity$fSqlSelect()()$fSqlSelect(,,,,,,,)(,,,,,,,)$fSqlSelect(,,,,,,)(,,,,,,)$fSqlSelect(,,,,,)(,,,,,)$fSqlSelect(,,,,)(,,,,)$fSqlSelect(,,,)(,,,)$fSqlSelect(,,)(,,)$$fEsqueletoSqlQuerySqlExprSqlPersist$fMonoidWhereClause$fMonoidSideData$fApplicativeSqlQuery$fMonadSqlQuery$fFunctorSqlQueryDatabase.Persist.GenericSqlrawSql runSqlConn runSqlPoolConnectionPoolunSingleSingleRawSql%Database.Persist.GenericSql.MigrationrollbackcommitmigraterunMigrationUnsaferunMigrationSilent runMigration getMigrationprintMigrationparseMigration'parseMigration Migration unSqlPersist$Database.Persist.GenericSql.Internal Connection Statement mapToJSON listToJSON checkUniquegetJust belongsToJust belongsTo getByValueinsertBy getPersistMap PersistErrorPersistMarshalErrorPersistInvalidFieldPersistForeignConstraintUnmetPersistMongoDBErrorPersistMongoDBUnsupportedPersistExceptionZT PersistTextPersistByteString PersistInt64 PersistDouble PersistBool PersistDayPersistTimeOfDayPersistUTCTimePersistZonedTime PersistNull PersistList PersistMapPersistObjectId PersistValue SqlStringSqlInt32SqlInt64SqlRealSqlBoolSqlDaySqlTime SqlDayTimeSqlDayTimeZonedSqlBlobSqlOtherSqlType isNullablesqlTypefromPersistValuetoPersistValuepersistIdFieldpersistUniqueKeyspersistUniqueToValuespersistUniqueToFieldNames halfDefinedfromPersistValuestoPersistFields entityDefpersistFieldDefUniquePersistEntityBackend EntityField PersistEntitySomePersistFieldunKeyKey entityVal entityKeygetreplacerepsert insertKeyinsert PersistStore insertUniquedeleteBygetBy PersistUniqueEqNeGtLtGeLeInNotInBackendSpecificFilter PersistFilter deleteCascade DeleteCascaderunPoolcreatePoolConfigapplyEnv loadConfigPersistConfigPoolPersistConfigBackend PersistConfig