nix: Update nixpkgs and build with GHC 9.4.8
This commit is contained in:
committed by
Wolfgang Walther
parent
e4c60889ee
commit
6682baebd2
@@ -247,7 +247,7 @@ jobs:
|
|||||||
Build-Cabal:
|
Build-Cabal:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
ghc: ['9.0.2', '9.2.4']
|
ghc: ['9.4.8']
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
name: Build Linux (Cabal, GHC ${{ matrix.ghc }})
|
name: Build Linux (Cabal, GHC ${{ matrix.ghc }})
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -284,7 +284,7 @@ jobs:
|
|||||||
Build-Cabal-Arm:
|
Build-Cabal-Arm:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
ghc: ['9.2.4']
|
ghc: ['9.4.8']
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
name: Build aarch64 (Cabal, GHC ${{ matrix.ghc }})
|
name: Build aarch64 (Cabal, GHC ${{ matrix.ghc }})
|
||||||
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/rel-') }}
|
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/rel-') }}
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
packages: postgrest.cabal
|
||||||
|
tests: true
|
||||||
@@ -1 +1 @@
|
|||||||
index-state: hackage.haskell.org 2023-10-13T13:54:33Z
|
index-state: hackage.haskell.org 2024-01-06T00:00:00Z
|
||||||
|
|||||||
+3
-15
@@ -5,7 +5,7 @@ let
|
|||||||
"postgrest";
|
"postgrest";
|
||||||
|
|
||||||
compiler =
|
compiler =
|
||||||
"ghc924";
|
"ghc948";
|
||||||
|
|
||||||
# PostgREST source files, filtered based on the rules in the .gitignore files
|
# PostgREST source files, filtered based on the rules in the .gitignore files
|
||||||
# and file extensions. We want to include as litte as possible, as the files
|
# and file extensions. We want to include as litte as possible, as the files
|
||||||
@@ -36,10 +36,10 @@ let
|
|||||||
allOverlays.build-toolbox
|
allOverlays.build-toolbox
|
||||||
allOverlays.checked-shell-script
|
allOverlays.checked-shell-script
|
||||||
allOverlays.gitignore
|
allOverlays.gitignore
|
||||||
allOverlays.postgis
|
|
||||||
(allOverlays.postgresql-default { inherit patches; })
|
(allOverlays.postgresql-default { inherit patches; })
|
||||||
allOverlays.postgresql-legacy
|
allOverlays.postgresql-legacy
|
||||||
allOverlays.postgresql-future
|
allOverlays.postgresql-future
|
||||||
|
allOverlays.postgis
|
||||||
(allOverlays.haskell-packages { inherit compiler; })
|
(allOverlays.haskell-packages { inherit compiler; })
|
||||||
allOverlays.slocat
|
allOverlays.slocat
|
||||||
];
|
];
|
||||||
@@ -50,19 +50,7 @@ let
|
|||||||
|
|
||||||
postgresqlVersions =
|
postgresqlVersions =
|
||||||
[
|
[
|
||||||
{
|
{ name = "postgresql-16"; postgresql = pkgs.postgresql_16.withPackages (p: [ p.postgis p.pg_safeupdate ]); }
|
||||||
name = "postgresql-16";
|
|
||||||
postgresql = pkgs.postgresql_16.withPackages (p: [
|
|
||||||
p.postgis
|
|
||||||
(p.pg_safeupdate.overrideAttrs (old: {
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/bin
|
|
||||||
cp safeupdate.dylib safeupdate.so || true
|
|
||||||
install -D safeupdate.so -t $out/lib
|
|
||||||
'';
|
|
||||||
}))
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
{ name = "postgresql-15"; postgresql = pkgs.postgresql_15.withPackages (p: [ p.postgis p.pg_safeupdate ]); }
|
{ name = "postgresql-15"; postgresql = pkgs.postgresql_15.withPackages (p: [ p.postgis p.pg_safeupdate ]); }
|
||||||
{ name = "postgresql-14"; postgresql = pkgs.postgresql_14.withPackages (p: [ p.postgis p.pg_safeupdate ]); }
|
{ name = "postgresql-14"; postgresql = pkgs.postgresql_14.withPackages (p: [ p.postgis p.pg_safeupdate ]); }
|
||||||
{ name = "postgresql-13"; postgresql = pkgs.postgresql_13.withPackages (p: [ p.postgis p.pg_safeupdate ]); }
|
{ name = "postgresql-13"; postgresql = pkgs.postgresql_13.withPackages (p: [ p.postgis p.pg_safeupdate ]); }
|
||||||
|
|||||||
+4
-5
@@ -17,7 +17,6 @@ module Main (main) where
|
|||||||
import qualified Data.Aeson as JSON
|
import qualified Data.Aeson as JSON
|
||||||
import qualified Data.ByteString.Lazy.Char8 as LBS8
|
import qualified Data.ByteString.Lazy.Char8 as LBS8
|
||||||
import qualified Data.Csv as Csv
|
import qualified Data.Csv as Csv
|
||||||
import qualified Data.List as List
|
|
||||||
import qualified Data.Map as Map
|
import qualified Data.Map as Map
|
||||||
import qualified Data.Set as Set
|
import qualified Data.Set as Set
|
||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
@@ -34,12 +33,13 @@ import Data.Function ((&))
|
|||||||
import Data.List (intercalate)
|
import Data.List (intercalate)
|
||||||
import Data.Maybe (catMaybes, mapMaybe)
|
import Data.Maybe (catMaybes, mapMaybe)
|
||||||
import Data.Text (Text)
|
import Data.Text (Text)
|
||||||
import GHC.Data.Bag (bagToList)
|
|
||||||
import GHC.Generics (Generic)
|
import GHC.Generics (Generic)
|
||||||
import GHC.Hs.Extension (GhcPs)
|
import GHC.Hs.Extension (GhcPs)
|
||||||
|
import GHC.Types.Error (getMessages)
|
||||||
import GHC.Types.Name.Occurrence (occNameString)
|
import GHC.Types.Name.Occurrence (occNameString)
|
||||||
import GHC.Types.Name.Reader (rdrNameOcc)
|
import GHC.Types.Name.Reader (rdrNameOcc)
|
||||||
import GHC.Unit.Module.Name (moduleNameString)
|
import GHC.Unit.Module.Name (moduleNameString)
|
||||||
|
import GHC.Utils.Error (pprMsgEnvelopeBagWithLoc)
|
||||||
import System.Directory.Recursive (getFilesRecursive)
|
import System.Directory.Recursive (getFilesRecursive)
|
||||||
import System.Exit (exitFailure)
|
import System.Exit (exitFailure)
|
||||||
|
|
||||||
@@ -206,7 +206,7 @@ parseModule filepath = do
|
|||||||
return $ GHC.unLoc hsmod
|
return $ GHC.unLoc hsmod
|
||||||
Left errs ->
|
Left errs ->
|
||||||
fail $ "Errors with " <> show filepath <> ":\n "
|
fail $ "Errors with " <> show filepath <> ":\n "
|
||||||
<> List.intercalate "\n " (show <$> bagToList errs)
|
<> show (pprMsgEnvelopeBagWithLoc $ getMessages errs)
|
||||||
|
|
||||||
-- | Symbols imported in an import declaration.
|
-- | Symbols imported in an import declaration.
|
||||||
--
|
--
|
||||||
@@ -250,8 +250,7 @@ dump OutputJson = encodePretty
|
|||||||
-- | Find modules that are imported under different aliases
|
-- | Find modules that are imported under different aliases
|
||||||
inconsistentAliases :: [ImportedSymbol] -> ModuleAliases
|
inconsistentAliases :: [ImportedSymbol] -> ModuleAliases
|
||||||
inconsistentAliases symbols =
|
inconsistentAliases symbols =
|
||||||
fmap moduleAlias symbols
|
foldr (insertSetMapMap . moduleAlias) Map.empty symbols
|
||||||
& foldr insertSetMapMap Map.empty
|
|
||||||
& Map.map (aliases . Map.toList)
|
& Map.map (aliases . Map.toList)
|
||||||
& Map.filter ((<) 1 . length)
|
& Map.filter ((<) 1 . length)
|
||||||
& Map.toList
|
& Map.toList
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ let
|
|||||||
ps.dir-traverse
|
ps.dir-traverse
|
||||||
ps.dot
|
ps.dot
|
||||||
ps.ghc-exactprint
|
ps.ghc-exactprint
|
||||||
|
ps.ghc-paths
|
||||||
ps.optparse-applicative
|
ps.optparse-applicative
|
||||||
];
|
];
|
||||||
ghc = ghcWithPackages modules;
|
ghc = ghcWithPackages modules;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Pinned version of Nixpkgs, generated with postgrest-nixpkgs-upgrade.
|
# Pinned version of Nixpkgs, generated with postgrest-nixpkgs-upgrade.
|
||||||
{
|
{
|
||||||
date = "2023-03-25";
|
date = "2024-01-06";
|
||||||
rev = "dbf5322e93bcc6cfc52268367a8ad21c09d76fea";
|
rev = "4bbf5a2eb6046c54f7a29a0964c642ebfe912cbc";
|
||||||
tarballHash = "0lwk4v9dkvd28xpqch0b0jrac4xl9lwm6snrnzx8k5lby72kmkng";
|
tarballHash = "03p45qdcxqxc41mmzmmyzbkff29vv95vv643z0kd3mf1s2nnsy5b";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,18 @@ let
|
|||||||
# To fill in the sha256:
|
# To fill in the sha256:
|
||||||
# update-nix-fetchgit nix/overlays/haskell-packages.nix
|
# update-nix-fetchgit nix/overlays/haskell-packages.nix
|
||||||
|
|
||||||
|
configurator-pg =
|
||||||
|
prev.callHackageDirect
|
||||||
|
{
|
||||||
|
pkg = "configurator-pg";
|
||||||
|
ver = "0.2.9";
|
||||||
|
sha256 = "sha256-UqFiOgPlksbIdHBVO0wYhCnboB+mxKJcXVhY9C1V7Hg=";
|
||||||
|
}
|
||||||
|
{ };
|
||||||
|
|
||||||
|
# Marked as broken (?)
|
||||||
|
fuzzyset = lib.markUnbroken prev.fuzzyset;
|
||||||
|
|
||||||
postgresql-libpq = lib.dontCheck
|
postgresql-libpq = lib.dontCheck
|
||||||
(prev.callCabal2nix "postgresql-libpq"
|
(prev.callCabal2nix "postgresql-libpq"
|
||||||
(super.fetchFromGitHub {
|
(super.fetchFromGitHub {
|
||||||
@@ -39,23 +51,8 @@ let
|
|||||||
})
|
})
|
||||||
{ });
|
{ });
|
||||||
|
|
||||||
hasql-notifications = lib.dontCheck
|
hasql-pool = lib.dontCheck prev.hasql-pool_0_10;
|
||||||
(prev.callHackageDirect
|
|
||||||
{
|
|
||||||
pkg = "hasql-notifications";
|
|
||||||
ver = "0.2.0.6";
|
|
||||||
sha256 = "sha256-7PyFlB2B70njudOjaX6tk1m77ol9vnF5fI0LF86kVAI=";
|
|
||||||
}
|
|
||||||
{ });
|
|
||||||
|
|
||||||
hasql-pool = lib.dontCheck
|
|
||||||
(prev.callHackageDirect
|
|
||||||
{
|
|
||||||
pkg = "hasql-pool";
|
|
||||||
ver = "0.10";
|
|
||||||
sha256 = "sha256-kHzoqtNV9BFWnn1h560JRqMooQRwxokVKgDRBexamNI=";
|
|
||||||
}
|
|
||||||
{ });
|
|
||||||
} // extraOverrides final prev;
|
} // extraOverrides final prev;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ let
|
|||||||
url = "https://download.osgeo.org/postgis/source/postgis-${version}.tar.gz";
|
url = "https://download.osgeo.org/postgis/source/postgis-${version}.tar.gz";
|
||||||
sha256 = "sha256-G02LXHVuWrpZ77wYM7Iu/k1lYneO7KVvpJf+susTZow=";
|
sha256 = "sha256-G02LXHVuWrpZ77wYM7Iu/k1lYneO7KVvpJf+susTZow=";
|
||||||
};
|
};
|
||||||
|
meta.broken = false;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,16 +4,16 @@ self: super:
|
|||||||
{
|
{
|
||||||
## Example for including a postgresql version from a specific nixpks commit:
|
## Example for including a postgresql version from a specific nixpks commit:
|
||||||
##
|
##
|
||||||
postgresql_16 =
|
# postgresql_16 =
|
||||||
let
|
# let
|
||||||
rev = "5148520bfab61f99fd25fb9ff7bfbb50dad3c9db";
|
# rev = "5148520bfab61f99fd25fb9ff7bfbb50dad3c9db";
|
||||||
tarballHash = "1dfjmz65h8z4lk845724vypzmf3dbgsdndjpj8ydlhx6c7rpcq3p";
|
# tarballHash = "1dfjmz65h8z4lk845724vypzmf3dbgsdndjpj8ydlhx6c7rpcq3p";
|
||||||
|
#
|
||||||
pinnedPkgs =
|
# pinnedPkgs =
|
||||||
builtins.fetchTarball {
|
# builtins.fetchTarball {
|
||||||
url = "https://github.com/nixos/nixpkgs/archive/${rev}.tar.gz";
|
# url = "https://github.com/nixos/nixpkgs/archive/${rev}.tar.gz";
|
||||||
sha256 = tarballHash;
|
# sha256 = tarballHash;
|
||||||
};
|
# };
|
||||||
in
|
# in
|
||||||
(import pinnedPkgs { }).pkgs.postgresql_16;
|
# (import pinnedPkgs { }).pkgs.postgresql_16;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,4 +31,19 @@ self: super:
|
|||||||
};
|
};
|
||||||
in
|
in
|
||||||
(import pinnedPkgs { }).pkgs.postgresql_10;
|
(import pinnedPkgs { }).pkgs.postgresql_10;
|
||||||
|
|
||||||
|
# PostgreSQL 11 was removed from Nixpkgs with
|
||||||
|
# https://github.com/NixOS/nixpkgs/commit/1220a4d4dd1a4590780a5e1c18d1333a121be366
|
||||||
|
# We pin its parent commit to get the last version that was available.
|
||||||
|
postgresql_11 =
|
||||||
|
let
|
||||||
|
rev = "f5458516e42cc5cb4123cc2d93f45c240548aa18";
|
||||||
|
tarballHash = "1h03621sxfhw4z6ya74k6c2lyx3z7pvf2jcg4vs7i01yz2m6w3cv";
|
||||||
|
pinnedPkgs =
|
||||||
|
builtins.fetchTarball {
|
||||||
|
url = "https://github.com/nixos/nixpkgs/archive/${rev}.tar.gz";
|
||||||
|
sha256 = tarballHash;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
(import pinnedPkgs { }).pkgs.postgresql_11;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,6 @@ final: prev:
|
|||||||
rev = "52e7512c6029fd00483e41ccce260a3b4b9b3b64";
|
rev = "52e7512c6029fd00483e41ccce260a3b4b9b3b64";
|
||||||
sha256 = "sha256-qn6luuh5wqREu3s8RfuMCP5PKdS2WdwPrujRYTpfzQ8=";
|
sha256 = "sha256-qn6luuh5wqREu3s8RfuMCP5PKdS2WdwPrujRYTpfzQ8=";
|
||||||
};
|
};
|
||||||
vendorSha256 = "sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo=";
|
vendorHash = "sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo=";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ let
|
|||||||
|
|
||||||
defaultCabalPackageVersionComingWithGhc =
|
defaultCabalPackageVersionComingWithGhc =
|
||||||
{
|
{
|
||||||
ghc924 = "Cabal_3_6_3_0";
|
ghc948 = "Cabal_3_8_1_0";
|
||||||
}."${compiler}";
|
}."${compiler}";
|
||||||
|
|
||||||
# The static-haskell-nix 'survey' derives a full static set of Haskell
|
# The static-haskell-nix 'survey' derives a full static set of Haskell
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ let
|
|||||||
}
|
}
|
||||||
''
|
''
|
||||||
find loadtest -type f -iname '*.bin' -exec ${reporter} {} \; \
|
find loadtest -type f -iname '*.bin' -exec ${reporter} {} \; \
|
||||||
| ${jq}/bin/jq '[leaf_paths as $path | {param: $path | join("."), (.branch): getpath($path)}]' \
|
| ${jq}/bin/jq '[paths(scalars) as $path | {param: $path | join("."), (.branch): getpath($path)}]' \
|
||||||
| ${jq}/bin/jq --slurp 'flatten | group_by(.param) | map(add)' \
|
| ${jq}/bin/jq --slurp 'flatten | group_by(.param) | map(add)' \
|
||||||
| ${toMarkdown}
|
| ${toMarkdown}
|
||||||
'';
|
'';
|
||||||
|
|||||||
+1
-1
@@ -132,7 +132,7 @@ let
|
|||||||
|
|
||||||
(
|
(
|
||||||
trap 'echo Found dead code: Check file list above.' ERR ;
|
trap 'echo Found dead code: Check file list above.' ERR ;
|
||||||
${weeder}/bin/weeder --config=./test/weeder.dhall
|
${weeder}/bin/weeder --config=./test/weeder.toml
|
||||||
)
|
)
|
||||||
|
|
||||||
# collect all tests
|
# collect all tests
|
||||||
|
|||||||
+10
-10
@@ -75,7 +75,7 @@ library
|
|||||||
PostgREST.Response.Performance
|
PostgREST.Response.Performance
|
||||||
PostgREST.Version
|
PostgREST.Version
|
||||||
other-modules: Paths_postgrest
|
other-modules: Paths_postgrest
|
||||||
build-depends: base >= 4.9 && < 4.17
|
build-depends: base >= 4.9 && < 4.18
|
||||||
, HTTP >= 4000.3.7 && < 4000.5
|
, HTTP >= 4000.3.7 && < 4000.5
|
||||||
, Ranged-sets >= 0.3 && < 0.5
|
, Ranged-sets >= 0.3 && < 0.5
|
||||||
, aeson >= 2.0.3 && < 2.2
|
, aeson >= 2.0.3 && < 2.2
|
||||||
@@ -93,7 +93,7 @@ library
|
|||||||
, directory >= 1.2.6 && < 1.4
|
, directory >= 1.2.6 && < 1.4
|
||||||
, either >= 4.4.1 && < 5.1
|
, either >= 4.4.1 && < 5.1
|
||||||
, extra >= 1.7.0 && < 2.0
|
, extra >= 1.7.0 && < 2.0
|
||||||
, fuzzyset >= 0.2.3
|
, fuzzyset >= 0.3.0
|
||||||
, gitrev >= 1.2 && < 1.4
|
, gitrev >= 1.2 && < 1.4
|
||||||
, hasql >= 1.6.1.1 && < 1.7
|
, hasql >= 1.6.1.1 && < 1.7
|
||||||
, hasql-dynamic-statements >= 0.3.1 && < 0.4
|
, hasql-dynamic-statements >= 0.3.1 && < 0.4
|
||||||
@@ -118,11 +118,11 @@ library
|
|||||||
, scientific >= 0.3.4 && < 0.4
|
, scientific >= 0.3.4 && < 0.4
|
||||||
, streaming-commons >= 0.1.1 && < 0.3
|
, streaming-commons >= 0.1.1 && < 0.3
|
||||||
, swagger2 >= 2.4 && < 2.9
|
, swagger2 >= 2.4 && < 2.9
|
||||||
, text >= 1.2.2 && < 1.3
|
, text >= 1.2.2 && < 2.1
|
||||||
, time >= 1.6 && < 1.12
|
, time >= 1.6 && < 1.13
|
||||||
, timeit >= 2.0 && < 2.1
|
, timeit >= 2.0 && < 2.1
|
||||||
, unordered-containers >= 0.2.8 && < 0.3
|
, unordered-containers >= 0.2.8 && < 0.3
|
||||||
, unix-compat >= 0.5.4 && < 0.6
|
, unix-compat >= 0.5.4 && < 0.8
|
||||||
, vault >= 0.3.1.5 && < 0.4
|
, vault >= 0.3.1.5 && < 0.4
|
||||||
, vector >= 0.11 && < 0.14
|
, vector >= 0.11 && < 0.14
|
||||||
, wai >= 3.2.1 && < 3.3
|
, wai >= 3.2.1 && < 3.3
|
||||||
@@ -159,7 +159,7 @@ executable postgrest
|
|||||||
NoImplicitPrelude
|
NoImplicitPrelude
|
||||||
hs-source-dirs: main
|
hs-source-dirs: main
|
||||||
main-is: Main.hs
|
main-is: Main.hs
|
||||||
build-depends: base >= 4.9 && < 4.17
|
build-depends: base >= 4.9 && < 4.18
|
||||||
, containers >= 0.5.7 && < 0.7
|
, containers >= 0.5.7 && < 0.7
|
||||||
, postgrest
|
, postgrest
|
||||||
, protolude >= 0.3.1 && < 0.4
|
, protolude >= 0.3.1 && < 0.4
|
||||||
@@ -233,7 +233,7 @@ test-suite spec
|
|||||||
Feature.RollbackSpec
|
Feature.RollbackSpec
|
||||||
Feature.RpcPreRequestGucsSpec
|
Feature.RpcPreRequestGucsSpec
|
||||||
SpecHelper
|
SpecHelper
|
||||||
build-depends: base >= 4.9 && < 4.17
|
build-depends: base >= 4.9 && < 4.18
|
||||||
, aeson >= 2.0.3 && < 2.2
|
, aeson >= 2.0.3 && < 2.2
|
||||||
, aeson-qq >= 0.8.1 && < 0.9
|
, aeson-qq >= 0.8.1 && < 0.9
|
||||||
, async >= 2.1.1 && < 2.3
|
, async >= 2.1.1 && < 2.3
|
||||||
@@ -245,7 +245,7 @@ test-suite spec
|
|||||||
, hasql-pool >= 0.10 && < 0.11
|
, hasql-pool >= 0.10 && < 0.11
|
||||||
, hasql-transaction >= 1.0.1 && < 1.1
|
, hasql-transaction >= 1.0.1 && < 1.1
|
||||||
, heredoc >= 0.2 && < 0.3
|
, heredoc >= 0.2 && < 0.3
|
||||||
, hspec >= 2.3 && < 2.10
|
, hspec >= 2.3 && < 2.11
|
||||||
, hspec-wai >= 0.10 && < 0.12
|
, hspec-wai >= 0.10 && < 0.12
|
||||||
, hspec-wai-json >= 0.10 && < 0.12
|
, hspec-wai-json >= 0.10 && < 0.12
|
||||||
, http-types >= 0.12.3 && < 0.13
|
, http-types >= 0.12.3 && < 0.13
|
||||||
@@ -257,7 +257,7 @@ test-suite spec
|
|||||||
, protolude >= 0.3.1 && < 0.4
|
, protolude >= 0.3.1 && < 0.4
|
||||||
, regex-tdfa >= 1.2.2 && < 1.4
|
, regex-tdfa >= 1.2.2 && < 1.4
|
||||||
, scientific >= 0.3.4 && < 0.4
|
, scientific >= 0.3.4 && < 0.4
|
||||||
, text >= 1.2.2 && < 1.3
|
, text >= 1.2.2 && < 2.1
|
||||||
, transformers-base >= 0.4.4 && < 0.5
|
, transformers-base >= 0.4.4 && < 0.5
|
||||||
, wai >= 3.2.1 && < 3.3
|
, wai >= 3.2.1 && < 3.3
|
||||||
, wai-extra >= 3.0.19 && < 3.2
|
, wai-extra >= 3.0.19 && < 3.2
|
||||||
@@ -275,7 +275,7 @@ test-suite doctests
|
|||||||
NoImplicitPrelude
|
NoImplicitPrelude
|
||||||
hs-source-dirs: test/doc
|
hs-source-dirs: test/doc
|
||||||
main-is: Main.hs
|
main-is: Main.hs
|
||||||
build-depends: base >= 4.9 && < 4.17
|
build-depends: base >= 4.9 && < 4.18
|
||||||
, doctest >= 0.8
|
, doctest >= 0.8
|
||||||
, postgrest
|
, postgrest
|
||||||
, pretty-simple
|
, pretty-simple
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ module PostgREST.Error
|
|||||||
import qualified Data.Aeson as JSON
|
import qualified Data.Aeson as JSON
|
||||||
import qualified Data.ByteString.Char8 as BS
|
import qualified Data.ByteString.Char8 as BS
|
||||||
import qualified Data.CaseInsensitive as CI
|
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.HashMap.Strict as HM
|
||||||
import qualified Data.Map.Internal as M
|
import qualified Data.Map.Internal as M
|
||||||
import qualified Data.Text as T
|
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
|
findParent = HM.lookup (QualifiedIdentifier schema parent, schema) allRels
|
||||||
fuzzySetOfParents = Fuzzy.fromList [qiName (fst p) | p <- HM.keys allRels, snd p == schema]
|
fuzzySetOfParents = Fuzzy.fromList [qiName (fst p) | p <- HM.keys allRels, snd p == schema]
|
||||||
fuzzySetOfChildren = Fuzzy.fromList [qiName (relForeignTable c) | c <- fromMaybe [] findParent]
|
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)
|
-- 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
|
-- 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)"
|
-- E.g. ["val", "param", "name"] into "(name, param, val)"
|
||||||
listToText = ("(" <>) . (<> ")") . T.intercalate ", " . sort
|
listToText = ("(" <>) . (<> ")") . T.intercalate ", " . sort
|
||||||
possibleProcs
|
possibleProcs
|
||||||
| null overloadedProcs = Fuzzy.getOne fuzzySetOfProcs procName
|
| null overloadedProcs = snd <$> Fuzzy.findOne procName fuzzySetOfProcs
|
||||||
| otherwise = (procName <>) <$> Fuzzy.getOne fuzzySetOfParams (listToText params)
|
| otherwise = (procName <>) . snd <$> Fuzzy.findOne (listToText params) fuzzySetOfParams
|
||||||
|
|
||||||
compressedRel :: Relationship -> JSON.Value
|
compressedRel :: Relationship -> JSON.Value
|
||||||
-- An ambiguousness error cannot happen for computed relationships TODO refactor so this mempty is not needed
|
-- An ambiguousness error cannot happen for computed relationships TODO refactor so this mempty is not needed
|
||||||
|
|||||||
+4
-1
@@ -1,4 +1,4 @@
|
|||||||
resolver: lts-20.6 # 2023-01-09, GHC 9.2.5
|
resolver: lts-21.7 # 2023-08-14, GHC 9.4.5
|
||||||
|
|
||||||
nix:
|
nix:
|
||||||
packages:
|
packages:
|
||||||
@@ -10,7 +10,10 @@ nix:
|
|||||||
pure: false
|
pure: false
|
||||||
|
|
||||||
extra-deps:
|
extra-deps:
|
||||||
|
- configurator-pg-0.2.7
|
||||||
- git: https://github.com/PostgREST/postgresql-libpq.git
|
- git: https://github.com/PostgREST/postgresql-libpq.git
|
||||||
commit: 890a0a16cf57dd401420fdc6c7d576fb696003bc
|
commit: 890a0a16cf57dd401420fdc6c7d576fb696003bc
|
||||||
- hasql-notifications-0.2.0.6
|
- hasql-notifications-0.2.0.6
|
||||||
- hasql-pool-0.10
|
- hasql-pool-0.10
|
||||||
|
- fuzzyset-0.3.1
|
||||||
|
- megaparsec-9.2.2
|
||||||
|
|||||||
+25
-4
@@ -4,6 +4,13 @@
|
|||||||
# https://docs.haskellstack.org/en/stable/lock_files
|
# https://docs.haskellstack.org/en/stable/lock_files
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
|
- completed:
|
||||||
|
hackage: configurator-pg-0.2.7@sha256:7327ce30c3b6bc50930efa73e2e215c8f62857564483edbbe5a75920057ef764,2849
|
||||||
|
pantry-tree:
|
||||||
|
sha256: 023bd4835a7ac2624c44d3bbb26e99000994ce953d11d853c0f194278983d4dc
|
||||||
|
size: 2463
|
||||||
|
original:
|
||||||
|
hackage: configurator-pg-0.2.7
|
||||||
- completed:
|
- completed:
|
||||||
commit: 890a0a16cf57dd401420fdc6c7d576fb696003bc
|
commit: 890a0a16cf57dd401420fdc6c7d576fb696003bc
|
||||||
git: https://github.com/PostgREST/postgresql-libpq.git
|
git: https://github.com/PostgREST/postgresql-libpq.git
|
||||||
@@ -29,9 +36,23 @@ packages:
|
|||||||
size: 346
|
size: 346
|
||||||
original:
|
original:
|
||||||
hackage: hasql-pool-0.10
|
hackage: hasql-pool-0.10
|
||||||
|
- completed:
|
||||||
|
hackage: fuzzyset-0.3.1@sha256:344e16deedb43da5cabae558450e5710843cff7ac2f3073be9db453c6f3a3fb7,2373
|
||||||
|
pantry-tree:
|
||||||
|
sha256: 89e22c2ce70a7c7c4b599ffe2546cda5699e4f8f15410eac49f39af8c4c381c8
|
||||||
|
size: 643
|
||||||
|
original:
|
||||||
|
hackage: fuzzyset-0.3.1
|
||||||
|
- completed:
|
||||||
|
hackage: megaparsec-9.2.2@sha256:c306a135ec25d91d252032c6128f03598a00e87ea12fcf5fc4878fdffc75c768,3219
|
||||||
|
pantry-tree:
|
||||||
|
sha256: db9715d6910e64d3bbfce69895042a66fcdcd64a54805563834bf0821562b74f
|
||||||
|
size: 1518
|
||||||
|
original:
|
||||||
|
hackage: megaparsec-9.2.2
|
||||||
snapshots:
|
snapshots:
|
||||||
- completed:
|
- completed:
|
||||||
sha256: 4905c93319aa94aa53da8f41d614d7bacdbfe6c63a8c6132d32e6e62f24a9af4
|
sha256: 23bb9bb355bfdb1635252e120a29b712f0d5e8a6c6a65c5ab5bd6692f46c438e
|
||||||
size: 649315
|
size: 640457
|
||||||
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/20/6.yaml
|
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/21/7.yaml
|
||||||
original: lts-20.6
|
original: lts-21.7
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
roots = [ "^Main.main$", "^Paths_" ],
|
|
||||||
type-class-roots = True
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
roots = [ "^Main.main$", "^Paths_" ]
|
||||||
|
type-class-roots = true
|
||||||
Reference in New Issue
Block a user