relax selectSource

This commit is contained in:
Matt Parsons 2017-09-13 17:30:28 -06:00
parent 1a945d27c8
commit 397ece45e2

View File

@ -824,9 +824,13 @@ rawSelectSource mode query =
-- | Execute an @esqueleto@ @SELECT@ query inside @persistent@'s
-- 'SqlPersistT' monad and return a 'C.Source' of rows.
selectSource :: ( SqlSelect a r
, MonadResource m )
, BackendCompatible SqlBackend backend
, IsPersistBackend backend
, PersistQueryRead backend
, PersistStoreRead backend, PersistUniqueRead backend
, MonadResource m )
=> SqlQuery a
-> C.Source (SqlPersistT m) r
-> C.Source (R.ReaderT backend m) r
selectSource query = do
res <- lift $ rawSelectSource SELECT query
(key, src) <- lift $ allocateAcquire res