Hoogle Search
Within LTS Haskell 24.2 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
esqueleto Database.Esqueleto Get all records matching the given criterion in the specified order. Returns also the identifiers. NOTE: This function returns an Acquire and a ConduitM, which implies that it streams from the database. It does not. Please use selectList to simplify the code. If you want streaming behavior, consider persistent-pagination which efficiently chunks a query into ranges, or investigate a backend-specific streaming solution.
-
esqueleto Database.Esqueleto.Experimental Get just the first record for the criterion.
-
esqueleto Database.Esqueleto.Experimental Get the Keys of all records matching the given criterion. For an example, see selectList.
-
esqueleto Database.Esqueleto.Experimental Get the Keys of all records matching the given criterion.
-
esqueleto Database.Esqueleto.Experimental Execute an esqueleto SELECT query inside persistent's SqlPersistT monad and return the first entry wrapped in a Maybe. @since 3.5.1.0
Example usage
firstPerson :: MonadIO m => SqlPersistT m (Maybe (Entity Person)) firstPerson = selectOne $ do person <- from $ table @Person return person
The above query is equivalent to a select combined with limit but you would still have to transform the results from a list:firstPerson :: MonadIO m => SqlPersistT m [Entity Person] firstPerson = select $ do person <- from $ table @Person limit 1 return person
selectQuery :: (SqlSelect a r, ToAlias a, ToAliasReference a) => SqlQuery a -> From aesqueleto Database.Esqueleto.Experimental Select from a subquery, often used in conjuction with joins but can be used without any joins. Because SqlQuery has a ToFrom instance you probably dont need to use this function directly.
select $ p <- from $ selectQuery do p <- from $ table @Person limit 5 orderBy [ asc p ^. PersonAge ] ...
-
esqueleto Database.Esqueleto.Experimental Execute an esqueleto SELECT query inside persistent's SqlPersistT monad and return a Source of rows.
-
esqueleto Database.Esqueleto.Experimental Get all records matching the given criterion in the specified order. Returns also the identifiers. NOTE: This function returns an Acquire and a ConduitM, which implies that it streams from the database. It does not. Please use selectList to simplify the code. If you want streaming behavior, consider persistent-pagination which efficiently chunks a query into ranges, or investigate a backend-specific streaming solution.
selectQuery :: (SqlSelect a r, ToAlias a, ToAliasReference a) => SqlQuery a -> From aesqueleto Database.Esqueleto.Experimental.From Select from a subquery, often used in conjuction with joins but can be used without any joins. Because SqlQuery has a ToFrom instance you probably dont need to use this function directly.
select $ p <- from $ selectQuery do p <- from $ table @Person limit 5 orderBy [ asc p ^. PersonAge ] ...
-
esqueleto Database.Esqueleto.Internal.Internal Execute an esqueleto SELECT query inside persistent's SqlPersistT monad and return the first entry wrapped in a Maybe. @since 3.5.1.0
Example usage
firstPerson :: MonadIO m => SqlPersistT m (Maybe (Entity Person)) firstPerson = selectOne $ do person <- from $ table @Person return person
The above query is equivalent to a select combined with limit but you would still have to transform the results from a list:firstPerson :: MonadIO m => SqlPersistT m [Entity Person] firstPerson = select $ do person <- from $ table @Person limit 1 return person