Drop support for postgres 9.4

This commit is contained in:
Wolfgang Walther
2020-10-15 08:43:28 -05:00
committed by Steve Chavez
parent 29858b8d0d
commit 719c4abba2
9 changed files with 13 additions and 49 deletions
+3 -9
View File
@@ -12,8 +12,7 @@ import Test.Hspec.Wai.JSON
import Text.Heredoc
import PostgREST.Types (PgVersion, pgVersion100, pgVersion109,
pgVersion110, pgVersion112, pgVersion114,
pgVersion95)
pgVersion110, pgVersion112, pgVersion114)
import Protolude hiding (get)
import SpecHelper
@@ -101,16 +100,11 @@ spec actualPgVersion =
get "/rpc/sayhello?any_arg=value" `shouldRespondWith` 404
it "should not ignore unknown args and fail with 404" $
get "/rpc/add_them?a=1&b=2&smthelse=blabla" `shouldRespondWith`
let
message :: Text
message
| actualPgVersion < pgVersion95 = "function test.add_them(a := integer, b := integer, smthelse := text) does not exist"
| otherwise = "function test.add_them(a => integer, b => integer, smthelse => text) does not exist"
in [json| {
[json| {
"code": "42883",
"details": null,
"hint": "No function matches the given name and argument types. You might need to add explicit type casts.",
"message": #{message} } |]
"message": "function test.add_them(a => integer, b => integer, smthelse => text) does not exist" } |]
{ matchStatus = 404
, matchHeaders = [matchContentTypeJson]
}
+4 -6
View File
@@ -15,7 +15,7 @@ import Test.Hspec
import PostgREST.App (postgrest)
import PostgREST.Config (AppConfig (..))
import PostgREST.DbStructure (getDbStructure, getPgVersion)
import PostgREST.Types (LogLevel (..), pgVersion95, pgVersion96)
import PostgREST.Types (LogLevel (..), pgVersion96)
import Protolude hiding (toList, toS)
import Protolude.Conv (toS)
import SpecHelper
@@ -98,10 +98,6 @@ main = do
analyzeTable testDbConn "items"
analyzeTable testDbConn "child_entities"
extraSpecs =
[("Feature.UpsertSpec", Feature.UpsertSpec.spec) | actualPgVersion >= pgVersion95] ++
[("Feature.PgVersion95Spec", Feature.PgVersion95Spec.spec) | actualPgVersion >= pgVersion95]
specs = uncurry describe <$> [
("Feature.AuthSpec" , Feature.AuthSpec.spec actualPgVersion)
, ("Feature.RawOutputTypesSpec" , Feature.RawOutputTypesSpec.spec)
@@ -113,7 +109,9 @@ main = do
, ("Feature.RpcSpec" , Feature.RpcSpec.spec actualPgVersion)
, ("Feature.StructureSpec" , Feature.StructureSpec.spec)
, ("Feature.AndOrParamsSpec" , Feature.AndOrParamsSpec.spec actualPgVersion)
] ++ extraSpecs
, ("Feature.UpsertSpec" , Feature.UpsertSpec.spec)
, ("Feature.PgVersion95Spec" , Feature.PgVersion95Spec.spec)
]
mutSpecs = uncurry describe <$> [
("Feature.DeleteSpec" , Feature.DeleteSpec.spec)