Add option for overriding root spec (#1317)
* Only for pg >= 9.6 * Disallow specifying schema on root-spec * Increase memory test upper bound
This commit is contained in:
+6
-1
@@ -23,7 +23,7 @@ import Test.Hspec.Wai
|
||||
import Text.Heredoc
|
||||
|
||||
import PostgREST.Config (AppConfig (..))
|
||||
import PostgREST.Types (JSPathExp (..))
|
||||
import PostgREST.Types (JSPathExp (..), QualifiedIdentifier (..))
|
||||
import Protolude
|
||||
|
||||
matchContentTypeJson :: MatchHeader
|
||||
@@ -79,6 +79,8 @@ _baseCfg = -- Connection Settings
|
||||
(Right [JSPKey "role"])
|
||||
-- Empty db-extra-search-path
|
||||
[]
|
||||
-- No root spec override
|
||||
Nothing
|
||||
|
||||
testCfg :: Text -> AppConfig
|
||||
testCfg testDbConn = _baseCfg { configDatabase = testDbConn }
|
||||
@@ -126,6 +128,9 @@ testNonexistentSchemaCfg testDbConn = (testCfg testDbConn) { configSchema = "non
|
||||
testCfgExtraSearchPath :: Text -> AppConfig
|
||||
testCfgExtraSearchPath testDbConn = (testCfg testDbConn) { configExtraSearchPath = ["public", "extensions"] }
|
||||
|
||||
testCfgRootSpec :: Text -> AppConfig
|
||||
testCfgRootSpec testDbConn = (testCfg testDbConn) { configRootSpec = Just $ QualifiedIdentifier "test" "root"}
|
||||
|
||||
setupDb :: Text -> IO ()
|
||||
setupDb dbConn = do
|
||||
loadFixture dbConn "database"
|
||||
|
||||
Reference in New Issue
Block a user