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

Hasura.Eventing.Backend

Synopsis

Documentation

class Backend b => BackendEventTrigger (b :: BackendType) where Source #

The BackendEventTrigger type class contains functions which interacts with the source database to perform event trigger related operations like fetching pending events from the database or inserting a new invocation log after processing an event.

Methods

insertManualEvent :: (MonadIO m, MonadError QErr m) => SourceConfig b -> TableName b -> TriggerName -> Value -> UserInfo -> Maybe TraceContext -> m EventId Source #

insertManualEvent inserts the specified event in the event log table, note that this method should also set the trace context and session variables in the source database context (if available).

fetchUndeliveredEvents Source #

Arguments

:: (MonadIO m, MonadError QErr m) 
=> SourceConfig b 
-> SourceName 
-> [TriggerName]

List of trigger names which exist in the metadata

-> MaintenanceMode () 
-> FetchBatchSize 
-> m [Event b] 

fetchUndeliveredEvents fetches the undelivered events from the source and locks those events for processing. The locking is done so that when there are multiple instances of graphql-engine connected to the same source they don't end up processing the same events concurrently.

Also, it's crucial that the SQL query used to fetch events in this function uses something like Postgres's `FOR UPDATE SKIP LOCKED` mechanism so that it skips past the events which are locked by the database and pick newer undelivered events to achieve maximum throughput.

The locking mechanism for event triggers is timestamp based i.e. when an event is fetched from the database, the locked column will contain the timestamp of when it was fetched from the database. Undelivered events will have NULL value as their locked column value.

The idea behind having a timestamp based locking mechanism is that if the graphql-engine is shutdown abruptly with events being fetched by the events processor, it will be locked and after the shutdown it will remain locked. Now with a timestamp based lock, when the graphql-engine is started again it will also fetch events which have a locked value of older than 30 mins along with the undelivered events. So, this way no events remain in a locked state.

When fetching the events from the event_log table we also include the list of the triggers that exist in the metadata at that point of time, because we have seen in some cases there are events that do not belong to any of the event triggers present in the metadata and those are fetched only to be failed saying the said event trigger doesn't exist. So, to avoid this (atleast, as much as possible) we get only the events of the event triggers we have in the metadata.

setRetry :: (MonadIO m, MonadError QErr m) => SourceConfig b -> Event b -> UTCTime -> MaintenanceMode MaintenanceModeVersion -> m () Source #

Ad-hoc function to set a retry for an undelivered event

getMaintenanceModeVersion :: (MonadIO m, MonadError QErr m) => SourceConfig b -> m MaintenanceModeVersion Source #

getMaintenanceModeVersion gets the source catalog version from the source

recordSuccess :: MonadIO m => SourceConfig b -> Event b -> Invocation 'EventType -> MaintenanceMode MaintenanceModeVersion -> m (Either QErr ()) Source #

recordSuccess records a successful event invocation, it does a couple of things,

  1. Insert the invocation in the invocation logs table
  2. Mark the event as delivered in the event_log table

recordError :: MonadIO m => SourceConfig b -> Event b -> Invocation 'EventType -> ProcessEventError -> MaintenanceMode MaintenanceModeVersion -> m (Either QErr ()) Source #

recordError records an erronous event invocation, it does a couple of things,

  1. Insert the invocation in the invocation logs table
  2. Depending on the value of ProcessEventError, it will either, - Set a retry for the given event - Mark the event as error

recordError' :: MonadIO m => SourceConfig b -> Event b -> Maybe (Invocation 'EventType) -> ProcessEventError -> MaintenanceMode MaintenanceModeVersion -> m (Either QErr ()) Source #

recordError' records an erronous event invocation, it does a couple of things,

  1. If present, insert the invocation in the invocation logs table
  2. Depending on the value of ProcessEventError, it will either, - Set a retry for the given event - Mark the event as error

dropTriggerAndArchiveEvents :: (MonadIO m, MonadError QErr m) => SourceConfig b -> TriggerName -> TableName b -> m () Source #

dropTriggerAndArchiveEvents drops the database trigger and marks all the events related to the event trigger as archived. See Note [Cleanup for dropped triggers]

dropDanglingSQLTrigger :: (MonadIO m, MonadError QErr m) => SourceConfig b -> TriggerName -> TableName b -> HashSet Ops -> m () Source #

