I usually pass :: Hasql.Pool.Pool
to serve
function as an argument through run
as an argument from main :: IO ()
But ever since I started planning to use :: BasicAuthCheck User
for authentication, I started needing :: Hasql.Pool.Pool
inside :: BasicAuthCheck User
which contains the :: BasicAuthData -> IO (BasicAuthResult User)
.
My current workaround is to create another :: Hasql.Pool.Pool
inside the :: BasicAuthData -> IO (BasicAuthResult User)
and use it to authenticate users.
Is there a more elegant way than creating another connection pool?