Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- fetchUndeliveredEvents :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres pgKind) -> SourceName -> [TriggerName] -> MaintenanceMode () -> FetchBatchSize -> m [Event ('Postgres pgKind)]
- setRetry :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres pgKind) -> Event ('Postgres pgKind) -> UTCTime -> MaintenanceMode MaintenanceModeVersion -> m ()
- insertManualEvent :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres pgKind) -> TableName ('Postgres pgKind) -> TriggerName -> Value -> UserInfo -> Maybe TraceContext -> m EventId
- getMaintenanceModeVersion :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres pgKind) -> m MaintenanceModeVersion
- recordSuccess :: MonadIO m => SourceConfig ('Postgres pgKind) -> Event ('Postgres pgKind) -> Invocation 'EventType -> MaintenanceMode MaintenanceModeVersion -> m (Either QErr ())
- recordError :: MonadIO m => SourceConfig ('Postgres pgKind) -> Event ('Postgres pgKind) -> Invocation 'EventType -> ProcessEventError -> MaintenanceMode MaintenanceModeVersion -> m (Either QErr ())
- recordError' :: MonadIO m => SourceConfig ('Postgres pgKind) -> Event ('Postgres pgKind) -> Maybe (Invocation 'EventType) -> ProcessEventError -> MaintenanceMode MaintenanceModeVersion -> m (Either QErr ())
- redeliverEvent :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres pgKind) -> EventId -> m ()
- dropTriggerAndArchiveEvents :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres pgKind) -> TriggerName -> QualifiedTable -> m ()
- createMissingSQLTriggers :: (MonadIO m, MonadError QErr m, MonadBaseControl IO m, Backend ('Postgres pgKind)) => SQLGenCtx -> PGSourceConfig -> TableName ('Postgres pgKind) -> ([ColumnInfo ('Postgres pgKind)], Maybe (PrimaryKey ('Postgres pgKind) (ColumnInfo ('Postgres pgKind)))) -> TriggerName -> TriggerOnReplication -> TriggerOpsDef ('Postgres pgKind) -> m ()
- createTableEventTrigger :: (Backend ('Postgres pgKind), MonadIO m, MonadBaseControl IO m) => SQLGenCtx -> PGSourceConfig -> QualifiedTable -> [ColumnInfo ('Postgres pgKind)] -> TriggerName -> TriggerOnReplication -> TriggerOpsDef ('Postgres pgKind) -> Maybe (PrimaryKey ('Postgres pgKind) (ColumnInfo ('Postgres pgKind))) -> m (Either QErr ())
- dropDanglingSQLTrigger :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres pgKind) -> TriggerName -> QualifiedTable -> HashSet Ops -> m ()
- updateColumnInEventTrigger :: QualifiedTable -> PGCol -> PGCol -> QualifiedTable -> EventTriggerConf ('Postgres pgKind) -> EventTriggerConf ('Postgres pgKind)
- unlockEventsInSource :: MonadIO m => SourceConfig ('Postgres pgKind) -> NESet EventId -> m (Either QErr Int)
- checkIfTriggerExists :: (MonadIO m, MonadError QErr m) => PGSourceConfig -> TriggerName -> HashSet Ops -> m Bool
- dropTriggerQ :: TriggerName -> TxE QErr ()
- mkAllTriggersQ :: forall pgKind m. (Backend ('Postgres pgKind), MonadTx m, MonadReader SQLGenCtx m) => TriggerName -> QualifiedTable -> TriggerOnReplication -> [ColumnInfo ('Postgres pgKind)] -> TriggerOpsDef ('Postgres pgKind) -> m ()
- addCleanupSchedules :: (MonadIO m, MonadError QErr m) => PGSourceConfig -> [(TriggerName, AutoTriggerLogCleanupConfig)] -> m ()
- deleteAllScheduledCleanups :: (MonadIO m, MonadError QErr m) => PGSourceConfig -> TriggerName -> m ()
- getCleanupEventsForDeletion :: (MonadIO m, MonadError QErr m) => PGSourceConfig -> m [(Text, TriggerName)]
- updateCleanupEventStatusToDead :: (MonadIO m, MonadError QErr m) => PGSourceConfig -> [Text] -> m ()
- updateCleanupEventStatusToPaused :: (MonadIO m, MonadError QErr m) => PGSourceConfig -> Text -> m ()
- updateCleanupEventStatusToCompleted :: (MonadIO m, MonadError QErr m) => PGSourceConfig -> Text -> DeletedEventLogStats -> m ()
- deleteEventTriggerLogs :: (MonadIO m, MonadError QErr m) => PGSourceConfig -> TriggerLogCleanupConfig -> IO (Maybe (TriggerLogCleanupConfig, EventTriggerCleanupStatus)) -> m DeletedEventLogStats
- fetchEventLogs :: (MonadError QErr m, MonadIO m) => PGSourceConfig -> GetEventLogs b -> m [EventLog]
- fetchEventInvocationLogs :: (MonadError QErr m, MonadIO m) => PGSourceConfig -> GetEventInvocations b -> m [EventInvocationLog]
- fetchEventById :: (MonadError QErr m, MonadIO m) => PGSourceConfig -> GetEventById b -> m EventLogWithInvocations
Documentation
fetchUndeliveredEvents :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres pgKind) -> SourceName -> [TriggerName] -> MaintenanceMode () -> FetchBatchSize -> m [Event ('Postgres pgKind)] Source #
setRetry :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres pgKind) -> Event ('Postgres pgKind) -> UTCTime -> MaintenanceMode MaintenanceModeVersion -> m () Source #
insertManualEvent :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres pgKind) -> TableName ('Postgres pgKind) -> TriggerName -> Value -> UserInfo -> Maybe TraceContext -> m EventId Source #
getMaintenanceModeVersion :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres pgKind) -> m MaintenanceModeVersion Source #
recordSuccess :: MonadIO m => SourceConfig ('Postgres pgKind) -> Event ('Postgres pgKind) -> Invocation 'EventType -> MaintenanceMode MaintenanceModeVersion -> m (Either QErr ()) Source #
recordError :: MonadIO m => SourceConfig ('Postgres pgKind) -> Event ('Postgres pgKind) -> Invocation 'EventType -> ProcessEventError -> MaintenanceMode MaintenanceModeVersion -> m (Either QErr ()) Source #
recordError' :: MonadIO m => SourceConfig ('Postgres pgKind) -> Event ('Postgres pgKind) -> Maybe (Invocation 'EventType) -> ProcessEventError -> MaintenanceMode MaintenanceModeVersion -> m (Either QErr ()) Source #
redeliverEvent :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres pgKind) -> EventId -> m () Source #
dropTriggerAndArchiveEvents :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres pgKind) -> TriggerName -> QualifiedTable -> m () Source #
createMissingSQLTriggers :: (MonadIO m, MonadError QErr m, MonadBaseControl IO m, Backend ('Postgres pgKind)) => SQLGenCtx -> PGSourceConfig -> TableName ('Postgres pgKind) -> ([ColumnInfo ('Postgres pgKind)], Maybe (PrimaryKey ('Postgres pgKind) (ColumnInfo ('Postgres pgKind)))) -> TriggerName -> TriggerOnReplication -> TriggerOpsDef ('Postgres pgKind) -> m () Source #
createTableEventTrigger :: (Backend ('Postgres pgKind), MonadIO m, MonadBaseControl IO m) => SQLGenCtx -> PGSourceConfig -> QualifiedTable -> [ColumnInfo ('Postgres pgKind)] -> TriggerName -> TriggerOnReplication -> TriggerOpsDef ('Postgres pgKind) -> Maybe (PrimaryKey ('Postgres pgKind) (ColumnInfo ('Postgres pgKind))) -> m (Either QErr ()) Source #
dropDanglingSQLTrigger :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres pgKind) -> TriggerName -> QualifiedTable -> HashSet Ops -> m () Source #
updateColumnInEventTrigger :: QualifiedTable -> PGCol -> PGCol -> QualifiedTable -> EventTriggerConf ('Postgres pgKind) -> EventTriggerConf ('Postgres pgKind) Source #
unlockEventsInSource :: MonadIO m => SourceConfig ('Postgres pgKind) -> NESet EventId -> m (Either QErr Int) Source #
checkIfTriggerExists :: (MonadIO m, MonadError QErr m) => PGSourceConfig -> TriggerName -> HashSet Ops -> m Bool Source #
dropTriggerQ :: TriggerName -> TxE QErr () Source #
mkAllTriggersQ :: forall pgKind m. (Backend ('Postgres pgKind), MonadTx m, MonadReader SQLGenCtx m) => TriggerName -> QualifiedTable -> TriggerOnReplication -> [ColumnInfo ('Postgres pgKind)] -> TriggerOpsDef ('Postgres pgKind) -> m () Source #
addCleanupSchedules :: (MonadIO m, MonadError QErr m) => PGSourceConfig -> [(TriggerName, AutoTriggerLogCleanupConfig)] -> m () Source #
Add cleanup logs for given trigger names and cleanup configs. This will perform the following steps:
- Get last scheduled cleanup event and count.
- If count is less than 5, then add add more cleanup logs, else do nothing
deleteAllScheduledCleanups :: (MonadIO m, MonadError QErr m) => PGSourceConfig -> TriggerName -> m () Source #
deleteAllScheduledCleanups
deletes all scheduled cleanup logs for a given event trigger
getCleanupEventsForDeletion :: (MonadIO m, MonadError QErr m) => PGSourceConfig -> m [(Text, TriggerName)] Source #
getCleanupEventsForDeletion
returns the cleanup logs that are to be deleted.
This will perform the following steps:
- Get the scheduled cleanup events that were scheduled before current time.
- If there are multiple entries for the same trigger name with different scheduled time, then fetch the latest entry and mark others as dead.
updateCleanupEventStatusToDead :: (MonadIO m, MonadError QErr m) => PGSourceConfig -> [Text] -> m () Source #
updateCleanupEventStatusToPaused :: (MonadIO m, MonadError QErr m) => PGSourceConfig -> Text -> m () Source #
updateCleanupEventStatusToPaused
updates the cleanup log status to paused
if the event trigger configuration is paused.
updateCleanupEventStatusToCompleted :: (MonadIO m, MonadError QErr m) => PGSourceConfig -> Text -> DeletedEventLogStats -> m () Source #
updateCleanupEventStatusToCompleted
updates the cleanup log status after the event logs are deleted.
This will perform the following steps:
- Updates the cleanup config status to
completed
. - Updates the number of event logs and event invocation logs that were deleted for a trigger name
deleteEventTriggerLogs :: (MonadIO m, MonadError QErr m) => PGSourceConfig -> 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:
- Select all the dead events based on criteria set in the cleanup config.
- Lock the events in the database so that other HGE instances don't pick them up for deletion.
- Based on the config, perform the delete action.
fetchEventLogs :: (MonadError QErr m, MonadIO m) => PGSourceConfig -> GetEventLogs b -> m [EventLog] Source #
fetchEventInvocationLogs :: (MonadError QErr m, MonadIO m) => PGSourceConfig -> GetEventInvocations b -> m [EventInvocationLog] Source #
fetchEventById :: (MonadError QErr m, MonadIO m) => PGSourceConfig -> GetEventById b -> m EventLogWithInvocations Source #