generated from tpl/purs
fix: relax class constraints
This commit is contained in:
parent
8350bc1c4a
commit
1a96e2e6d8
@ -22,7 +22,6 @@ import Data.Tuple.Nested (type (/\), (/\))
|
|||||||
import Effect.Aff.Class (class MonadAff)
|
import Effect.Aff.Class (class MonadAff)
|
||||||
import Effect.Aff.Unlift (class MonadUnliftAff)
|
import Effect.Aff.Unlift (class MonadUnliftAff)
|
||||||
import Effect.Class (class MonadEffect, liftEffect)
|
import Effect.Class (class MonadEffect, liftEffect)
|
||||||
import Effect.Postgres.Error as E
|
|
||||||
import Effect.Unlift (class MonadUnliftEffect)
|
import Effect.Unlift (class MonadUnliftEffect)
|
||||||
|
|
||||||
data Move
|
data Move
|
||||||
@ -119,7 +118,7 @@ instance (MonadSession m) => MonadCursor (CursorT t m) t where
|
|||||||
RowsAffected n' <- query $ ("move relative $1 from " <> cur) /\ n
|
RowsAffected n' <- query $ ("move relative $1 from " <> cur) /\ n
|
||||||
pure n'
|
pure n'
|
||||||
|
|
||||||
instance (MonadThrow E.E m, MonadSession m) => MonadSession (CursorT t m) where
|
instance (MonadSession m) => MonadSession (CursorT t m) where
|
||||||
query = lift <<< query
|
query = lift <<< query
|
||||||
exec = lift <<< exec
|
exec = lift <<< exec
|
||||||
exec_ = lift <<< exec_
|
exec_ = lift <<< exec_
|
||||||
|
@ -2,7 +2,7 @@ module Control.Monad.Postgres.Session where
|
|||||||
|
|
||||||
import Prelude hiding (join)
|
import Prelude hiding (join)
|
||||||
|
|
||||||
import Control.Monad.Error.Class (class MonadError, class MonadThrow, catchError, throwError)
|
import Control.Monad.Error.Class (class MonadError, catchError, throwError)
|
||||||
import Control.Monad.Fork.Class (class MonadBracket)
|
import Control.Monad.Fork.Class (class MonadBracket)
|
||||||
import Control.Monad.Morph (hoist)
|
import Control.Monad.Morph (hoist)
|
||||||
import Control.Monad.Reader (ask)
|
import Control.Monad.Reader (ask)
|
||||||
@ -44,7 +44,7 @@ instance MonadStartSession Client where
|
|||||||
endSession _ _ = pure unit
|
endSession _ _ = pure unit
|
||||||
|
|
||||||
-- | A monad representing a connected session to a database
|
-- | A monad representing a connected session to a database
|
||||||
class (MonadThrow E.E m, MonadAff m) <= MonadSession m where
|
class MonadAff m <= MonadSession m where
|
||||||
-- | Executes a query and unmarshals the result into `r`
|
-- | Executes a query and unmarshals the result into `r`
|
||||||
query :: forall q r. AsQuery q => FromRows r => q -> m r
|
query :: forall q r. AsQuery q => FromRows r => q -> m r
|
||||||
-- | Executes a query and returns the number of rows affected
|
-- | Executes a query and returns the number of rows affected
|
||||||
|
Loading…
Reference in New Issue
Block a user