dropDanglingSQLTriggger is used to delete the extraneous SQL triggers created by an event trigger. The extraneous SQL triggers can be created when an event trigger's definition is replaced to a new definition. For example, an event trigger authors_all had an INSERT and UPDATE trigger defined earlier and after it has UPDATE and DELETE triggers. So, in this case, we need to drop the trigger created by us earlier for the INSERT trigger.

redeliverEvent :: (MonadIO m, MonadError QErr m) => SourceConfig b -> EventId -> m () Source #

unlockEventsInSource :: MonadIO m => SourceConfig b -> NESet EventId -> m (Either QErr Int) Source #

unlockEventsInSource unlocks the cached locked events which were captured when a graceful shutdown is initiated, so that when the graphql-engine restarts these events can be fetched to process them immediately.

createMissingSQLTriggers :: (MonadIO m, MonadError QErr m, MonadBaseControl IO m, Backend b) => SQLGenCtx -> SourceConfig b -> TableName b -> ([ColumnInfo b], Maybe (PrimaryKey b (ColumnInfo b))) -> TriggerName -> TriggerOnReplication -> TriggerOpsDef b -> m () Source #

createMissingSQLTriggers checks in the source whether all the triggers exist according to the event trigger's specification. If any SQL trigger doesn't exist then it will create it.

createTableEventTrigger :: (MonadBaseControl IO m, MonadIO m, MonadError QErr m) => SQLGenCtx -> SourceConfig b -> TableName b -> [ColumnInfo b] -> TriggerName -> TriggerOnReplication -> TriggerOpsDef b -> Maybe (PrimaryKey b (ColumnInfo b)) -> m (Either QErr ()) Source #

checkIfTriggerExists :: (MonadIO m, MonadError QErr m) => SourceConfig b -> TriggerName -> HashSet Ops -> m Bool Source #

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

addCleanupSchedules adds 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) => SourceConfig b -> TriggerName -> m () Source #

deleteAllScheduledCleanups deletes all scheduled cleanup logs for a given event trigger

getCleanupEventsForDeletion :: (MonadIO m, MonadError QErr m) => SourceConfig b -> 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.

updateCleanupEventStatusToDead :: (MonadIO m, MonadError QErr m) => SourceConfig b -> [Text] -> m () Source #

updateCleanupEventStatusToDead updates the event trigger cleanup logs as dead

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

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

updateCleanupEventStatusToCompleted :: (MonadIO m, MonadError QErr m) => SourceConfig b -> 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) => SourceConfig b -> 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.

fetchEventLogs :: (MonadIO m, MonadError QErr m) => SourceConfig b -> GetEventLogs b -> m [EventLog] Source #

@fetchEventLogs fetches event logs from the source for a given event trigger.

fetchEventInvocationLogs :: (MonadIO m, MonadError QErr m) => SourceConfig b -> GetEventInvocations b -> m [EventInvocationLog] Source #

@fetchEventInvocationLogs fetches invocation logs from the source for a given event trigger.

fetchEventById :: (MonadIO m, MonadError QErr m) => SourceConfig b -> GetEventById b -> m EventLogWithInvocations Source #

@fetchEventById fetches the event and it's invocation logs from the source for a given EventId.

Instances

Instances details
BackendEventTrigger 'BigQuery Source # 
Instance details

Defined in Hasura.Eventing.Backend

Methods

insertManualEvent :: (MonadIO m, MonadError QErr m) => SourceConfig 'BigQuery -> TableName 'BigQuery -> TriggerName -> Value -> UserInfo -> Maybe TraceContext -> m EventId Source #

fetchUndeliveredEvents :: (MonadIO m, MonadError QErr m) => SourceConfig 'BigQuery -> SourceName -> [TriggerName] -> MaintenanceMode () -> FetchBatchSize -> m [Event 'BigQuery] Source #

setRetry :: (MonadIO m, MonadError QErr m) => SourceConfig 'BigQuery -> Event 'BigQuery -> UTCTime -> MaintenanceMode MaintenanceModeVersion -> m () Source #

getMaintenanceModeVersion :: (MonadIO m, MonadError QErr m) => SourceConfig 'BigQuery -> m MaintenanceModeVersion Source #

recordSuccess :: MonadIO m => SourceConfig 'BigQuery -> Event 'BigQuery -> Invocation 'EventType -> MaintenanceMode MaintenanceModeVersion -> m (Either QErr ()) Source #

