2018-06-27 16:11:32 +03:00
|
|
|
module Hasura.RQL.DDL.Deps
|
2020-12-28 15:56:00 +03:00
|
|
|
( reportDeps
|
2018-06-27 16:11:32 +03:00
|
|
|
, reportDepsExt
|
|
|
|
)
|
|
|
|
where
|
|
|
|
|
|
|
|
import Hasura.Prelude
|
|
|
|
|
2020-10-21 19:35:06 +03:00
|
|
|
import Data.Text.Extended
|
2018-06-27 16:11:32 +03:00
|
|
|
|
|
|
|
import Hasura.RQL.Types
|
|
|
|
|
|
|
|
reportDeps :: (QErrM m) => [SchemaObjId] -> m ()
|
|
|
|
reportDeps deps =
|
|
|
|
throw400 DependencyError $
|
|
|
|
"cannot drop due to the following dependent objects : "
|
|
|
|
<> reportSchemaObjs deps
|
|
|
|
|
2020-10-27 16:53:49 +03:00
|
|
|
reportDepsExt :: (QErrM m) => [SchemaObjId] -> [Text] -> m ()
|
2018-06-27 16:11:32 +03:00
|
|
|
reportDepsExt deps unknownDeps =
|
|
|
|
throw400 DependencyError $
|
|
|
|
"cannot drop due to the following dependent objects : " <> depObjsTxt
|
|
|
|
where
|
2020-10-21 19:35:06 +03:00
|
|
|
depObjsTxt = commaSeparated $ reportSchemaObjs deps:unknownDeps
|