graphql-engine/server/src-lib/Hasura/RQL/DDL/Deps.hs
Rakesh Emmadi 29f2ddc289 server: support separate metadata database and server code setup for multi sources (#197)
This is an incremental PR towards https://github.com/hasura/graphql-engine/pull/5797

Co-authored-by: Anon Ray <ecthiender@users.noreply.github.com>
GitOrigin-RevId: a6cb8c239b2ff840a0095e78845f682af0e588a9
2020-12-28 12:56:55 +00:00

25 lines
659 B
Haskell

module Hasura.RQL.DDL.Deps
( reportDeps
, reportDepsExt
)
where
import Hasura.Prelude
import Data.Text.Extended
import Hasura.RQL.Types
reportDeps :: (QErrM m) => [SchemaObjId] -> m ()
reportDeps deps =
throw400 DependencyError $
"cannot drop due to the following dependent objects : "
<> reportSchemaObjs deps
reportDepsExt :: (QErrM m) => [SchemaObjId] -> [Text] -> m ()
reportDepsExt deps unknownDeps =
throw400 DependencyError $
"cannot drop due to the following dependent objects : " <> depObjsTxt
where
depObjsTxt = commaSeparated $ reportSchemaObjs deps:unknownDeps