recordError :: MonadIO m => SourceConfig 'BigQuery -> Event 'BigQuery -> Invocation 'EventType -> ProcessEventError -> MaintenanceMode MaintenanceModeVersion -> m (Either QErr ()) Source #

recordError' :: MonadIO m => SourceConfig 'BigQuery -> Event 'BigQuery -> Maybe (Invocation 'EventType) -> ProcessEventError -> MaintenanceMode MaintenanceModeVersion -> m (Either QErr ()) Source #

dropTriggerAndArchiveEvents :: (MonadIO m, MonadError QErr m) => SourceConfig 'BigQuery -> TriggerName -> TableName 'BigQuery -> m () Source #

dropDanglingSQLTrigger :: (MonadIO m, MonadError QErr m) => SourceConfig 'BigQuery -> TriggerName -> TableName 'BigQuery -> HashSet Ops -> m () Source #

redeliverEvent :: (MonadIO m, MonadError QErr m) => SourceConfig 'BigQuery -> EventId -> m () Source #

unlockEventsInSource :: MonadIO m => SourceConfig 'BigQuery -> NESet EventId -> m (Either QErr Int) Source #

createMissingSQLTriggers :: (MonadIO m, MonadError QErr m, MonadBaseControl IO m, Backend 'BigQuery) => SQLGenCtx -> SourceConfig 'BigQuery -> TableName 'BigQuery -> ([ColumnInfo 'BigQuery], Maybe (PrimaryKey 'BigQuery (ColumnInfo 'BigQuery))) -> TriggerName -> TriggerOnReplication -> TriggerOpsDef 'BigQuery -> m () Source #

createTableEventTrigger :: (MonadBaseControl IO m, MonadIO m, MonadError QErr m) => SQLGenCtx -> SourceConfig 'BigQuery -> TableName 'BigQuery -> [ColumnInfo 'BigQuery] -> TriggerName -> TriggerOnReplication -> TriggerOpsDef 'BigQuery -> Maybe (PrimaryKey 'BigQuery (ColumnInfo 'BigQuery)) -> m (Either QErr ()) Source #

checkIfTriggerExists :: (MonadIO m, MonadError QErr m) => SourceConfig 'BigQuery -> TriggerName -> HashSet Ops -> m Bool Source #

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

deleteAllScheduledCleanups :: (MonadIO m, MonadError QErr m) => SourceConfig 'BigQuery -> TriggerName -> m () Source #

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

updateCleanupEventStatusToDead :: (MonadIO m, MonadError QErr m) => SourceConfig 'BigQuery -> [Text] -> m () Source #

updateCleanupEventStatusToPaused :: (MonadIO m, MonadError QErr m) => SourceConfig 'BigQuery -> Text -> m () Source #

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

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

fetchEventLogs :: (MonadIO m, MonadError QErr m) => SourceConfig 'BigQuery -> GetEventLogs 'BigQuery -> m [EventLog] Source #

fetchEventInvocationLogs :: (MonadIO m, MonadError QErr m) => SourceConfig 'BigQuery -> GetEventInvocations 'BigQuery -> m [EventInvocationLog] Source #

fetchEventById :: (MonadIO m, MonadError QErr m) => SourceConfig 'BigQuery -> GetEventById 'BigQuery -> m EventLogWithInvocations Source #

BackendEventTrigger 'DataConnector Source # 
Instance details

Defined in Hasura.Eventing.Backend

Methods

insertManualEvent :: (MonadIO m, MonadError QErr m) => SourceConfig 'DataConnector -> TableName 'DataConnector -> TriggerName -> Value -> UserInfo -> Maybe TraceContext -> m EventId Source #

fetchUndeliveredEvents :: (MonadIO m, MonadError QErr m) => SourceConfig 'DataConnector -> SourceName -> [TriggerName] -> MaintenanceMode () -> FetchBatchSize -> m [Event 'DataConnector] Source #

setRetry :: (MonadIO m, MonadError QErr m) => SourceConfig 'DataConnector -> Event 'DataConnector -> UTCTime -> MaintenanceMode MaintenanceModeVersion -> m () Source #

getMaintenanceModeVersion :: (MonadIO m, MonadError QErr m) => SourceConfig 'DataConnector -> m MaintenanceModeVersion Source #

