polysemy-hasql-0.0.1.0: Polysemy effects for databases
Safe HaskellSafe-Inferred
LanguageHaskell2010

Polysemy.Hasql.Interpreter.Database

Synopsis

Documentation

releaseBadConnection :: Members [DbConnectionPool !! DbConnectionError, AtomicState ConnectionState, Stop DbError, Log, Lock, Embed IO] r => ConnectionTag -> Connection -> Sem r () Source #

After a computation failed, the Postgres connection needs to be health-checked. If the status is ConnectionBad, remove the connection from the state and release it, causing the next call to acquireConnection to request a new one.

It is conceivable for the connection to be stuck in a startup phase like ConnectionSSLStartup, but since hasql only uses a connection that is fully established, it shouldn't happen.

TODO Can't hurt to investigate this anyway.