diff --git a/src/Database/Esqueleto/Internal/Sql.hs b/src/Database/Esqueleto/Internal/Sql.hs index 4d272b5..1322c38 100644 --- a/src/Database/Esqueleto/Internal/Sql.hs +++ b/src/Database/Esqueleto/Internal/Sql.hs @@ -781,9 +781,12 @@ veryUnsafeCoerceSqlExprValueList EEmptyList = throw (UnexpectedCaseErr EmptySqlE ---------------------------------------------------------------------- -type SqlReadT' m a - = forall backend - . (BackendCompatible SqlBackend backend, SqlBackendCanRead backend) +type SqlReadT' m a = forall backend. + ( BackendCompatible SqlBackend backend + , IsPersistBackend backend + , PersistQueryRead backend + , PersistStoreRead backend, PersistUniqueRead backend + ) => R.ReaderT backend m a -- | (Internal) Execute an @esqueleto@ @SELECT@ 'SqlQuery' inside @@ -799,7 +802,7 @@ rawSelectSource mode query = do conn <- projectBackend <$> R.ask let _ = conn :: SqlBackend - res <- run conn + res <- R.withReaderT (const conn) (run conn) return $ (C.$= massage) `fmap` res where