This PR resolves the issue of Hasql.Connection.ConnectionError being returned to the Data.Pool. Data.Pool.withResource uses an onException which is not invoked on a Left value, so in order for the pool resource destruction to take place, one has to actually throw an Exception.
Thanks. I've made some changes to your code to avoid the exception-wrapping with a lower-level integration with "resource-pool" and changed the test to not require the exposure of the constructor. See 86e5b85.
…inside Data.Pool.withResource
Firstly, TY for your great SQL-libraries!
This PR resolves the issue of
Hasql.Connection.ConnectionError
being returned to theData.Pool
.Data.Pool.withResource
uses anonException
which is not invoked on aLeft
value, so in order for the pool resource destruction to take place, one has to actually throw an Exception.