recordSuccess :: MonadIO m => SourceConfig 'DataConnector -> Event 'DataConnector -> Invocation 'EventType -> MaintenanceMode MaintenanceModeVersion -> m (Either QErr ()) Source #

recordError :: MonadIO m => SourceConfig 'DataConnector -> Event 'DataConnector -> Invocation 'EventType -> ProcessEventError -> MaintenanceMode MaintenanceModeVersion -> m (Either QErr ()) Source #

recordError' :: MonadIO m => SourceConfig 'DataConnector -> Event 'DataConnector -> Maybe (Invocation 'EventType) -> ProcessEventError -> MaintenanceMode MaintenanceModeVersion -> m (Either QErr ()) Source #

dropTriggerAndArchiveEvents :: (MonadIO m, MonadError QErr m) => SourceConfig 'DataConnector -> TriggerName -> TableName 'DataConnector -> m () Source #

dropDanglingSQLTrigger :: (MonadIO m, MonadError QErr m) => SourceConfig 'DataConnector -> TriggerName -> TableName 'DataConnector -> HashSet Ops -> m () Source #

redeliverEvent :: (MonadIO m, MonadError QErr m) => SourceConfig 'DataConnector -> EventId -> m () Source #

unlockEventsInSource :: MonadIO m => SourceConfig 'DataConnector -> NESet EventId -> m (Either QErr Int) Source #

createMissingSQLTriggers :: (MonadIO m, MonadError QErr m, MonadBaseControl IO m, Backend 'DataConnector) => SQLGenCtx -> SourceConfig 'DataConnector -> TableName 'DataConnector -> ([ColumnInfo 'DataConnector], Maybe (PrimaryKey 'DataConnector (ColumnInfo 'DataConnector))) -> TriggerName -> TriggerOnReplication -> TriggerOpsDef 'DataConnector -> m () Source #

createTableEventTrigger :: (MonadBaseControl IO m, MonadIO m, MonadError QErr m) => SQLGenCtx -> SourceConfig 'DataConnector -> TableName 'DataConnector -> [ColumnInfo 'DataConnector] -> TriggerName -> TriggerOnReplication -> TriggerOpsDef 'DataConnector -> Maybe (PrimaryKey 'DataConnector (ColumnInfo 'DataConnector)) -> m (Either QErr ()) Source #

checkIfTriggerExists :: (MonadIO m, MonadError QErr m) => SourceConfig 'DataConnector -> TriggerName -> HashSet Ops -> m Bool Source #

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

deleteAllScheduledCleanups :: (MonadIO m, MonadError QErr m) => SourceConfig 'DataConnector -> TriggerName -> m () Source #

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

updateCleanupEventStatusToDead :: (MonadIO m, MonadError QErr m) => SourceConfig 'DataConnector -> [Text] -> m () Source #

updateCleanupEventStatusToPaused :: (MonadIO m, MonadError QErr m) => SourceConfig 'DataConnector -> Text -> m () Source #

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

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

fetchEventLogs :: (MonadIO m, MonadError QErr m) => SourceConfig 'DataConnector -> GetEventLogs 'DataConnector -> m [EventLog] Source #

fetchEventInvocationLogs :: (MonadIO m, MonadError QErr m) => SourceConfig 'DataConnector -> GetEventInvocations 'DataConnector -> m [EventInvocationLog] Source #

fetchEventById :: (MonadIO m, MonadError QErr m) => SourceConfig 'DataConnector -> GetEventById 'DataConnector -> m EventLogWithInvocations Source #

BackendEventTrigger 'MSSQL Source # 
Instance details

Defined in Hasura.Eventing.Backend

Methods

insertManualEvent :: (MonadIO m, MonadError QErr m) => SourceConfig 'MSSQL -> TableName 'MSSQL -> TriggerName -> Value -> UserInfo -> Maybe TraceContext -> m EventId Source #

fetchUndeliveredEvents :: (MonadIO m, MonadError QErr m) => SourceConfig 'MSSQL -> SourceName -> [TriggerName] -> MaintenanceMode () -> FetchBatchSize -> m [Event 'MSSQL] Source #

setRetry :: (MonadIO m, MonadError QErr m) => SourceConfig 'MSSQL -> Event 'MSSQL -> UTCTime -> MaintenanceMode MaintenanceModeVersion -> m () Source #

getMaintenanceModeVersion :: (MonadIO m, MonadError QErr m) => SourceConfig 'MSSQL -> m MaintenanceModeVersion Source #

