Safe Haskell | None |
---|---|
Language | Haskell2010 |
Types/functions shared between modules that implement Hasura.RQL.DDL.Schema.Cache. Other modules should not import this module directly.
Synopsis
- data InvalidationKeys = InvalidationKeys {
- _ikMetadata :: InvalidationKey
- _ikRemoteSchemas :: HashMap RemoteSchemaName InvalidationKey
- _ikSources :: HashMap SourceName InvalidationKey
- ikSources :: Lens' InvalidationKeys (HashMap SourceName InvalidationKey)
- ikRemoteSchemas :: Lens' InvalidationKeys (HashMap RemoteSchemaName InvalidationKey)
- ikMetadata :: Lens' InvalidationKeys InvalidationKey
- initialInvalidationKeys :: InvalidationKeys
- invalidateKeys :: CacheInvalidations -> InvalidationKeys -> InvalidationKeys
- data TableBuildInput b = TableBuildInput {}
- data NonColumnTableInputs b = NonColumnTableInputs {}
- data TablePermissionInputs b = TablePermissionInputs {
- _tpiTable :: TableName b
- _tpiInsert :: [InsPermDef b]
- _tpiSelect :: [SelPermDef b]
- _tpiUpdate :: [UpdPermDef b]
- _tpiDelete :: [DelPermDef b]
- mkTableInputs :: TableMetadata b -> (TableBuildInput b, NonColumnTableInputs b, TablePermissionInputs b)
- data BuildOutputs = BuildOutputs {
- _boSources :: SourceCache
- _boActions :: ActionCache
- _boRemoteSchemas :: HashMap RemoteSchemaName (RemoteSchemaCtx, MetadataObject)
- _boAllowlist :: InlinedAllowlist
- _boCustomTypes :: AnnotatedCustomTypes
- _boCronTriggers :: HashMap TriggerName CronTriggerInfo
- _boEndpoints :: HashMap EndpointName (EndpointMetadata GQLQueryWithText)
- _boApiLimits :: ApiLimit
- _boMetricsConfig :: MetricsConfig
- _boRoles :: HashMap RoleName Role
- _boTlsAllowlist :: [TlsAllow]
- _boQueryCollections :: QueryCollections
- boTlsAllowlist :: Lens' BuildOutputs [TlsAllow]
- boSources :: Lens' BuildOutputs SourceCache
- boRoles :: Lens' BuildOutputs (HashMap RoleName Role)
- boRemoteSchemas :: Lens' BuildOutputs (HashMap RemoteSchemaName (RemoteSchemaCtx, MetadataObject))
- boQueryCollections :: Lens' BuildOutputs QueryCollections
- boMetricsConfig :: Lens' BuildOutputs MetricsConfig
- boEndpoints :: Lens' BuildOutputs (HashMap EndpointName (EndpointMetadata GQLQueryWithText))
- boCustomTypes :: Lens' BuildOutputs AnnotatedCustomTypes
- boCronTriggers :: Lens' BuildOutputs (HashMap TriggerName CronTriggerInfo)
- boApiLimits :: Lens' BuildOutputs ApiLimit
- boAllowlist :: Lens' BuildOutputs InlinedAllowlist
- boActions :: Lens' BuildOutputs ActionCache
- data CacheBuildParams = CacheBuildParams {}
- newtype CacheBuild a = CacheBuild (ReaderT CacheBuildParams (ExceptT QErr IO) a)
- runCacheBuild :: (MonadIO m, MonadError QErr m) => CacheBuildParams -> CacheBuild a -> m a
- runCacheBuildM :: (MonadIO m, MonadError QErr m, HasHttpManagerM m, HasServerConfigCtx m, MonadResolveSource m) => CacheBuild a -> m a
- data RebuildableSchemaCache = RebuildableSchemaCache {}
- bindErrorA :: (ArrowChoice arr, ArrowKleisli m arr, ArrowError e arr, MonadError e m) => arr (m a) a
- withRecordDependencies :: ArrowWriter (Seq CollectedInfo) arr => WriterA (Seq SchemaDependency) arr (e, s) a -> arr (e, (MetadataObject, (SchemaObjId, s))) a
- noDuplicates :: MonadWriter (Seq CollectedInfo) m => (a -> MetadataObject) -> [a] -> m (Maybe a)
- buildInfoMap :: (ArrowChoice arr, ArrowDistribute arr, ArrowWriter (Seq CollectedInfo) arr, Eq k, Hashable k) => (a -> k) -> (a -> MetadataObject) -> ((e, a) `arr` Maybe b) -> (e, [a]) `arr` HashMap k b
- buildInfoMapPreservingMetadata :: (ArrowChoice arr, ArrowDistribute arr, ArrowWriter (Seq CollectedInfo) arr, Eq k, Hashable k) => (a -> k) -> (a -> MetadataObject) -> ((e, a) `arr` Maybe b) -> (e, [a]) `arr` HashMap k (b, MetadataObject)
- addTableContext :: Backend b => TableName b -> Text -> Text
Documentation
data InvalidationKeys Source #
InvalidationKeys
used to apply requested CacheInvalidations
.
InvalidationKeys | |
|
Instances
ikSources :: Lens' InvalidationKeys (HashMap SourceName InvalidationKey) Source #
ikRemoteSchemas :: Lens' InvalidationKeys (HashMap RemoteSchemaName InvalidationKey) Source #
ikMetadata :: Lens' InvalidationKeys InvalidationKey Source #
data TableBuildInput b Source #
Instances
data NonColumnTableInputs b Source #
Instances
data TablePermissionInputs b Source #
TablePermissionInputs | |
|
Instances
mkTableInputs :: TableMetadata b -> (TableBuildInput b, NonColumnTableInputs b, TablePermissionInputs b) Source #
data BuildOutputs Source #
The direct output of buildSchemaCacheRule
. Contains most of the things necessary to build a
schema cache, but dependencies and inconsistent metadata objects are collected via a separate
MonadWriter
side channel.
BuildOutputs | |
|
boTlsAllowlist :: Lens' BuildOutputs [TlsAllow] Source #
boSources :: Lens' BuildOutputs SourceCache Source #
boRemoteSchemas :: Lens' BuildOutputs (HashMap RemoteSchemaName (RemoteSchemaCtx, MetadataObject)) Source #
boMetricsConfig :: Lens' BuildOutputs MetricsConfig Source #
boEndpoints :: Lens' BuildOutputs (HashMap EndpointName (EndpointMetadata GQLQueryWithText)) Source #
boCustomTypes :: Lens' BuildOutputs AnnotatedCustomTypes Source #
boCronTriggers :: Lens' BuildOutputs (HashMap TriggerName CronTriggerInfo) Source #
boApiLimits :: Lens' BuildOutputs ApiLimit Source #
boAllowlist :: Lens' BuildOutputs InlinedAllowlist Source #
boActions :: Lens' BuildOutputs ActionCache Source #
data CacheBuildParams Source #
Parameters required for schema cache build
CacheBuildParams | |
|
Instances
MonadReader CacheBuildParams CacheBuild Source # | |
Defined in Hasura.RQL.DDL.Schema.Cache.Common ask :: CacheBuild CacheBuildParams # local :: (CacheBuildParams -> CacheBuildParams) -> CacheBuild a -> CacheBuild a # reader :: (CacheBuildParams -> a) -> CacheBuild a # |
newtype CacheBuild a Source #
The monad in which @RebuildableSchemaCache
is being run
Instances
runCacheBuild :: (MonadIO m, MonadError QErr m) => CacheBuildParams -> CacheBuild a -> m a Source #
runCacheBuildM :: (MonadIO m, MonadError QErr m, HasHttpManagerM m, HasServerConfigCtx m, MonadResolveSource m) => CacheBuild a -> m a Source #
bindErrorA :: (ArrowChoice arr, ArrowKleisli m arr, ArrowError e arr, MonadError e m) => arr (m a) a Source #
withRecordDependencies :: ArrowWriter (Seq CollectedInfo) arr => WriterA (Seq SchemaDependency) arr (e, s) a -> arr (e, (MetadataObject, (SchemaObjId, s))) a Source #
noDuplicates :: MonadWriter (Seq CollectedInfo) m => (a -> MetadataObject) -> [a] -> m (Maybe a) Source #
buildInfoMap :: (ArrowChoice arr, ArrowDistribute arr, ArrowWriter (Seq CollectedInfo) arr, Eq k, Hashable k) => (a -> k) -> (a -> MetadataObject) -> ((e, a) `arr` Maybe b) -> (e, [a]) `arr` HashMap k b Source #
Processes a list of catalog metadata into a map of processed information, marking any duplicate entries inconsistent.
buildInfoMapPreservingMetadata :: (ArrowChoice arr, ArrowDistribute arr, ArrowWriter (Seq CollectedInfo) arr, Eq k, Hashable k) => (a -> k) -> (a -> MetadataObject) -> ((e, a) `arr` Maybe b) -> (e, [a]) `arr` HashMap k (b, MetadataObject) Source #
Like buildInfo
, but includes each processed info’s associated MetadataObject
in the result.
This is useful if the results will be further processed, and the MetadataObject
is still needed
to mark the object inconsistent.
addTableContext :: Backend b => TableName b -> Text -> Text Source #