beam-postgres 0.3.0.0 → 0.3.1.0
raw patch · 3 files changed
+16/−5 lines, 3 files
Files
- ChangeLog.md +4/−0
- Database/Beam/Postgres/Connection.hs +11/−4
- beam-postgres.cabal +1/−1
ChangeLog.md view
@@ -1,3 +1,7 @@+# 0.3.1.0++Add `runBeamPostgres` and `runBeamPostgresDebug` functions.+ # 0.3.0.0 Initial hackage beam-postgres
Database/Beam/Postgres/Connection.hs view
@@ -14,6 +14,8 @@ ( PgRowReadError(..), PgError(..) , Pg(..), PgF(..) + , runBeamPostgres, runBeamPostgresDebug+ , pgRenderSyntax, runPgRowReader, getFields , withPgDebug@@ -300,11 +302,16 @@ instance MonadIO Pg where liftIO x = liftF (PgLiftIO x id) +runBeamPostgresDebug :: (String -> IO ()) -> Pg.Connection -> Pg a -> IO a+runBeamPostgresDebug dbg conn action =+ withPgDebug dbg conn action >>= either throwIO pure++runBeamPostgres :: Pg.Connection -> Pg a -> IO a+runBeamPostgres = runBeamPostgresDebug (\_ -> pure ())+ instance MonadBeam PgCommandSyntax Postgres Pg.Connection Pg where- withDatabase conn action =- withPgDebug (\_ -> pure ()) conn action >>= either throwIO pure- withDatabaseDebug dbg conn action =- withPgDebug dbg conn action >>= either throwIO pure+ withDatabase = runBeamPostgres+ withDatabaseDebug = runBeamPostgresDebug runReturningMany cmd consume = liftF (PgRunReturning cmd consume id)
beam-postgres.cabal view
@@ -1,5 +1,5 @@ name: beam-postgres-version: 0.3.0.0+version: 0.3.1.0 synopsis: Connection layer between beam and postgres description: Beam driver for <https://www.postgresql.org/ PostgreSQL>, an advanced open-source RDBMS homepage: http://tathougies.github.io/beam/user-guide/backends/beam-postgres