Upgrade protolude to 0.3.1 (#2306)
This commit is contained in:
@@ -32,6 +32,15 @@ let
|
|||||||
# To get the sha256:
|
# To get the sha256:
|
||||||
# nix-prefetch-url --unpack https://github.com/<owner>/<repo>/archive/<commit>.tar.gz
|
# nix-prefetch-url --unpack https://github.com/<owner>/<repo>/archive/<commit>.tar.gz
|
||||||
|
|
||||||
|
protolude =
|
||||||
|
prev.callHackageDirect
|
||||||
|
{
|
||||||
|
pkg = "protolude";
|
||||||
|
ver = "0.3.1";
|
||||||
|
sha256 = "0gf0mn1ycllr69kdq1p07qf7935s10jz0nnhynwqy3d6nmycxr5j";
|
||||||
|
}
|
||||||
|
{ };
|
||||||
|
|
||||||
wai-extra =
|
wai-extra =
|
||||||
prev.callHackageDirect
|
prev.callHackageDirect
|
||||||
{
|
{
|
||||||
|
|||||||
+5
-5
@@ -98,7 +98,7 @@ library
|
|||||||
, network-uri >= 2.6.1 && < 2.8
|
, network-uri >= 2.6.1 && < 2.8
|
||||||
, optparse-applicative >= 0.13 && < 0.17
|
, optparse-applicative >= 0.13 && < 0.17
|
||||||
, parsec >= 3.1.11 && < 3.2
|
, parsec >= 3.1.11 && < 3.2
|
||||||
, protolude >= 0.3 && < 0.4
|
, protolude >= 0.3.1 && < 0.4
|
||||||
, regex-tdfa >= 1.2.2 && < 1.4
|
, regex-tdfa >= 1.2.2 && < 1.4
|
||||||
, retry >= 0.7.4 && < 0.10
|
, retry >= 0.7.4 && < 0.10
|
||||||
, scientific >= 0.3.4 && < 0.4
|
, scientific >= 0.3.4 && < 0.4
|
||||||
@@ -143,7 +143,7 @@ executable postgrest
|
|||||||
build-depends: base >= 4.9 && < 4.16
|
build-depends: base >= 4.9 && < 4.16
|
||||||
, containers >= 0.5.7 && < 0.7
|
, containers >= 0.5.7 && < 0.7
|
||||||
, postgrest
|
, postgrest
|
||||||
, protolude >= 0.3 && < 0.4
|
, protolude >= 0.3.1 && < 0.4
|
||||||
ghc-options: -threaded -rtsopts "-with-rtsopts=-N -I0 -qg"
|
ghc-options: -threaded -rtsopts "-with-rtsopts=-N -I0 -qg"
|
||||||
-O2 -Werror -Wall -fwarn-identities
|
-O2 -Werror -Wall -fwarn-identities
|
||||||
-fno-spec-constr -optP-Wno-nonportable-include-path
|
-fno-spec-constr -optP-Wno-nonportable-include-path
|
||||||
@@ -223,7 +223,7 @@ test-suite spec
|
|||||||
, monad-control >= 1.0.1 && < 1.1
|
, monad-control >= 1.0.1 && < 1.1
|
||||||
, postgrest
|
, postgrest
|
||||||
, process >= 1.4.2 && < 1.7
|
, process >= 1.4.2 && < 1.7
|
||||||
, protolude >= 0.3 && < 0.4
|
, protolude >= 0.3.1 && < 0.4
|
||||||
, regex-tdfa >= 1.2.2 && < 1.4
|
, regex-tdfa >= 1.2.2 && < 1.4
|
||||||
, text >= 1.2.2 && < 1.3
|
, text >= 1.2.2 && < 1.3
|
||||||
, transformers-base >= 0.4.4 && < 0.5
|
, transformers-base >= 0.4.4 && < 0.5
|
||||||
@@ -264,7 +264,7 @@ test-suite querycost
|
|||||||
, lens-aeson >= 1.0.1 && < 1.2
|
, lens-aeson >= 1.0.1 && < 1.2
|
||||||
, postgrest
|
, postgrest
|
||||||
, process >= 1.4.2 && < 1.7
|
, process >= 1.4.2 && < 1.7
|
||||||
, protolude >= 0.3 && < 0.4
|
, protolude >= 0.3.1 && < 0.4
|
||||||
, regex-tdfa >= 1.2.2 && < 1.4
|
, regex-tdfa >= 1.2.2 && < 1.4
|
||||||
, wai-extra >= 3.0.19 && < 3.2
|
, wai-extra >= 3.0.19 && < 3.2
|
||||||
ghc-options: -O0 -Werror -Wall -fwarn-identities
|
ghc-options: -O0 -Werror -Wall -fwarn-identities
|
||||||
@@ -284,6 +284,6 @@ test-suite doctests
|
|||||||
, doctest >= 0.8
|
, doctest >= 0.8
|
||||||
, postgrest
|
, postgrest
|
||||||
, pretty-simple
|
, pretty-simple
|
||||||
, protolude >= 0.3 && < 0.4
|
, protolude >= 0.3.1 && < 0.4
|
||||||
ghc-options: -threaded -O0 -Werror -Wall -fwarn-identities
|
ghc-options: -threaded -O0 -Werror -Wall -fwarn-identities
|
||||||
-fno-spec-constr -optP-Wno-nonportable-include-path
|
-fno-spec-constr -optP-Wno-nonportable-include-path
|
||||||
|
|||||||
@@ -369,17 +369,17 @@ parser optPath env dbSettings =
|
|||||||
|
|
||||||
coerceInt :: (Read i, Integral i) => C.Value -> Maybe i
|
coerceInt :: (Read i, Integral i) => C.Value -> Maybe i
|
||||||
coerceInt (C.Number x) = rightToMaybe $ floatingOrInteger x
|
coerceInt (C.Number x) = rightToMaybe $ floatingOrInteger x
|
||||||
coerceInt (C.String x) = readMaybe $ toS x
|
coerceInt (C.String x) = readMaybe x
|
||||||
coerceInt _ = Nothing
|
coerceInt _ = Nothing
|
||||||
|
|
||||||
coerceBool :: C.Value -> Maybe Bool
|
coerceBool :: C.Value -> Maybe Bool
|
||||||
coerceBool (C.Bool b) = Just b
|
coerceBool (C.Bool b) = Just b
|
||||||
coerceBool (C.String s) =
|
coerceBool (C.String s) =
|
||||||
-- parse all kinds of text: True, true, TRUE, "true", ...
|
-- parse all kinds of text: True, true, TRUE, "true", ...
|
||||||
case readMaybe . toS $ T.toTitle $ T.filter isAlpha $ toS s of
|
case readMaybe $ T.toTitle $ T.filter isAlpha $ toS s of
|
||||||
Just b -> Just b
|
Just b -> Just b
|
||||||
-- numeric instead?
|
-- numeric instead?
|
||||||
Nothing -> (> 0) <$> (readMaybe $ toS s :: Maybe Integer)
|
Nothing -> (> 0) <$> (readMaybe s :: Maybe Integer)
|
||||||
coerceBool _ = Nothing
|
coerceBool _ = Nothing
|
||||||
|
|
||||||
splitOnCommas :: C.Value -> [Text]
|
splitOnCommas :: C.Value -> [Text]
|
||||||
|
|||||||
@@ -364,9 +364,9 @@ userApiRequest conf@AppConfig{..} dbStructure req reqBody
|
|||||||
headerRange = rangeRequested hdrs
|
headerRange = rangeRequested hdrs
|
||||||
replaceLast x s = T.intercalate "." $ L.init (T.split (=='.') s) ++ [x]
|
replaceLast x s = T.intercalate "." $ L.init (T.split (=='.') s) ++ [x]
|
||||||
limitParams :: M.HashMap Text NonnegRange
|
limitParams :: M.HashMap Text NonnegRange
|
||||||
limitParams = M.fromList [(toS (replaceLast "limit" k), restrictRange (readMaybe . toS =<< v) allRange) | (k,v) <- qParams, isJust v, endingIn ["limit"] k]
|
limitParams = M.fromList [(toS (replaceLast "limit" k), restrictRange (readMaybe =<< v) allRange) | (k,v) <- qParams, isJust v, endingIn ["limit"] k]
|
||||||
offsetParams :: M.HashMap Text NonnegRange
|
offsetParams :: M.HashMap Text NonnegRange
|
||||||
offsetParams = M.fromList [(toS (replaceLast "limit" k), maybe allRange rangeGeq (readMaybe . toS =<< v)) | (k,v) <- qParams, isJust v, endingIn ["offset"] k]
|
offsetParams = M.fromList [(toS (replaceLast "limit" k), maybe allRange rangeGeq (readMaybe =<< v)) | (k,v) <- qParams, isJust v, endingIn ["offset"] k]
|
||||||
|
|
||||||
urlRange = M.unionWith f limitParams offsetParams
|
urlRange = M.unionWith f limitParams offsetParams
|
||||||
where
|
where
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ import PostgREST.Request.Types
|
|||||||
|
|
||||||
import qualified PostgREST.DbStructure.Relationship as Relationship
|
import qualified PostgREST.DbStructure.Relationship as Relationship
|
||||||
|
|
||||||
import Protolude hiding (from)
|
import Protolude hiding (from, isInfixOf)
|
||||||
|
|
||||||
-- | Builds the ReadRequest tree on a number of stages.
|
-- | Builds the ReadRequest tree on a number of stages.
|
||||||
-- | Adds filters, order, limits on its respective nodes.
|
-- | Adds filters, order, limits on its respective nodes.
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ nix:
|
|||||||
extra-deps:
|
extra-deps:
|
||||||
- hasql-dynamic-statements-0.3.1@sha256:c3a2c89c4a8b3711368dbd33f0ccfe46a493faa7efc2c85d3e354c56a01dfc48,2673
|
- hasql-dynamic-statements-0.3.1@sha256:c3a2c89c4a8b3711368dbd33f0ccfe46a493faa7efc2c85d3e354c56a01dfc48,2673
|
||||||
- hasql-implicits-0.1.0.2@sha256:5d54e09cb779a209681b139fb3cc726bae75134557932156340cc0a56dd834a8,1361
|
- hasql-implicits-0.1.0.2@sha256:5d54e09cb779a209681b139fb3cc726bae75134557932156340cc0a56dd834a8,1361
|
||||||
|
- protolude-0.3.1@sha256:1cc9e5a5c26c33a43c52b554443dd9779fef13974eaa0beec7ca6d2551b400da,2647
|
||||||
- ptr-0.16.8.1@sha256:525219ec5f5da5c699725f7efcef91b00a7d44120fc019878b85c09440bf51d6,2686
|
- ptr-0.16.8.1@sha256:525219ec5f5da5c699725f7efcef91b00a7d44120fc019878b85c09440bf51d6,2686
|
||||||
- wai-extra-3.1.8@sha256:bf3dbe8f4c707b502b2a88262ed71c807220651597b76b56983f864af6197890,7280
|
- wai-extra-3.1.8@sha256:bf3dbe8f4c707b502b2a88262ed71c807220651597b76b56983f864af6197890,7280
|
||||||
- wai-logger-2.3.7@sha256:19a0dc5122e22d274776d80786fb9501956f5e75b8f82464bbdad5604d154d82,1671
|
- wai-logger-2.3.7@sha256:19a0dc5122e22d274776d80786fb9501956f5e75b8f82464bbdad5604d154d82,1671
|
||||||
|
|||||||
+19
-5
@@ -5,40 +5,54 @@
|
|||||||
|
|
||||||
packages:
|
packages:
|
||||||
- completed:
|
- completed:
|
||||||
hackage: hasql-dynamic-statements-0.3.1@sha256:c3a2c89c4a8b3711368dbd33f0ccfe46a493faa7efc2c85d3e354c56a01dfc48,2673
|
|
||||||
pantry-tree:
|
pantry-tree:
|
||||||
sha256: b1b9a6a26ec765e5fe29f9a670a5c9ec7067ea00dee8491f0819284ff0201b6f
|
sha256: b1b9a6a26ec765e5fe29f9a670a5c9ec7067ea00dee8491f0819284ff0201b6f
|
||||||
size: 641
|
size: 641
|
||||||
|
hackage: hasql-dynamic-statements-0.3.1@sha256:c3a2c89c4a8b3711368dbd33f0ccfe46a493faa7efc2c85d3e354c56a01dfc48,2673
|
||||||
original:
|
original:
|
||||||
hackage: hasql-dynamic-statements-0.3.1@sha256:c3a2c89c4a8b3711368dbd33f0ccfe46a493faa7efc2c85d3e354c56a01dfc48,2673
|
hackage: hasql-dynamic-statements-0.3.1@sha256:c3a2c89c4a8b3711368dbd33f0ccfe46a493faa7efc2c85d3e354c56a01dfc48,2673
|
||||||
- completed:
|
- completed:
|
||||||
hackage: hasql-implicits-0.1.0.2@sha256:5d54e09cb779a209681b139fb3cc726bae75134557932156340cc0a56dd834a8,1361
|
|
||||||
pantry-tree:
|
pantry-tree:
|
||||||
sha256: 2f00d1467d0e226b966c2cd7bac433c8948e2f7bbdf8a44936029f66fc20b5f3
|
sha256: 2f00d1467d0e226b966c2cd7bac433c8948e2f7bbdf8a44936029f66fc20b5f3
|
||||||
size: 310
|
size: 310
|
||||||
|
hackage: hasql-implicits-0.1.0.2@sha256:5d54e09cb779a209681b139fb3cc726bae75134557932156340cc0a56dd834a8,1361
|
||||||
original:
|
original:
|
||||||
hackage: hasql-implicits-0.1.0.2@sha256:5d54e09cb779a209681b139fb3cc726bae75134557932156340cc0a56dd834a8,1361
|
hackage: hasql-implicits-0.1.0.2@sha256:5d54e09cb779a209681b139fb3cc726bae75134557932156340cc0a56dd834a8,1361
|
||||||
- completed:
|
- completed:
|
||||||
hackage: ptr-0.16.8.1@sha256:525219ec5f5da5c699725f7efcef91b00a7d44120fc019878b85c09440bf51d6,2686
|
pantry-tree:
|
||||||
|
sha256: 6452a6ca8d395f7d810139779bb0fd16fc1dbb00f1862630bc08ef5a100430f9
|
||||||
|
size: 1645
|
||||||
|
hackage: protolude-0.3.1@sha256:1cc9e5a5c26c33a43c52b554443dd9779fef13974eaa0beec7ca6d2551b400da,2647
|
||||||
|
original:
|
||||||
|
hackage: protolude-0.3.1@sha256:1cc9e5a5c26c33a43c52b554443dd9779fef13974eaa0beec7ca6d2551b400da,2647
|
||||||
|
- completed:
|
||||||
pantry-tree:
|
pantry-tree:
|
||||||
sha256: d2b8440a738719ef8430ec38fe33b129e3940e4ccf2c016a727a1110a43656bb
|
sha256: d2b8440a738719ef8430ec38fe33b129e3940e4ccf2c016a727a1110a43656bb
|
||||||
size: 1089
|
size: 1089
|
||||||
|
hackage: ptr-0.16.8.1@sha256:525219ec5f5da5c699725f7efcef91b00a7d44120fc019878b85c09440bf51d6,2686
|
||||||
original:
|
original:
|
||||||
hackage: ptr-0.16.8.1@sha256:525219ec5f5da5c699725f7efcef91b00a7d44120fc019878b85c09440bf51d6,2686
|
hackage: ptr-0.16.8.1@sha256:525219ec5f5da5c699725f7efcef91b00a7d44120fc019878b85c09440bf51d6,2686
|
||||||
- completed:
|
- completed:
|
||||||
hackage: wai-extra-3.1.8@sha256:bf3dbe8f4c707b502b2a88262ed71c807220651597b76b56983f864af6197890,7280
|
|
||||||
pantry-tree:
|
pantry-tree:
|
||||||
sha256: a544ea95288d188e893322a8e6d68f2b1f844f772dbea1f26e5c0c1a74694f56
|
sha256: a544ea95288d188e893322a8e6d68f2b1f844f772dbea1f26e5c0c1a74694f56
|
||||||
size: 4053
|
size: 4053
|
||||||
|
hackage: wai-extra-3.1.8@sha256:bf3dbe8f4c707b502b2a88262ed71c807220651597b76b56983f864af6197890,7280
|
||||||
original:
|
original:
|
||||||
hackage: wai-extra-3.1.8@sha256:bf3dbe8f4c707b502b2a88262ed71c807220651597b76b56983f864af6197890,7280
|
hackage: wai-extra-3.1.8@sha256:bf3dbe8f4c707b502b2a88262ed71c807220651597b76b56983f864af6197890,7280
|
||||||
- completed:
|
- completed:
|
||||||
hackage: wai-logger-2.3.7@sha256:19a0dc5122e22d274776d80786fb9501956f5e75b8f82464bbdad5604d154d82,1671
|
|
||||||
pantry-tree:
|
pantry-tree:
|
||||||
sha256: 52b5abf5c4c09bcfbc06e01f761a75c32cbd3e6ba23c8843981933fcc31ed53c
|
sha256: 52b5abf5c4c09bcfbc06e01f761a75c32cbd3e6ba23c8843981933fcc31ed53c
|
||||||
size: 474
|
size: 474
|
||||||
|
hackage: wai-logger-2.3.7@sha256:19a0dc5122e22d274776d80786fb9501956f5e75b8f82464bbdad5604d154d82,1671
|
||||||
original:
|
original:
|
||||||
hackage: wai-logger-2.3.7@sha256:19a0dc5122e22d274776d80786fb9501956f5e75b8f82464bbdad5604d154d82,1671
|
hackage: wai-logger-2.3.7@sha256:19a0dc5122e22d274776d80786fb9501956f5e75b8f82464bbdad5604d154d82,1671
|
||||||
|
- completed:
|
||||||
|
pantry-tree:
|
||||||
|
sha256: 99ff839445ba2c9e29a294b45904e3f4575336c7d2b4504ce310d611661c761d
|
||||||
|
size: 3973
|
||||||
|
hackage: warp-3.3.19@sha256:c6a47029537d42844386170d732cdfe6d85b2f4279bbaefdd9b50caff6faeebb,10910
|
||||||
|
original:
|
||||||
|
hackage: warp-3.3.19@sha256:c6a47029537d42844386170d732cdfe6d85b2f4279bbaefdd9b50caff6faeebb,10910
|
||||||
snapshots:
|
snapshots:
|
||||||
- completed:
|
- completed:
|
||||||
sha256: 87842ecbaa8ca9cee59a7e6be52369dbed82ed075cb4e0d152614a627e8fd488
|
sha256: 87842ecbaa8ca9cee59a7e6be52369dbed82ed075cb4e0d152614a627e8fd488
|
||||||
|
|||||||
Reference in New Issue
Block a user