i hate this
This commit is contained in:
parent
6a6a63cb97
commit
303c65f187
@ -1451,8 +1451,26 @@ migrateIt = do
|
|||||||
cleanUniques
|
cleanUniques
|
||||||
|
|
||||||
withConn :: RunDbMonad m => (SqlBackend -> R.ResourceT m a) -> m a
|
withConn :: RunDbMonad m => (SqlBackend -> R.ResourceT m a) -> m a
|
||||||
withConn =
|
withConn f = do
|
||||||
R.runResourceT . withPostgresqlConn "host=localhost port=5432 user=esqutest password=esqutest dbname=esqutest"
|
ea <- try go
|
||||||
|
case ea of
|
||||||
|
Left (SomeException se) -> do
|
||||||
|
ea' <- try go
|
||||||
|
case ea' of
|
||||||
|
Left (SomeException se1) ->
|
||||||
|
if show se == show se1
|
||||||
|
then throwM se
|
||||||
|
else throwM se1
|
||||||
|
Right a ->
|
||||||
|
pure a
|
||||||
|
Right a ->
|
||||||
|
pure a
|
||||||
|
where
|
||||||
|
go =
|
||||||
|
R.runResourceT $
|
||||||
|
withPostgresqlConn
|
||||||
|
"host=localhost port=5432 user=esqutest password=esqutest dbname=esqutest"
|
||||||
|
f
|
||||||
|
|
||||||
-- | Show the SQL generated by a query
|
-- | Show the SQL generated by a query
|
||||||
showQuery :: (Monad m, ES.SqlSelect a r, BackendCompatible SqlBackend backend)
|
showQuery :: (Monad m, ES.SqlSelect a r, BackendCompatible SqlBackend backend)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user