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.

  1. selectSourceRes :: forall record (m1 :: Type -> Type) (m2 :: Type -> Type) . (PersistQueryRead backend, PersistRecordBackend record backend, MonadIO m1, MonadIO m2) => [Filter record] -> [SelectOpt record] -> ReaderT backend m1 (Acquire (ConduitM () (Entity record) m2 ()))

    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.

  2. selectFirst :: forall (m :: Type -> Type) record . (PersistQueryRead backend, MonadIO m, PersistRecordBackend record backend) => [Filter record] -> [SelectOpt record] -> ReaderT backend m (Maybe (Entity record))

    esqueleto Database.Esqueleto.Experimental

    Get just the first record for the criterion.

  3. selectKeys :: forall record backend (m :: Type -> Type) . (PersistQueryRead backend, MonadResource m, PersistRecordBackend record backend, MonadReader backend m) => [Filter record] -> [SelectOpt record] -> ConduitM () (Key record) m ()

    esqueleto Database.Esqueleto.Experimental

    Get the Keys of all records matching the given criterion. For an example, see selectList.

  4. selectKeysRes :: forall (m1 :: Type -> Type) (m2 :: Type -> Type) record . (PersistQueryRead backend, MonadIO m1, MonadIO m2, PersistRecordBackend record backend) => [Filter record] -> [SelectOpt record] -> ReaderT backend m1 (Acquire (ConduitM () (Key record) m2 ()))

    esqueleto Database.Esqueleto.Experimental

    Get the Keys of all records matching the given criterion.

  5. selectOne :: forall a r (m :: Type -> Type) backend . (SqlSelect a r, MonadIO m, SqlBackendCanRead backend) => SqlQuery a -> ReaderT backend m (Maybe r)

    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
    

  6. selectQuery :: (SqlSelect a r, ToAlias a, ToAliasReference a) => SqlQuery a -> From a

    esqueleto 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 ]
    ...
    

  7. selectSource :: forall a r backend (m :: Type -> Type) . (SqlSelect a r, BackendCompatible SqlBackend backend, IsPersistBackend backend, PersistQueryRead backend, PersistStoreRead backend, PersistUniqueRead backend, MonadResource m) => SqlQuery a -> ConduitT () r (ReaderT backend m) ()

    esqueleto Database.Esqueleto.Experimental

    Execute an esqueleto SELECT query inside persistent's SqlPersistT monad and return a Source of rows.

  8. selectSourceRes :: forall record (m1 :: Type -> Type) (m2 :: Type -> Type) . (PersistQueryRead backend, PersistRecordBackend record backend, MonadIO m1, MonadIO m2) => [Filter record] -> [SelectOpt record] -> ReaderT backend m1 (Acquire (ConduitM () (Entity record) m2 ()))

    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.

  9. selectQuery :: (SqlSelect a r, ToAlias a, ToAliasReference a) => SqlQuery a -> From a

    esqueleto 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 ]
    ...
    

  10. selectOne :: forall a r (m :: Type -> Type) backend . (SqlSelect a r, MonadIO m, SqlBackendCanRead backend) => SqlQuery a -> ReaderT backend m (Maybe r)

    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
    

Page 2 of many | Previous | Next