recordSuccess :: MonadIO m => SourceConfig 'MSSQL -> Event 'MSSQL -> Invocation 'EventType -> MaintenanceMode MaintenanceModeVersion -> m (Either QErr ()) Source #

recordError :: MonadIO m => SourceConfig 'MSSQL -> Event 'MSSQL -> Invocation 'EventType -> ProcessEventError -> MaintenanceMode MaintenanceModeVersion -> m (Either QErr ()) Source #

recordError' :: MonadIO m => SourceConfig 'MSSQL -> Event 'MSSQL -> Maybe (Invocation 'EventType) -> ProcessEventError -> MaintenanceMode MaintenanceModeVersion -> m (Either QErr ()) Source #

dropTriggerAndArchiveEvents :: (MonadIO m, MonadError QErr m) => SourceConfig 'MSSQL -> TriggerName -> TableName 'MSSQL -> m () Source #

dropDanglingSQLTrigger :: (MonadIO m, MonadError QErr m) => SourceConfig 'MSSQL -> TriggerName -> TableName 'MSSQL -> HashSet Ops -> m () Source #

redeliverEvent :: (MonadIO m, MonadError QErr m) => SourceConfig 'MSSQL -> EventId -> m () Source #

unlockEventsInSource :: MonadIO m => SourceConfig 'MSSQL -> NESet EventId -> m (Either QErr Int) Source #

createMissingSQLTriggers :: (MonadIO m, MonadError QErr m, MonadBaseControl IO m, Backend 'MSSQL) => SQLGenCtx -> SourceConfig 'MSSQL -> TableName 'MSSQL -> ([ColumnInfo 'MSSQL], Maybe (PrimaryKey 'MSSQL (ColumnInfo 'MSSQL))) -> TriggerName -> TriggerOnReplication -> TriggerOpsDef 'MSSQL -> m () Source #

createTableEventTrigger :: (MonadBaseControl IO m, MonadIO m, MonadError QErr m) => SQLGenCtx -> SourceConfig 'MSSQL -> TableName 'MSSQL -> [ColumnInfo 'MSSQL] -> TriggerName -> TriggerOnReplication -> TriggerOpsDef 'MSSQL -> Maybe (PrimaryKey 'MSSQL (ColumnInfo 'MSSQL)) -> m (Either QErr ()) Source #

checkIfTriggerExists :: (MonadIO m, MonadError QErr m) => SourceConfig 'MSSQL -> TriggerName -> HashSet Ops -> m Bool Source #

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

deleteAllScheduledCleanups :: (MonadIO m, MonadError QErr m) => SourceConfig 'MSSQL -> TriggerName -> m () Source #

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

updateCleanupEventStatusToDead :: (MonadIO m, MonadError QErr m) => SourceConfig 'MSSQL -> [Text] -> m () Source #

updateCleanupEventStatusToPaused :: (MonadIO m, MonadError QErr m) => SourceConfig 'MSSQL -> Text -> m () Source #

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

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

fetchEventLogs :: (MonadIO m, MonadError QErr m) => SourceConfig 'MSSQL -> GetEventLogs 'MSSQL -> m [EventLog] Source #

fetchEventInvocationLogs :: (MonadIO m, MonadError QErr m) => SourceConfig 'MSSQL -> GetEventInvocations 'MSSQL -> m [EventInvocationLog] Source #

fetchEventById :: (MonadIO m, MonadError QErr m) => SourceConfig 'MSSQL -> GetEventById 'MSSQL -> m EventLogWithInvocations Source #

BackendEventTrigger ('Postgres 'Citus) Source # 
Instance details

Defined in Hasura.Eventing.Backend

Methods

insertManualEvent :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Citus) -> TableName ('Postgres 'Citus) -> TriggerName -> Value -> UserInfo -> Maybe TraceContext -> m EventId Source #

fetchUndeliveredEvents :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Citus) -> SourceName -> [TriggerName] -> MaintenanceMode () -> FetchBatchSize -> m [Event ('Postgres 'Citus)] Source #

setRetry :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Citus) -> Event ('Postgres 'Citus) -> UTCTime -> MaintenanceMode MaintenanceModeVersion -> m () Source #

getMaintenanceModeVersion :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Citus) -> m MaintenanceModeVersion Source #

