Hoogle Search

Within LTS Haskell 24.3 (ghc-9.10.2)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. 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.Internal.Internal

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

  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.Legacy

    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.Legacy

    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.Legacy

    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.Legacy

    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. 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.Legacy

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

  7. 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.Legacy

    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.

  8. insertSelect :: forall (m :: Type -> Type) a backend . (MonadIO m, PersistEntity a, SqlBackendCanWrite backend) => SqlQuery (SqlExpr (Insertion a)) -> ReaderT backend m ()

    esqueleto Database.Esqueleto

    Insert a PersistField for every selected value.

  9. insertSelectCount :: forall (m :: Type -> Type) a backend . (MonadIO m, PersistEntity a, SqlBackendCanWrite backend) => SqlQuery (SqlExpr (Insertion a)) -> ReaderT backend m Int64

    esqueleto Database.Esqueleto

    Insert a PersistField for every selected value, return the count afterward

  10. renderQuerySelect :: forall a r backend (m :: Type -> Type) . (SqlSelect a r, BackendCompatible SqlBackend backend, Monad m) => SqlQuery a -> ReaderT backend m (Text, [PersistValue])

    esqueleto Database.Esqueleto

    Renders a SqlQuery into a Text value along with the list of PersistValues that would be supplied to the database for ? placeholders.

Page 3 of many | Previous | Next