Fix #1141, app.settings resetting on pool timeout (#1169)

* Add test for ensuring app.settings don't reset
This commit is contained in:
Steve Chávez
2018-08-20 11:02:03 -05:00
committed by GitHub
parent 0a1d83ce8f
commit 30b5859b28
9 changed files with 49 additions and 45 deletions
+3 -3
View File
@@ -23,7 +23,7 @@ module PostgREST.QueryBuilder (
, requestToCountQuery
, unquoted
, ResultsWithCount
, pgFmtEnvVar
, pgFmtSetLocal
) where
import qualified Hasql.Query as H
@@ -469,8 +469,8 @@ pgFmtAs fName jp Nothing = case jOp <$> lastMay jp of
Nothing -> ""
pgFmtAs _ _ (Just alias) = " AS " <> pgFmtIdent alias
pgFmtEnvVar :: Text -> (Text, Text) -> SqlFragment
pgFmtEnvVar prefix (k, v) =
pgFmtSetLocal :: Text -> (Text, Text) -> SqlFragment
pgFmtSetLocal prefix (k, v) =
"set local " <> pgFmtIdent (prefix <> k) <> " = " <> pgFmtLit v <> ";"
trimNullChars :: Text -> Text