upgrade to hasql-1.6, hasql-pool-0.8.0.2

- hasql-pool-0.8
  * 'release' now flushes the pool, and no longer destroys it;
    'PoolIsReleasedUsageError' is gone compared to our fork
  * now supports an acquisition timeout, which we don't use
    yet
  * lower bound on 0.8.0.2 to fix a Windows build issue
- hasql-1.6
  introduces a position parameter to ServerError, which we
  ignore
This commit is contained in:
Robert Vollmert
2022-08-30 20:59:26 +02:00
committed by Robert
parent 81f42d4b8a
commit e2aa227597
9 changed files with 92 additions and 55 deletions
+2 -2
View File
@@ -97,7 +97,7 @@ destroy = destroyPool
initPool :: AppConfig -> IO SQL.Pool
initPool AppConfig{..} =
SQL.acquire configDbPoolSize $ toUtf8 configDbUri
SQL.acquire configDbPoolSize Nothing $ toUtf8 configDbUri
-- | Run an action with a database connection.
usePool :: AppState -> SQL.Session a -> IO (Either SQL.UsageError a)
@@ -106,7 +106,7 @@ usePool AppState{..} = SQL.use statePool
-- | Flush the connection pool so that any future use of the pool will
-- use connections freshly established after this call.
flushPool :: AppState -> IO ()
flushPool AppState{..} = SQL.flush statePool
flushPool AppState{..} = SQL.release statePool
-- | Destroy the pool on shutdown.
destroyPool :: AppState -> IO ()