nix: Update nixpkgs and build with GHC 9.4.8

This commit is contained in:
Wolfgang Walther
2024-01-18 18:54:33 +01:00
committed by Wolfgang Walther
parent e4c60889ee
commit 6682baebd2
21 changed files with 107 additions and 82 deletions
+5 -5
View File
@@ -17,7 +17,7 @@ module PostgREST.Error
import qualified Data.Aeson as JSON
import qualified Data.ByteString.Char8 as BS
import qualified Data.CaseInsensitive as CI
import qualified Data.FuzzySet as Fuzzy
import qualified Data.FuzzySet.Simple as Fuzzy
import qualified Data.HashMap.Strict as HM
import qualified Data.Map.Internal as M
import qualified Data.Text as T
@@ -293,9 +293,9 @@ noRelBetweenHint parent child schema allRels = ("Perhaps you meant '" <>) <$>
findParent = HM.lookup (QualifiedIdentifier schema parent, schema) allRels
fuzzySetOfParents = Fuzzy.fromList [qiName (fst p) | p <- HM.keys allRels, snd p == schema]
fuzzySetOfChildren = Fuzzy.fromList [qiName (relForeignTable c) | c <- fromMaybe [] findParent]
suggestParent = Fuzzy.getOne fuzzySetOfParents parent
suggestParent = snd <$> Fuzzy.findOne parent fuzzySetOfParents
-- Do not give suggestion if the child is found in the relations (weight = 1.0)
suggestChild = headMay [snd k | k <- Fuzzy.get fuzzySetOfChildren child, fst k < 1.0]
suggestChild = headMay [snd k | k <- Fuzzy.find child fuzzySetOfChildren, fst k < 1.0]
-- |
-- If no function is found with the given name, it does a fuzzy search to all the functions
@@ -345,8 +345,8 @@ noRpcHint schema procName params allProcs overloadedProcs =
-- E.g. ["val", "param", "name"] into "(name, param, val)"
listToText = ("(" <>) . (<> ")") . T.intercalate ", " . sort
possibleProcs
| null overloadedProcs = Fuzzy.getOne fuzzySetOfProcs procName
| otherwise = (procName <>) <$> Fuzzy.getOne fuzzySetOfParams (listToText params)
| null overloadedProcs = snd <$> Fuzzy.findOne procName fuzzySetOfProcs
| otherwise = (procName <>) . snd <$> Fuzzy.findOne (listToText params) fuzzySetOfParams
compressedRel :: Relationship -> JSON.Value
-- An ambiguousness error cannot happen for computed relationships TODO refactor so this mempty is not needed