refactor: runPgLocals to Query.hs

* unmmiddleware runPgLocals
This commit is contained in:
steve-chavez
2022-09-26 17:28:08 -05:00
committed by Steve Chavez
parent e356783cc9
commit f54dc2e20e
4 changed files with 86 additions and 85 deletions
+3 -2
View File
@@ -186,8 +186,9 @@ postgrestResponse appState conf@AppConfig{..} maybeDbStructure jsonDbS pgVer Aut
pure $ Response.infoResponse (iTarget apiRequest) dbStructure
else
runDbHandler appState (Query.txMode apiRequest) (Just authRole /= configDbAnonRole) configDbPreparedStatements .
Middleware.optionalRollback conf apiRequest $
Middleware.runPgLocals conf authClaims authRole (handleRequest . ctx) apiRequest jsonDbS pgVer
Middleware.optionalRollback conf apiRequest $ do
Query.runPgLocals conf authClaims authRole apiRequest jsonDbS pgVer
handleRequest (ctx apiRequest)
runDbHandler :: AppState.AppState -> SQL.Mode -> Bool -> Bool -> DbHandler b -> Handler IO b
runDbHandler appState mode authenticated prepared handler = do