Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Types/functions shared between modules that implement Hasura.RQL.DDL.Schema.Cache. Other modules should not import this module directly.
Synopsis
- newtype BackendInvalidationKeysWrapper (b :: BackendType) = BackendInvalidationKeysWrapper {}
- data InvalidationKeys = InvalidationKeys {}
- ikSources :: Lens' InvalidationKeys (HashMap SourceName InvalidationKey)
- ikRemoteSchemas :: Lens' InvalidationKeys (HashMap RemoteSchemaName InvalidationKey)
- ikMetadata :: Lens' InvalidationKeys InvalidationKey
- ikBackends :: Lens' InvalidationKeys (BackendMap BackendInvalidationKeysWrapper)
- initialInvalidationKeys :: InvalidationKeys
- invalidateKeys :: CacheInvalidations -> InvalidationKeys -> InvalidationKeys
- data TableBuildInput b = TableBuildInput (TableName b) Bool (TableConfig b) (Maybe ApolloFederationConfig) (Maybe LogicalModelName)
- 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 :: Lens' BuildOutputs SourceCache
- boRoles :: Lens' BuildOutputs (HashMap RoleName Role)
- boRemoteSchemas :: Lens' BuildOutputs (HashMap RemoteSchemaName (RemoteSchemaCtx, MetadataObject))
- boCustomTypes :: Lens' BuildOutputs AnnotatedCustomTypes
- boBackendCache :: Lens' BuildOutputs BackendCache
- boActions :: Lens' BuildOutputs ActionCache
- data CacheBuildParams = CacheBuildParams Manager (SourceResolver ('Postgres 'Vanilla)) (SourceResolver 'MSSQL) CacheStaticConfig
- data CacheBuild a
- runCacheBuild :: (MonadIO m, MonadError QErr m) => CacheBuildParams -> CacheBuild a -> m a
- runCacheBuildM :: (MonadIO m, MonadError QErr m, MonadResolveSource m, ProvidesNetwork m, HasCacheStaticConfig m) => CacheBuild a -> m a
- data SourcesIntrospectionStatus
- data RebuildableSchemaCache = RebuildableSchemaCache SchemaCache InvalidationKeys (Rule (ReaderT BuildReason CacheBuild) (MetadataWithResourceVersion, CacheDynamicConfig, InvalidationKeys, Maybe StoredIntrospection) (SchemaCache, (SourcesIntrospectionStatus, SchemaRegistryAction)))
- withRecordDependencies :: ArrowWriter (Seq CollectItem) arr => WriterA (Seq SchemaDependency) arr (e, s) a -> arr (e, (MetadataObject, (SchemaObjId, s))) a
- buildInfoMap :: (ArrowChoice arr, ArrowDistribute arr, ArrowWriter (Seq CollectItem) arr, Hashable k) => (a -> k) -> (a -> MetadataObject) -> ((e, a) `arr` Maybe b) -> (e, [a]) `arr` HashMap k b
- buildInfoMapM :: (MonadWriter (Seq CollectItem) m, Hashable k) => (a -> k) -> (a -> MetadataObject) -> (a -> m (Maybe b)) -> [a] -> m (HashMap k b)
- buildInfoMapPreservingMetadata :: (ArrowChoice arr, ArrowDistribute arr, ArrowWriter (Seq CollectItem) arr, Hashable k) => (a -> k) -> (a -> MetadataObject) -> ((e, a) `arr` Maybe b) -> (e, [a]) `arr` HashMap k (b, MetadataObject)
- buildInfoMapPreservingMetadataM :: (MonadWriter (Seq CollectItem) m, Hashable k) => (a -> k) -> (a -> MetadataObject) -> (a -> m (Maybe b)) -> [a] -> m (HashMap k (b, MetadataObject))
- addTableContext :: Backend b => TableName b -> Text -> Text
- addLogicalModelContext :: LogicalModelName -> Text -> Text
Documentation
newtype BackendInvalidationKeysWrapper (b :: BackendType) Source #
Instances
data InvalidationKeys Source #
InvalidationKeys
used to apply requested CacheInvalidations
.
Instances
data TableBuildInput b Source #
TableBuildInput (TableName b) Bool (TableConfig b) (Maybe ApolloFederationConfig) (Maybe LogicalModelName) |
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.
See also Note [Avoiding GraphQL schema rebuilds when changing irrelevant Metadata]
BuildOutputs | |
|
boRemoteSchemas :: Lens' BuildOutputs (HashMap RemoteSchemaName (RemoteSchemaCtx, MetadataObject)) Source #
data CacheBuildParams Source #
Parameters required for schema cache build
CacheBuildParams Manager (SourceResolver ('Postgres 'Vanilla)) (SourceResolver 'MSSQL) CacheStaticConfig |
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 # |
data 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, MonadResolveSource m, ProvidesNetwork m, HasCacheStaticConfig m) => CacheBuild a -> m a Source #
data SourcesIntrospectionStatus Source #
The status of collection of stored introspections of remote schemas and data sources.
SourcesIntrospectionChangedFull StoredIntrospection | A full introspection collection of all available remote schemas and data sources. |
SourcesIntrospectionChangedPartial StoredIntrospection | A partial introspection collection. Does not include all configured remote schemas and data sources, because they were not available. |
SourcesIntrospectionUnchanged | None of remote schemas or data sources introspection is refetched. |
withRecordDependencies :: ArrowWriter (Seq CollectItem) arr => WriterA (Seq SchemaDependency) arr (e, s) a -> arr (e, (MetadataObject, (SchemaObjId, s))) a Source #
buildInfoMap :: (ArrowChoice arr, ArrowDistribute arr, ArrowWriter (Seq CollectItem) arr, 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.
buildInfoMapM :: (MonadWriter (Seq CollectItem) m, Hashable k) => (a -> k) -> (a -> MetadataObject) -> (a -> m (Maybe b)) -> [a] -> m (HashMap k b) Source #
buildInfoMapPreservingMetadata :: (ArrowChoice arr, ArrowDistribute arr, ArrowWriter (Seq CollectItem) arr, Hashable k) => (a -> k) -> (a -> MetadataObject) -> ((e, a) `arr` Maybe b) -> (e, [a]) `arr` HashMap k (b, MetadataObject) Source #
Like buildInfoMap
, 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.
buildInfoMapPreservingMetadataM :: (MonadWriter (Seq CollectItem) m, Hashable k) => (a -> k) -> (a -> MetadataObject) -> (a -> m (Maybe b)) -> [a] -> m (HashMap k (b, MetadataObject)) Source #
addLogicalModelContext :: LogicalModelName -> Text -> Text Source #