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

Hasura.Backends.MSSQL.DDL.EventTrigger

Synopsis

Documentation

addCleanupSchedules :: (MonadIO m, MonadError QErr m) => MSSQLSourceConfig -> [(TriggerName, AutoTriggerLogCleanupConfig)] -> m () Source #

Add cleanup logs for given trigger names and cleanup configs. This will perform the following steps:

  1. Get last scheduled cleanup event and count.
  2. If count is less than 5, then add add more cleanup logs, else do nothing

deleteAllScheduledCleanups :: (MonadIO m, MonadError QErr m) => MSSQLSourceConfig -> TriggerName -> m () Source #

deleteAllScheduledCleanups deletes all scheduled cleanup logs for a given event trigger

getCleanupEventsForDeletion :: (MonadIO m, MonadError QErr m) => MSSQLSourceConfig -> m [(Text, TriggerName)] Source #

getCleanupEventsForDeletion returns the cleanup logs that are to be deleted. This will perform the following steps:

  1. Get the scheduled cleanup events that were scheduled before current time.
  2. If there are multiple entries for the same trigger name with different scheduled time, then fetch the latest entry and mark others as dead.

updateCleanupEventStatusToPaused :: (MonadIO m, MonadError QErr m) => MSSQLSourceConfig -> Text -> m () Source #

updateCleanupEventStatusToPaused updates the cleanup log status to paused if the event trigger configuration is paused.

updateCleanupEventStatusToCompleted :: (MonadIO m, MonadError QErr m) => MSSQLSourceConfig -> Text -> DeletedEventLogStats -> m () Source #

updateCleanupEventStatusToCompleted updates the cleanup log status after the event logs are deleted. This will perform the following steps:

  1. Updates the cleanup config status to completed.
  2. Updates the number of event logs and event invocation logs that were deleted for a trigger name

deleteEventTriggerLogs :: (MonadIO m, MonadError QErr m) => MSSQLSourceConfig -> TriggerLogCleanupConfig -> IO (Maybe (TriggerLogCleanupConfig, EventTriggerCleanupStatus)) -> m DeletedEventLogStats Source #

deleteEventTriggerLogs deletes the event logs (and event invocation logs) based on the cleanup configuration given This will perform the following steps:

  1. Select all the dead events based on criteria set in the cleanup config.
  2. Lock the events in the database so that other HGE instances don't pick them up for deletion.
  3. Based on the config, perform the delete action.