module Hasura.RQL.DDL.Schema.Cache.Config
(
CacheStaticConfig (..),
HasCacheStaticConfig (..),
CacheDynamicConfig (..),
)
where
import Hasura.Logging (Hasura, Logger)
import Hasura.Prelude
import Hasura.RQL.Types.BackendType
import Hasura.RQL.Types.Common (SQLGenCtx)
import Hasura.RQL.Types.Metadata (MetadataDefaults)
import Hasura.RQL.Types.NamingCase (NamingCase)
import Hasura.RQL.Types.Schema.Options qualified as Options
import Hasura.Server.Types
data CacheStaticConfig = CacheStaticConfig
{ CacheStaticConfig -> MaintenanceMode ()
_cscMaintenanceMode :: MaintenanceMode (),
CacheStaticConfig -> EventingMode
_cscEventingMode :: EventingMode,
CacheStaticConfig -> ReadOnlyMode
_cscReadOnlyMode :: ReadOnlyMode,
CacheStaticConfig -> Logger Hasura
_cscLogger :: Logger Hasura,
CacheStaticConfig -> BackendType -> Bool
_cscAreNativeQueriesEnabled :: BackendType -> Bool,
CacheStaticConfig -> Bool
_cscAreStoredProceduresEnabled :: Bool
}
class (Monad m) => HasCacheStaticConfig m where
askCacheStaticConfig :: m CacheStaticConfig
instance (HasCacheStaticConfig m) => HasCacheStaticConfig (ReaderT r m) where
askCacheStaticConfig :: ReaderT r m CacheStaticConfig
askCacheStaticConfig = m CacheStaticConfig -> ReaderT r m CacheStaticConfig
forall (m :: * -> *) a. Monad m => m a -> ReaderT r m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift m CacheStaticConfig
forall (m :: * -> *). HasCacheStaticConfig m => m CacheStaticConfig
askCacheStaticConfig
instance (HasCacheStaticConfig m) => HasCacheStaticConfig (ExceptT e m) where
askCacheStaticConfig :: ExceptT e m CacheStaticConfig
askCacheStaticConfig = m CacheStaticConfig -> ExceptT e m CacheStaticConfig
forall (m :: * -> *) a. Monad m => m a -> ExceptT e m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift m CacheStaticConfig
forall (m :: * -> *). HasCacheStaticConfig m => m CacheStaticConfig
askCacheStaticConfig
instance (HasCacheStaticConfig m) => HasCacheStaticConfig (StateT s m) where
askCacheStaticConfig :: StateT s m CacheStaticConfig
askCacheStaticConfig = m CacheStaticConfig -> StateT s m CacheStaticConfig
forall (m :: * -> *) a. Monad m => m a -> StateT s m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift m CacheStaticConfig
forall (m :: * -> *). HasCacheStaticConfig m => m CacheStaticConfig
askCacheStaticConfig
data CacheDynamicConfig = CacheDynamicConfig
{ CacheDynamicConfig -> InferFunctionPermissions
_cdcFunctionPermsCtx :: Options.InferFunctionPermissions,
CacheDynamicConfig -> RemoteSchemaPermissions
_cdcRemoteSchemaPermsCtx :: Options.RemoteSchemaPermissions,
CacheDynamicConfig -> SQLGenCtx
_cdcSQLGenCtx :: SQLGenCtx,
CacheDynamicConfig -> HashSet ExperimentalFeature
_cdcExperimentalFeatures :: HashSet ExperimentalFeature,
CacheDynamicConfig -> NamingCase
_cdcDefaultNamingConvention :: NamingCase,
CacheDynamicConfig -> MetadataDefaults
_cdcMetadataDefaults :: MetadataDefaults,
CacheDynamicConfig -> ApolloFederationStatus
_cdcApolloFederationStatus :: ApolloFederationStatus,
CacheDynamicConfig -> CloseWebsocketsOnMetadataChangeStatus
_cdcCloseWebsocketsOnMetadataChangeStatus :: CloseWebsocketsOnMetadataChangeStatus
}
deriving (CacheDynamicConfig -> CacheDynamicConfig -> Bool
(CacheDynamicConfig -> CacheDynamicConfig -> Bool)
-> (CacheDynamicConfig -> CacheDynamicConfig -> Bool)
-> Eq CacheDynamicConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CacheDynamicConfig -> CacheDynamicConfig -> Bool
== :: CacheDynamicConfig -> CacheDynamicConfig -> Bool
$c/= :: CacheDynamicConfig -> CacheDynamicConfig -> Bool
/= :: CacheDynamicConfig -> CacheDynamicConfig -> Bool
Eq)