recordSuccess :: MonadIO m => SourceConfig ('Postgres 'Citus) -> Event ('Postgres 'Citus) -> Invocation 'EventType -> MaintenanceMode MaintenanceModeVersion -> m (Either QErr ()) Source #

recordError :: MonadIO m => SourceConfig ('Postgres 'Citus) -> Event ('Postgres 'Citus) -> Invocation 'EventType -> ProcessEventError -> MaintenanceMode MaintenanceModeVersion -> m (Either QErr ()) Source #

recordError' :: MonadIO m => SourceConfig ('Postgres 'Citus) -> Event ('Postgres 'Citus) -> Maybe (Invocation 'EventType) -> ProcessEventError -> MaintenanceMode MaintenanceModeVersion -> m (Either QErr ()) Source #

dropTriggerAndArchiveEvents :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Citus) -> TriggerName -> TableName ('Postgres 'Citus) -> m () Source #

dropDanglingSQLTrigger :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Citus) -> TriggerName -> TableName ('Postgres 'Citus) -> HashSet Ops -> m () Source #

redeliverEvent :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Citus) -> EventId -> m () Source #

unlockEventsInSource :: MonadIO m => SourceConfig ('Postgres 'Citus) -> NESet EventId -> m (Either QErr Int) Source #

createMissingSQLTriggers :: (MonadIO m, MonadError QErr m, MonadBaseControl IO m, Backend ('Postgres 'Citus)) => SQLGenCtx -> SourceConfig ('Postgres 'Citus) -> TableName ('Postgres 'Citus) -> ([ColumnInfo ('Postgres 'Citus)], Maybe (PrimaryKey ('Postgres 'Citus) (ColumnInfo ('Postgres 'Citus)))) -> TriggerName -> TriggerOnReplication -> TriggerOpsDef ('Postgres 'Citus) -> m () Source #

createTableEventTrigger :: (MonadBaseControl IO m, MonadIO m, MonadError QErr m) => SQLGenCtx -> SourceConfig ('Postgres 'Citus) -> TableName ('Postgres 'Citus) -> [ColumnInfo ('Postgres 'Citus)] -> TriggerName -> TriggerOnReplication -> TriggerOpsDef ('Postgres 'Citus) -> Maybe (PrimaryKey ('Postgres 'Citus) (ColumnInfo ('Postgres 'Citus))) -> m (Either QErr ()) Source #

checkIfTriggerExists :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Citus) -> TriggerName -> HashSet Ops -> m Bool Source #

addCleanupSchedules :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Citus) -> [(TriggerName, AutoTriggerLogCleanupConfig)] -> m () Source #

deleteAllScheduledCleanups :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Citus) -> TriggerName -> m () Source #

getCleanupEventsForDeletion :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Citus) -> m [(Text, TriggerName)] Source #

updateCleanupEventStatusToDead :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Citus) -> [Text] -> m () Source #

updateCleanupEventStatusToPaused :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Citus) -> Text -> m () Source #

updateCleanupEventStatusToCompleted :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Citus) -> Text -> DeletedEventLogStats -> m () Source #

deleteEventTriggerLogs :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Citus) -> TriggerLogCleanupConfig -> IO (Maybe (TriggerLogCleanupConfig, EventTriggerCleanupStatus)) -> m DeletedEventLogStats Source #

fetchEventLogs :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Citus) -> GetEventLogs ('Postgres 'Citus) -> m [EventLog] Source #

fetchEventInvocationLogs :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Citus) -> GetEventInvocations ('Postgres 'Citus) -> m [EventInvocationLog] Source #

fetchEventById :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Citus) -> GetEventById ('Postgres 'Citus) -> m EventLogWithInvocations Source #

BackendEventTrigger ('Postgres 'Cockroach) Source # 
Instance details

Defined in Hasura.Eventing.Backend

Methods

insertManualEvent :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Cockroach) -> TableName ('Postgres 'Cockroach) -> TriggerName -> Value -> UserInfo -> Maybe TraceContext -> m EventId Source #

fetchUndeliveredEvents :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Cockroach) -> SourceName -> [TriggerName] -> MaintenanceMode () -> FetchBatchSize -> m [Event ('Postgres 'Cockroach)] Source #

setRetry :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Cockroach) -> Event ('Postgres 'Cockroach) -> UTCTime -> MaintenanceMode MaintenanceModeVersion -> m () Source #

