graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hasura.RQL.DDL.EventTrigger

Synopsis

Documentation

class Monad m => MonadEventLogCleanup m where Source #

This typeclass have the implementation logic for the event trigger log cleanup.

TODO: this doesn't belong here in the DDL folder, but should be part of Hasura.Eventing. It could even be made a Service, since the whole point of it is to implement features differently between OSS and Pro.

Methods

runLogCleaner :: SourceCache -> TriggerLogCleanupConfig -> m (Either QErr EncJSON) Source #

generateCleanupSchedules :: AnyBackend SourceInfo -> TriggerName -> AutoTriggerLogCleanupConfig -> m (Either QErr ()) Source #

updateTriggerCleanupSchedules :: Logger Hasura -> InsOrdHashMap SourceName BackendSourceMetadata -> InsOrdHashMap SourceName BackendSourceMetadata -> SchemaCache -> m (Either QErr ()) Source #

updateTriggerCleanupSchedules is primarily used to update the cleanup schedules associated with an event trigger in case the cleanup config has changed while replacing the metadata.

In case, i. a source has been dropped - We don't need to clear the cleanup schedules because the event log cleanup table is dropped as part of the post drop source hook. ii. a table or an event trigger has been dropped/updated - Older cleanup events will be deleted first and in case of an update, new cleanup events will be generated and inserted into the table. iii. a new event trigger with cleanup config has been added - Generate the cleanup events and insert it. iv. a new source has been added - Generate the cleanup events and insert it. v. the cron schedule for event trigger cleanup config has changed - Delete cleanup events with older cron schedule and generate cleanup events with new cron schedule.

Instances

Instances details
MonadEventLogCleanup AppM Source # 
Instance details

Defined in Hasura.App

MonadEventLogCleanup m => MonadEventLogCleanup (CacheRWT m) Source # 
Instance details

Defined in Hasura.RQL.DDL.Schema.Cache

MonadEventLogCleanup m => MonadEventLogCleanup (MetadataT m) Source # 
Instance details

Defined in Hasura.RQL.DDL.EventTrigger

MonadEventLogCleanup m => MonadEventLogCleanup (Handler m) Source # 
Instance details

Defined in Hasura.Server.App

MonadEventLogCleanup m => MonadEventLogCleanup (TraceT m) Source # 
Instance details

Defined in Hasura.RQL.DDL.EventTrigger

MonadEventLogCleanup m => MonadEventLogCleanup (ExceptT e m) Source # 
Instance details

Defined in Hasura.RQL.DDL.EventTrigger

MonadEventLogCleanup m => MonadEventLogCleanup (ReaderT r m) Source # 
Instance details

Defined in Hasura.RQL.DDL.EventTrigger

MonadEventLogCleanup m => MonadEventLogCleanup (StateT w m) Source # 
Instance details

Defined in Hasura.RQL.DDL.EventTrigger

getAllEventTriggersWithCleanupConfig :: TableInfo b -> [(TriggerName, AutoTriggerLogCleanupConfig)] Source #

Collects and returns all the event triggers with cleanup config