getMaintenanceModeVersion :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Cockroach) -> m MaintenanceModeVersion Source #

recordSuccess :: MonadIO m => SourceConfig ('Postgres 'Cockroach) -> Event ('Postgres 'Cockroach) -> Invocation 'EventType -> MaintenanceMode MaintenanceModeVersion -> m (Either QErr ()) Source #

recordError :: MonadIO m => SourceConfig ('Postgres 'Cockroach) -> Event ('Postgres 'Cockroach) -> Invocation 'EventType -> ProcessEventError -> MaintenanceMode MaintenanceModeVersion -> m (Either QErr ()) Source #

recordError' :: MonadIO m => SourceConfig ('Postgres 'Cockroach) -> Event ('Postgres 'Cockroach) -> Maybe (Invocation 'EventType) -> ProcessEventError -> MaintenanceMode MaintenanceModeVersion -> m (Either QErr ()) Source #

dropTriggerAndArchiveEvents :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Cockroach) -> TriggerName -> TableName ('Postgres 'Cockroach) -> m () Source #

dropDanglingSQLTrigger :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Cockroach) -> TriggerName -> TableName ('Postgres 'Cockroach) -> HashSet Ops -> m () Source #

redeliverEvent :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Cockroach) -> EventId -> m () Source #

unlockEventsInSource :: MonadIO m => SourceConfig ('Postgres 'Cockroach) -> NESet EventId -> m (Either QErr Int) Source #

createMissingSQLTriggers :: (MonadIO m, MonadError QErr m, MonadBaseControl IO m, Backend ('Postgres 'Cockroach)) => SQLGenCtx -> SourceConfig ('Postgres 'Cockroach) -> TableName ('Postgres 'Cockroach) -> ([ColumnInfo ('Postgres 'Cockroach)], Maybe (PrimaryKey ('Postgres 'Cockroach) (ColumnInfo ('Postgres 'Cockroach)))) -> TriggerName -> TriggerOnReplication -> TriggerOpsDef ('Postgres 'Cockroach) -> m () Source #

createTableEventTrigger :: (MonadBaseControl IO m, MonadIO m, MonadError QErr m) => SQLGenCtx -> SourceConfig ('Postgres 'Cockroach) -> TableName ('Postgres 'Cockroach) -> [ColumnInfo ('Postgres 'Cockroach)] -> TriggerName -> TriggerOnReplication -> TriggerOpsDef ('Postgres 'Cockroach) -> Maybe (PrimaryKey ('Postgres 'Cockroach) (ColumnInfo ('Postgres 'Cockroach))) -> m (Either QErr ()) Source #

checkIfTriggerExists :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Cockroach) -> TriggerName -> HashSet Ops -> m Bool Source #

addCleanupSchedules :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Cockroach) -> [(TriggerName, AutoTriggerLogCleanupConfig)] -> m () Source #

deleteAllScheduledCleanups :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Cockroach) -> TriggerName -> m () Source #

getCleanupEventsForDeletion :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Cockroach) -> m [(Text, TriggerName)] Source #

updateCleanupEventStatusToDead :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Cockroach) -> [Text] -> m () Source #

updateCleanupEventStatusToPaused :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Cockroach) -> Text -> m () Source #

updateCleanupEventStatusToCompleted :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Cockroach) -> Text -> DeletedEventLogStats -> m () Source #

deleteEventTriggerLogs :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Cockroach) -> TriggerLogCleanupConfig -> IO (Maybe (TriggerLogCleanupConfig, EventTriggerCleanupStatus)) -> m DeletedEventLogStats Source #

fetchEventLogs :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Cockroach) -> GetEventLogs ('Postgres 'Cockroach) -> m [EventLog] Source #

fetchEventInvocationLogs :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Cockroach) -> GetEventInvocations ('Postgres 'Cockroach) -> m [EventInvocationLog] Source #

fetchEventById :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Cockroach) -> GetEventById ('Postgres 'Cockroach) -> m EventLogWithInvocations Source #

BackendEventTrigger ('Postgres 'Vanilla) Source # 
Instance details

Defined in Hasura.Eventing.Backend

Methods

insertManualEvent :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Vanilla) -> TableName ('Postgres 'Vanilla) -> TriggerName -> Value -> UserInfo -> Maybe TraceContext -> m EventId Source #

fetchUndeliveredEvents :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Vanilla) -> SourceName -> [TriggerName] -> MaintenanceMode () -> FetchBatchSize -> m [Event ('Postgres 'Vanilla)] Source #

setRetry :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Vanilla) -> Event ('Postgres 'Vanilla) -> UTCTime -> MaintenanceMode MaintenanceModeVersion -> m () Source #

getMaintenanceModeVersion :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Vanilla) -> m MaintenanceModeVersion Source #

recordSuccess :: MonadIO m => SourceConfig ('Postgres 'Vanilla) -> Event ('Postgres 'Vanilla) -> Invocation 'EventType -> MaintenanceMode MaintenanceModeVersion -> m (Either QErr ()) Source #

recordError :: MonadIO m => SourceConfig ('Postgres 'Vanilla) -> Event ('Postgres 'Vanilla) -> Invocation 'EventType -> ProcessEventError -> MaintenanceMode MaintenanceModeVersion -> m (Either QErr ()) Source #

recordError' :: MonadIO m => SourceConfig ('Postgres 'Vanilla) -> Event ('Postgres 'Vanilla) -> Maybe (Invocation 'EventType) -> ProcessEventError -> MaintenanceMode MaintenanceModeVersion -> m (Either QErr ()) Source #

dropTriggerAndArchiveEvents :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Vanilla) -> TriggerName -> TableName ('Postgres 'Vanilla) -> m () Source #

dropDanglingSQLTrigger :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Vanilla) -> TriggerName -> TableName ('Postgres 'Vanilla) -> HashSet Ops -> m () Source #

redeliverEvent :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Vanilla) -> EventId -> m () Source #

unlockEventsInSource :: MonadIO m => SourceConfig ('Postgres 'Vanilla) -> NESet EventId -> m (Either QErr Int) Source #

createMissingSQLTriggers :: (MonadIO m, MonadError QErr m, MonadBaseControl IO m, Backend ('Postgres 'Vanilla)) => SQLGenCtx -> SourceConfig ('Postgres 'Vanilla) -> TableName ('Postgres 'Vanilla) -> ([ColumnInfo ('Postgres 'Vanilla)], Maybe (PrimaryKey ('Postgres 'Vanilla) (ColumnInfo ('Postgres 'Vanilla)))) -> TriggerName -> TriggerOnReplication -> TriggerOpsDef ('Postgres 'Vanilla) -> m () Source #

createTableEventTrigger :: (MonadBaseControl IO m, MonadIO m, MonadError QErr m) => SQLGenCtx -> SourceConfig ('Postgres 'Vanilla) -> TableName ('Postgres 'Vanilla) -> [ColumnInfo ('Postgres 'Vanilla)] -> TriggerName -> TriggerOnReplication -> TriggerOpsDef ('Postgres 'Vanilla) -> Maybe (PrimaryKey ('Postgres 'Vanilla) (ColumnInfo ('Postgres 'Vanilla))) -> m (Either QErr ()) Source #

checkIfTriggerExists :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Vanilla) -> TriggerName -> HashSet Ops -> m Bool Source #

addCleanupSchedules :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Vanilla) -> [(TriggerName, AutoTriggerLogCleanupConfig)] -> m () Source #

deleteAllScheduledCleanups :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Vanilla) -> TriggerName -> m () Source #

getCleanupEventsForDeletion :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Vanilla) -> m [(Text, TriggerName)] Source #

updateCleanupEventStatusToDead :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Vanilla) -> [Text] -> m () Source #

updateCleanupEventStatusToPaused :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Vanilla) -> Text -> m () Source #

updateCleanupEventStatusToCompleted :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Vanilla) -> Text -> DeletedEventLogStats -> m () Source #

deleteEventTriggerLogs :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Vanilla) -> TriggerLogCleanupConfig -> IO (Maybe (TriggerLogCleanupConfig, EventTriggerCleanupStatus)) -> m DeletedEventLogStats Source #

fetchEventLogs :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Vanilla) -> GetEventLogs ('Postgres 'Vanilla) -> m [EventLog] Source #

fetchEventInvocationLogs :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Vanilla) -> GetEventInvocations ('Postgres 'Vanilla) -> m [EventInvocationLog] Source #

fetchEventById :: (MonadIO m, MonadError QErr m) => SourceConfig ('Postgres 'Vanilla) -> GetEventById ('Postgres 'Vanilla) -> m EventLogWithInvocations Source #