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

Hasura.Metadata.Class

Description

This module has type class and types which implements the Metadata Storage Abstraction

Synopsis

Documentation

class Monad m => MonadMetadataStorage m where Source #

Metadata storage abstraction via a type class.

This type class enables storing and managing Hasura metadata in an isolated database which will not interfere with user's database where tables/functions are defined. Hence, it'll enable support for databases of multiple backends like MSSQL etc.

Error-handling is handled explicitly, with every function returning an `Either QErr`. This is inelegant, but is required: we want the caller to explictly deal with errors, rather than letting them surface to a "lower" monad, because we want to implement this as a Service, on the base monad, so that different implementations of the engine can choose how to implement it; and those base monads do not include error handling, all error handling must be done at the endpoint level. As a result, we choose to make the errors explicit in the return type rather than making assumptions about the stack.

This class has functions broadly related to:

  1. Metadata Management ---------------------- Basic metadata management functions such as retrieving metadata from storage database and replacing the given metadata. TODO: Console specific operations
  2. Scheduled Triggers --------------------- Eventing sub-system for scheduled triggers is implemented via metadata storage. For more details, refer description in ScheduledTrigger module.

TODO: Functions need to be added to the type class - Retrieving invocation logs from storage (console requirement) - Deleting an scheduled event - Creating an one-off scheduled event

  1. Async Actions ---------------- Operations to implement async actions sub-system. This includes recording an async action event and retreiving the details of action delivery to the webhook. For more details see Note [Async action architecture] in Action module.

It is believed that all the above three are implemented in a single storage system (ex: a Postgres database). We can split the functions into appropriate and specific type classes in future iterations if required.

Methods

fetchMetadataResourceVersion :: m (Either QErr MetadataResourceVersion) Source #

fetchMetadata :: m (Either QErr MetadataWithResourceVersion) Source #

fetchMetadataNotifications :: MetadataResourceVersion -> InstanceId -> m (Either QErr [(MetadataResourceVersion, CacheInvalidations)]) Source #

setMetadata :: MetadataResourceVersion -> Metadata -> m (Either QErr MetadataResourceVersion) Source #

notifySchemaCacheSync :: MetadataResourceVersion -> InstanceId -> CacheInvalidations -> m (Either QErr ()) Source #

getCatalogState :: m (Either QErr CatalogState) Source #

setCatalogState :: CatalogStateType -> Value -> m (Either QErr ()) Source #

fetchSourceIntrospection :: MetadataResourceVersion -> m (Either QErr (Maybe StoredIntrospection)) Source #

storeSourceIntrospection :: StoredIntrospection -> MetadataResourceVersion -> m (Either QErr ()) Source #

getMetadataDbUid :: m (Either QErr MetadataDbId) Source #

checkMetadataStorageHealth :: m (Either QErr ()) Source #

getDeprivedCronTriggerStats :: [TriggerName] -> m (Either QErr [CronTriggerStats]) Source #

getScheduledEventsForDelivery :: [TriggerName] -> m (Either QErr ([CronEvent], [OneOffScheduledEvent])) Source #

insertCronEvents :: [CronEventSeed] -> m (Either QErr ()) Source #

insertOneOffScheduledEvent :: OneOffEvent -> m (Either QErr EventId) Source #

insertScheduledEventInvocation :: Invocation 'ScheduledType -> ScheduledEventType -> m (Either QErr ()) Source #

setScheduledEventOp :: ScheduledEventId -> ScheduledEventOp -> ScheduledEventType -> m (Either QErr ()) Source #

unlockScheduledEvents :: ScheduledEventType -> [ScheduledEventId] -> m (Either QErr Int) Source #

unlockAllLockedScheduledEvents :: m (Either QErr ()) Source #

clearFutureCronEvents :: ClearCronEvents -> m (Either QErr ()) Source #

getOneOffScheduledEvents :: ScheduledEventPagination -> [ScheduledEventStatus] -> RowsCountOption -> m (Either QErr (WithOptionalTotalCount [OneOffScheduledEvent])) Source #

getCronEvents :: TriggerName -> ScheduledEventPagination -> [ScheduledEventStatus] -> RowsCountOption -> m (Either QErr (WithOptionalTotalCount [CronEvent])) Source #

getScheduledEventInvocations :: GetScheduledEventInvocations -> m (Either QErr (WithOptionalTotalCount [ScheduledEventInvocation])) Source #

deleteScheduledEvent :: ScheduledEventId -> ScheduledEventType -> m (Either QErr ()) Source #

insertAction :: ActionName -> SessionVariables -> [Header] -> Value -> m (Either QErr ActionId) Source #

fetchUndeliveredActionEvents :: m (Either QErr [ActionLogItem]) Source #

setActionStatus :: ActionId -> AsyncActionStatus -> m (Either QErr ()) Source #

fetchActionResponse :: ActionId -> m (Either QErr ActionLogResponse) Source #

clearActionData :: ActionName -> m (Either QErr ()) Source #

setProcessingActionLogsToPending :: LockedActionIdArray -> m (Either QErr ()) Source #

Instances

Instances details
MonadMetadataStorage AppM Source #

Each of the function in the type class is executed in a totally separate transaction.

Instance details

Defined in Hasura.App

Methods

fetchMetadataResourceVersion :: AppM (Either QErr MetadataResourceVersion) Source #

fetchMetadata :: AppM (Either QErr MetadataWithResourceVersion) Source #

fetchMetadataNotifications :: MetadataResourceVersion -> InstanceId -> AppM (Either QErr [(MetadataResourceVersion, CacheInvalidations)]) Source #

setMetadata :: MetadataResourceVersion -> Metadata -> AppM (Either QErr MetadataResourceVersion) Source #

notifySchemaCacheSync :: MetadataResourceVersion -> InstanceId -> CacheInvalidations -> AppM (Either QErr ()) Source #

getCatalogState :: AppM (Either QErr CatalogState) Source #

setCatalogState :: CatalogStateType -> Value -> AppM (Either QErr ()) Source #

fetchSourceIntrospection :: MetadataResourceVersion -> AppM (Either QErr (Maybe StoredIntrospection)) Source #

storeSourceIntrospection :: StoredIntrospection -> MetadataResourceVersion -> AppM (Either QErr ()) Source #

getMetadataDbUid :: AppM (Either QErr MetadataDbId) Source #

checkMetadataStorageHealth :: AppM (Either QErr ()) Source #

getDeprivedCronTriggerStats :: [TriggerName] -> AppM (Either QErr [CronTriggerStats]) Source #

getScheduledEventsForDelivery :: [TriggerName] -> AppM (Either QErr ([CronEvent], [OneOffScheduledEvent])) Source #

insertCronEvents :: [CronEventSeed] -> AppM (Either QErr ()) Source #

insertOneOffScheduledEvent :: OneOffEvent -> AppM (Either QErr EventId) Source #

insertScheduledEventInvocation :: Invocation 'ScheduledType -> ScheduledEventType -> AppM (Either QErr ()) Source #

setScheduledEventOp :: ScheduledEventId -> ScheduledEventOp -> ScheduledEventType -> AppM (Either QErr ()) Source #

unlockScheduledEvents :: ScheduledEventType -> [ScheduledEventId] -> AppM (Either QErr Int) Source #

unlockAllLockedScheduledEvents :: AppM (Either QErr ()) Source #

clearFutureCronEvents :: ClearCronEvents -> AppM (Either QErr ()) Source #

getOneOffScheduledEvents :: ScheduledEventPagination -> [ScheduledEventStatus] -> RowsCountOption -> AppM (Either QErr (WithOptionalTotalCount [OneOffScheduledEvent])) Source #

getCronEvents :: TriggerName -> ScheduledEventPagination -> [ScheduledEventStatus] -> RowsCountOption -> AppM (Either QErr (WithOptionalTotalCount [CronEvent])) Source #

getScheduledEventInvocations :: GetScheduledEventInvocations -> AppM (Either QErr (WithOptionalTotalCount [ScheduledEventInvocation])) Source #

deleteScheduledEvent :: ScheduledEventId -> ScheduledEventType -> AppM (Either QErr ()) Source #

insertAction :: ActionName -> SessionVariables -> [Header] -> Value -> AppM (Either QErr ActionId) Source #

fetchUndeliveredActionEvents :: AppM (Either QErr [ActionLogItem]) Source #

setActionStatus :: ActionId -> AsyncActionStatus -> AppM (Either QErr ()) Source #

fetchActionResponse :: ActionId -> AppM (Either QErr ActionLogResponse) Source #

clearActionData :: ActionName -> AppM (Either QErr ()) Source #

setProcessingActionLogsToPending :: LockedActionIdArray -> AppM (Either QErr ()) Source #

MonadMetadataStorage m => MonadMetadataStorage (ManagedT m) Source # 
Instance details

Defined in Hasura.Metadata.Class

Methods

fetchMetadataResourceVersion :: ManagedT m (Either QErr MetadataResourceVersion) Source #

fetchMetadata :: ManagedT m (Either QErr MetadataWithResourceVersion) Source #

fetchMetadataNotifications :: MetadataResourceVersion -> InstanceId -> ManagedT m (Either QErr [(MetadataResourceVersion, CacheInvalidations)]) Source #

setMetadata :: MetadataResourceVersion -> Metadata -> ManagedT m (Either QErr MetadataResourceVersion) Source #

notifySchemaCacheSync :: MetadataResourceVersion -> InstanceId -> CacheInvalidations -> ManagedT m (Either QErr ()) Source #

getCatalogState :: ManagedT m (Either QErr CatalogState) Source #

setCatalogState :: CatalogStateType -> Value -> ManagedT m (Either QErr ()) Source #

fetchSourceIntrospection :: MetadataResourceVersion -> ManagedT m (Either QErr (Maybe StoredIntrospection)) Source #

storeSourceIntrospection :: StoredIntrospection -> MetadataResourceVersion -> ManagedT m (Either QErr ()) Source #

getMetadataDbUid :: ManagedT m (Either QErr MetadataDbId) Source #

checkMetadataStorageHealth :: ManagedT m (Either QErr ()) Source #

getDeprivedCronTriggerStats :: [TriggerName] -> ManagedT m (Either QErr [CronTriggerStats]) Source #

getScheduledEventsForDelivery :: [TriggerName] -> ManagedT m (Either QErr ([CronEvent], [OneOffScheduledEvent])) Source #

insertCronEvents :: [CronEventSeed] -> ManagedT m (Either QErr ()) Source #

insertOneOffScheduledEvent :: OneOffEvent -> ManagedT m (Either QErr EventId) Source #

insertScheduledEventInvocation :: Invocation 'ScheduledType -> ScheduledEventType -> ManagedT m (Either QErr ()) Source #

setScheduledEventOp :: ScheduledEventId -> ScheduledEventOp -> ScheduledEventType -> ManagedT m (Either QErr ()) Source #

unlockScheduledEvents :: ScheduledEventType -> [ScheduledEventId] -> ManagedT m (Either QErr Int) Source #

unlockAllLockedScheduledEvents :: ManagedT m (Either QErr ()) Source #

clearFutureCronEvents :: ClearCronEvents -> ManagedT m (Either QErr ()) Source #

getOneOffScheduledEvents :: ScheduledEventPagination -> [ScheduledEventStatus] -> RowsCountOption -> ManagedT m (Either QErr (WithOptionalTotalCount [OneOffScheduledEvent])) Source #

getCronEvents :: TriggerName -> ScheduledEventPagination -> [ScheduledEventStatus] -> RowsCountOption -> ManagedT m (Either QErr (WithOptionalTotalCount [CronEvent])) Source #

getScheduledEventInvocations :: GetScheduledEventInvocations -> ManagedT m (Either QErr (WithOptionalTotalCount [ScheduledEventInvocation])) Source #

deleteScheduledEvent :: ScheduledEventId -> ScheduledEventType -> ManagedT m (Either QErr ()) Source #

insertAction :: ActionName -> SessionVariables -> [Header] -> Value -> ManagedT m (Either QErr ActionId) Source #

fetchUndeliveredActionEvents :: ManagedT m (Either QErr [ActionLogItem]) Source #

setActionStatus :: ActionId -> AsyncActionStatus -> ManagedT m (Either QErr ()) Source #

fetchActionResponse :: ActionId -> ManagedT m (Either QErr ActionLogResponse) Source #

clearActionData :: ActionName -> ManagedT m (Either QErr ()) Source #

setProcessingActionLogsToPending :: LockedActionIdArray -> ManagedT m (Either QErr ()) Source #

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

Defined in Hasura.RQL.DDL.Schema.Cache

Methods

fetchMetadataResourceVersion :: CacheRWT m (Either QErr MetadataResourceVersion) Source #

fetchMetadata :: CacheRWT m (Either QErr MetadataWithResourceVersion) Source #

fetchMetadataNotifications :: MetadataResourceVersion -> InstanceId -> CacheRWT m (Either QErr [(MetadataResourceVersion, CacheInvalidations)]) Source #

setMetadata :: MetadataResourceVersion -> Metadata -> CacheRWT m (Either QErr MetadataResourceVersion) Source #

notifySchemaCacheSync :: MetadataResourceVersion -> InstanceId -> CacheInvalidations -> CacheRWT m (Either QErr ()) Source #

getCatalogState :: CacheRWT m (Either QErr CatalogState) Source #

setCatalogState :: CatalogStateType -> Value -> CacheRWT m (Either QErr ()) Source #

fetchSourceIntrospection :: MetadataResourceVersion -> CacheRWT m (Either QErr (Maybe StoredIntrospection)) Source #

storeSourceIntrospection :: StoredIntrospection -> MetadataResourceVersion -> CacheRWT m (Either QErr ()) Source #

getMetadataDbUid :: CacheRWT m (Either QErr MetadataDbId) Source #

checkMetadataStorageHealth :: CacheRWT m (Either QErr ()) Source #

getDeprivedCronTriggerStats :: [TriggerName] -> CacheRWT m (Either QErr [CronTriggerStats]) Source #

getScheduledEventsForDelivery :: [TriggerName] -> CacheRWT m (Either QErr ([CronEvent], [OneOffScheduledEvent])) Source #

insertCronEvents :: [CronEventSeed] -> CacheRWT m (Either QErr ()) Source #

insertOneOffScheduledEvent :: OneOffEvent -> CacheRWT m (Either QErr EventId) Source #

insertScheduledEventInvocation :: Invocation 'ScheduledType -> ScheduledEventType -> CacheRWT m (Either QErr ()) Source #

setScheduledEventOp :: ScheduledEventId -> ScheduledEventOp -> ScheduledEventType -> CacheRWT m (Either QErr ()) Source #

unlockScheduledEvents :: ScheduledEventType -> [ScheduledEventId] -> CacheRWT m (Either QErr Int) Source #

unlockAllLockedScheduledEvents :: CacheRWT m (Either QErr ()) Source #

clearFutureCronEvents :: ClearCronEvents -> CacheRWT m (Either QErr ()) Source #

getOneOffScheduledEvents :: ScheduledEventPagination -> [ScheduledEventStatus] -> RowsCountOption -> CacheRWT m (Either QErr (WithOptionalTotalCount [OneOffScheduledEvent])) Source #

getCronEvents :: TriggerName -> ScheduledEventPagination -> [ScheduledEventStatus] -> RowsCountOption -> CacheRWT m (Either QErr (WithOptionalTotalCount [CronEvent])) Source #

getScheduledEventInvocations :: GetScheduledEventInvocations -> CacheRWT m (Either QErr (WithOptionalTotalCount [ScheduledEventInvocation])) Source #

deleteScheduledEvent :: ScheduledEventId -> ScheduledEventType -> CacheRWT m (Either QErr ()) Source #

insertAction :: ActionName -> SessionVariables -> [Header] -> Value -> CacheRWT m (Either QErr ActionId) Source #

fetchUndeliveredActionEvents :: CacheRWT m (Either QErr [ActionLogItem]) Source #

setActionStatus :: ActionId -> AsyncActionStatus -> CacheRWT m (Either QErr ()) Source #

fetchActionResponse :: ActionId -> CacheRWT m (Either QErr ActionLogResponse) Source #

clearActionData :: ActionName -> CacheRWT m (Either QErr ()) Source #

setProcessingActionLogsToPending :: LockedActionIdArray -> CacheRWT m (Either QErr ()) Source #

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

Defined in Hasura.Metadata.Class

Methods

fetchMetadataResourceVersion :: MetadataT m (Either QErr MetadataResourceVersion) Source #

fetchMetadata :: MetadataT m (Either QErr MetadataWithResourceVersion) Source #

fetchMetadataNotifications :: MetadataResourceVersion -> InstanceId -> MetadataT m (Either QErr [(MetadataResourceVersion, CacheInvalidations)]) Source #

setMetadata :: MetadataResourceVersion -> Metadata -> MetadataT m (Either QErr MetadataResourceVersion) Source #

notifySchemaCacheSync :: MetadataResourceVersion -> InstanceId -> CacheInvalidations -> MetadataT m (Either QErr ()) Source #

getCatalogState :: MetadataT m (Either QErr CatalogState) Source #

setCatalogState :: CatalogStateType -> Value -> MetadataT m (Either QErr ()) Source #

fetchSourceIntrospection :: MetadataResourceVersion -> MetadataT m (Either QErr (Maybe StoredIntrospection)) Source #

storeSourceIntrospection :: StoredIntrospection -> MetadataResourceVersion -> MetadataT m (Either QErr ()) Source #

getMetadataDbUid :: MetadataT m (Either QErr MetadataDbId) Source #

checkMetadataStorageHealth :: MetadataT m (Either QErr ()) Source #

getDeprivedCronTriggerStats :: [TriggerName] -> MetadataT m (Either QErr [CronTriggerStats]) Source #

getScheduledEventsForDelivery :: [TriggerName] -> MetadataT m (Either QErr ([CronEvent], [OneOffScheduledEvent])) Source #

insertCronEvents :: [CronEventSeed] -> MetadataT m (Either QErr ()) Source #

insertOneOffScheduledEvent :: OneOffEvent -> MetadataT m (Either QErr EventId) Source #

insertScheduledEventInvocation :: Invocation 'ScheduledType -> ScheduledEventType -> MetadataT m (Either QErr ()) Source #

setScheduledEventOp :: ScheduledEventId -> ScheduledEventOp -> ScheduledEventType -> MetadataT m (Either QErr ()) Source #

unlockScheduledEvents :: ScheduledEventType -> [ScheduledEventId] -> MetadataT m (Either QErr Int) Source #

unlockAllLockedScheduledEvents :: MetadataT m (Either QErr ()) Source #

clearFutureCronEvents :: ClearCronEvents -> MetadataT m (Either QErr ()) Source #

getOneOffScheduledEvents :: ScheduledEventPagination -> [ScheduledEventStatus] -> RowsCountOption -> MetadataT m (Either QErr (WithOptionalTotalCount [OneOffScheduledEvent])) Source #

getCronEvents :: TriggerName -> ScheduledEventPagination -> [ScheduledEventStatus] -> RowsCountOption -> MetadataT m (Either QErr (WithOptionalTotalCount [CronEvent])) Source #

getScheduledEventInvocations :: GetScheduledEventInvocations -> MetadataT m (Either QErr (WithOptionalTotalCount [ScheduledEventInvocation])) Source #

deleteScheduledEvent :: ScheduledEventId -> ScheduledEventType -> MetadataT m (Either QErr ()) Source #

insertAction :: ActionName -> SessionVariables -> [Header] -> Value -> MetadataT m (Either QErr ActionId) Source #

fetchUndeliveredActionEvents :: MetadataT m (Either QErr [ActionLogItem]) Source #

setActionStatus :: ActionId -> AsyncActionStatus -> MetadataT m (Either QErr ()) Source #

fetchActionResponse :: ActionId -> MetadataT m (Either QErr ActionLogResponse) Source #

clearActionData :: ActionName -> MetadataT m (Either QErr ()) Source #

setProcessingActionLogsToPending :: LockedActionIdArray -> MetadataT m (Either QErr ()) Source #

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

Defined in Hasura.Server.App

Methods

fetchMetadataResourceVersion :: Handler m (Either QErr MetadataResourceVersion) Source #

fetchMetadata :: Handler m (Either QErr MetadataWithResourceVersion) Source #

fetchMetadataNotifications :: MetadataResourceVersion -> InstanceId -> Handler m (Either QErr [(MetadataResourceVersion, CacheInvalidations)]) Source #

setMetadata :: MetadataResourceVersion -> Metadata -> Handler m (Either QErr MetadataResourceVersion) Source #

notifySchemaCacheSync :: MetadataResourceVersion -> InstanceId -> CacheInvalidations -> Handler m (Either QErr ()) Source #

getCatalogState :: Handler m (Either QErr CatalogState) Source #

setCatalogState :: CatalogStateType -> Value -> Handler m (Either QErr ()) Source #

fetchSourceIntrospection :: MetadataResourceVersion -> Handler m (Either QErr (Maybe StoredIntrospection)) Source #

storeSourceIntrospection :: StoredIntrospection -> MetadataResourceVersion -> Handler m (Either QErr ()) Source #

getMetadataDbUid :: Handler m (Either QErr MetadataDbId) Source #

checkMetadataStorageHealth :: Handler m (Either QErr ()) Source #

getDeprivedCronTriggerStats :: [TriggerName] -> Handler m (Either QErr [CronTriggerStats]) Source #

getScheduledEventsForDelivery :: [TriggerName] -> Handler m (Either QErr ([CronEvent], [OneOffScheduledEvent])) Source #

insertCronEvents :: [CronEventSeed] -> Handler m (Either QErr ()) Source #

insertOneOffScheduledEvent :: OneOffEvent -> Handler m (Either QErr EventId) Source #

insertScheduledEventInvocation :: Invocation 'ScheduledType -> ScheduledEventType -> Handler m (Either QErr ()) Source #

setScheduledEventOp :: ScheduledEventId -> ScheduledEventOp -> ScheduledEventType -> Handler m (Either QErr ()) Source #

unlockScheduledEvents :: ScheduledEventType -> [ScheduledEventId] -> Handler m (Either QErr Int) Source #

unlockAllLockedScheduledEvents :: Handler m (Either QErr ()) Source #

clearFutureCronEvents :: ClearCronEvents -> Handler m (Either QErr ()) Source #

getOneOffScheduledEvents :: ScheduledEventPagination -> [ScheduledEventStatus] -> RowsCountOption -> Handler m (Either QErr (WithOptionalTotalCount [OneOffScheduledEvent])) Source #

getCronEvents :: TriggerName -> ScheduledEventPagination -> [ScheduledEventStatus] -> RowsCountOption -> Handler m (Either QErr (WithOptionalTotalCount [CronEvent])) Source #

getScheduledEventInvocations :: GetScheduledEventInvocations -> Handler m (Either QErr (WithOptionalTotalCount [ScheduledEventInvocation])) Source #

deleteScheduledEvent :: ScheduledEventId -> ScheduledEventType -> Handler m (Either QErr ()) Source #

insertAction :: ActionName -> SessionVariables -> [Header] -> Value -> Handler m (Either QErr ActionId) Source #

fetchUndeliveredActionEvents :: Handler m (Either QErr [ActionLogItem]) Source #

setActionStatus :: ActionId -> AsyncActionStatus -> Handler m (Either QErr ()) Source #

fetchActionResponse :: ActionId -> Handler m (Either QErr ActionLogResponse) Source #

clearActionData :: ActionName -> Handler m (Either QErr ()) Source #

setProcessingActionLogsToPending :: LockedActionIdArray -> Handler m (Either QErr ()) Source #

(MonadMetadataStorage m, MonadTrans t, Monad (t m)) => MonadMetadataStorage (TransT t m) Source # 
Instance details

Defined in Hasura.Metadata.Class

Methods

fetchMetadataResourceVersion :: TransT t m (Either QErr MetadataResourceVersion) Source #

fetchMetadata :: TransT t m (Either QErr MetadataWithResourceVersion) Source #

fetchMetadataNotifications :: MetadataResourceVersion -> InstanceId -> TransT t m (Either QErr [(MetadataResourceVersion, CacheInvalidations)]) Source #

setMetadata :: MetadataResourceVersion -> Metadata -> TransT t m (Either QErr MetadataResourceVersion) Source #

notifySchemaCacheSync :: MetadataResourceVersion -> InstanceId -> CacheInvalidations -> TransT t m (Either QErr ()) Source #

getCatalogState :: TransT t m (Either QErr CatalogState) Source #

setCatalogState :: CatalogStateType -> Value -> TransT t m (Either QErr ()) Source #

fetchSourceIntrospection :: MetadataResourceVersion -> TransT t m (Either QErr (Maybe StoredIntrospection)) Source #

storeSourceIntrospection :: StoredIntrospection -> MetadataResourceVersion -> TransT t m (Either QErr ()) Source #

getMetadataDbUid :: TransT t m (Either QErr MetadataDbId) Source #

checkMetadataStorageHealth :: TransT t m (Either QErr ()) Source #

getDeprivedCronTriggerStats :: [TriggerName] -> TransT t m (Either QErr [CronTriggerStats]) Source #

getScheduledEventsForDelivery :: [TriggerName] -> TransT t m (Either QErr ([CronEvent], [OneOffScheduledEvent])) Source #

insertCronEvents :: [CronEventSeed] -> TransT t m (Either QErr ()) Source #

insertOneOffScheduledEvent :: OneOffEvent -> TransT t m (Either QErr EventId) Source #

insertScheduledEventInvocation :: Invocation 'ScheduledType -> ScheduledEventType -> TransT t m (Either QErr ()) Source #

setScheduledEventOp :: ScheduledEventId -> ScheduledEventOp -> ScheduledEventType -> TransT t m (Either QErr ()) Source #

unlockScheduledEvents :: ScheduledEventType -> [ScheduledEventId] -> TransT t m (Either QErr Int) Source #

unlockAllLockedScheduledEvents :: TransT t m (Either QErr ()) Source #

clearFutureCronEvents :: ClearCronEvents -> TransT t m (Either QErr ()) Source #

getOneOffScheduledEvents :: ScheduledEventPagination -> [ScheduledEventStatus] -> RowsCountOption -> TransT t m (Either QErr (WithOptionalTotalCount [OneOffScheduledEvent])) Source #

getCronEvents :: TriggerName -> ScheduledEventPagination -> [ScheduledEventStatus] -> RowsCountOption -> TransT t m (Either QErr (WithOptionalTotalCount [CronEvent])) Source #

getScheduledEventInvocations :: GetScheduledEventInvocations -> TransT t m (Either QErr (WithOptionalTotalCount [ScheduledEventInvocation])) Source #

deleteScheduledEvent :: ScheduledEventId -> ScheduledEventType -> TransT t m (Either QErr ()) Source #

insertAction :: ActionName -> SessionVariables -> [Header] -> Value -> TransT t m (Either QErr ActionId) Source #

fetchUndeliveredActionEvents :: TransT t m (Either QErr [ActionLogItem]) Source #

setActionStatus :: ActionId -> AsyncActionStatus -> TransT t m (Either QErr ()) Source #

fetchActionResponse :: ActionId -> TransT t m (Either QErr ActionLogResponse) Source #

clearActionData :: ActionName -> TransT t m (Either QErr ()) Source #

setProcessingActionLogsToPending :: LockedActionIdArray -> TransT t m (Either QErr ()) Source #

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

Defined in Hasura.Metadata.Class

Methods

fetchMetadataResourceVersion :: ExceptT e m (Either QErr MetadataResourceVersion) Source #

fetchMetadata :: ExceptT e m (Either QErr MetadataWithResourceVersion) Source #

fetchMetadataNotifications :: MetadataResourceVersion -> InstanceId -> ExceptT e m (Either QErr [(MetadataResourceVersion, CacheInvalidations)]) Source #

setMetadata :: MetadataResourceVersion -> Metadata -> ExceptT e m (Either QErr MetadataResourceVersion) Source #

notifySchemaCacheSync :: MetadataResourceVersion -> InstanceId -> CacheInvalidations -> ExceptT e m (Either QErr ()) Source #

getCatalogState :: ExceptT e m (Either QErr CatalogState) Source #

setCatalogState :: CatalogStateType -> Value -> ExceptT e m (Either QErr ()) Source #

fetchSourceIntrospection :: MetadataResourceVersion -> ExceptT e m (Either QErr (Maybe StoredIntrospection)) Source #

storeSourceIntrospection :: StoredIntrospection -> MetadataResourceVersion -> ExceptT e m (Either QErr ()) Source #

getMetadataDbUid :: ExceptT e m (Either QErr MetadataDbId) Source #

checkMetadataStorageHealth :: ExceptT e m (Either QErr ()) Source #

getDeprivedCronTriggerStats :: [TriggerName] -> ExceptT e m (Either QErr [CronTriggerStats]) Source #

getScheduledEventsForDelivery :: [TriggerName] -> ExceptT e m (Either QErr ([CronEvent], [OneOffScheduledEvent])) Source #

insertCronEvents :: [CronEventSeed] -> ExceptT e m (Either QErr ()) Source #

insertOneOffScheduledEvent :: OneOffEvent -> ExceptT e m (Either QErr EventId) Source #

insertScheduledEventInvocation :: Invocation 'ScheduledType -> ScheduledEventType -> ExceptT e m (Either QErr ()) Source #

setScheduledEventOp :: ScheduledEventId -> ScheduledEventOp -> ScheduledEventType -> ExceptT e m (Either QErr ()) Source #

unlockScheduledEvents :: ScheduledEventType -> [ScheduledEventId] -> ExceptT e m (Either QErr Int) Source #

unlockAllLockedScheduledEvents :: ExceptT e m (Either QErr ()) Source #

clearFutureCronEvents :: ClearCronEvents -> ExceptT e m (Either QErr ()) Source #

getOneOffScheduledEvents :: ScheduledEventPagination -> [ScheduledEventStatus] -> RowsCountOption -> ExceptT e m (Either QErr (WithOptionalTotalCount [OneOffScheduledEvent])) Source #

getCronEvents :: TriggerName -> ScheduledEventPagination -> [ScheduledEventStatus] -> RowsCountOption -> ExceptT e m (Either QErr (WithOptionalTotalCount [CronEvent])) Source #

getScheduledEventInvocations :: GetScheduledEventInvocations -> ExceptT e m (Either QErr (WithOptionalTotalCount [ScheduledEventInvocation])) Source #

deleteScheduledEvent :: ScheduledEventId -> ScheduledEventType -> ExceptT e m (Either QErr ()) Source #

insertAction :: ActionName -> SessionVariables -> [Header] -> Value -> ExceptT e m (Either QErr ActionId) Source #

fetchUndeliveredActionEvents :: ExceptT e m (Either QErr [ActionLogItem]) Source #

setActionStatus :: ActionId -> AsyncActionStatus -> ExceptT e m (Either QErr ()) Source #

fetchActionResponse :: ActionId -> ExceptT e m (Either QErr ActionLogResponse) Source #

clearActionData :: ActionName -> ExceptT e m (Either QErr ()) Source #

setProcessingActionLogsToPending :: LockedActionIdArray -> ExceptT e m (Either QErr ()) Source #

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

Defined in Hasura.Metadata.Class

Methods

fetchMetadataResourceVersion :: ReaderT r m (Either QErr MetadataResourceVersion) Source #

fetchMetadata :: ReaderT r m (Either QErr MetadataWithResourceVersion) Source #

fetchMetadataNotifications :: MetadataResourceVersion -> InstanceId -> ReaderT r m (Either QErr [(MetadataResourceVersion, CacheInvalidations)]) Source #

setMetadata :: MetadataResourceVersion -> Metadata -> ReaderT r m (Either QErr MetadataResourceVersion) Source #

notifySchemaCacheSync :: MetadataResourceVersion -> InstanceId -> CacheInvalidations -> ReaderT r m (Either QErr ()) Source #

getCatalogState :: ReaderT r m (Either QErr CatalogState) Source #

setCatalogState :: CatalogStateType -> Value -> ReaderT r m (Either QErr ()) Source #

fetchSourceIntrospection :: MetadataResourceVersion -> ReaderT r m (Either QErr (Maybe StoredIntrospection)) Source #

storeSourceIntrospection :: StoredIntrospection -> MetadataResourceVersion -> ReaderT r m (Either QErr ()) Source #

getMetadataDbUid :: ReaderT r m (Either QErr MetadataDbId) Source #

checkMetadataStorageHealth :: ReaderT r m (Either QErr ()) Source #

getDeprivedCronTriggerStats :: [TriggerName] -> ReaderT r m (Either QErr [CronTriggerStats]) Source #

getScheduledEventsForDelivery :: [TriggerName] -> ReaderT r m (Either QErr ([CronEvent], [OneOffScheduledEvent])) Source #

insertCronEvents :: [CronEventSeed] -> ReaderT r m (Either QErr ()) Source #

insertOneOffScheduledEvent :: OneOffEvent -> ReaderT r m (Either QErr EventId) Source #

insertScheduledEventInvocation :: Invocation 'ScheduledType -> ScheduledEventType -> ReaderT r m (Either QErr ()) Source #

setScheduledEventOp :: ScheduledEventId -> ScheduledEventOp -> ScheduledEventType -> ReaderT r m (Either QErr ()) Source #

unlockScheduledEvents :: ScheduledEventType -> [ScheduledEventId] -> ReaderT r m (Either QErr Int) Source #

unlockAllLockedScheduledEvents :: ReaderT r m (Either QErr ()) Source #

clearFutureCronEvents :: ClearCronEvents -> ReaderT r m (Either QErr ()) Source #

getOneOffScheduledEvents :: ScheduledEventPagination -> [ScheduledEventStatus] -> RowsCountOption -> ReaderT r m (Either QErr (WithOptionalTotalCount [OneOffScheduledEvent])) Source #

getCronEvents :: TriggerName -> ScheduledEventPagination -> [ScheduledEventStatus] -> RowsCountOption -> ReaderT r m (Either QErr (WithOptionalTotalCount [CronEvent])) Source #

getScheduledEventInvocations :: GetScheduledEventInvocations -> ReaderT r m (Either QErr (WithOptionalTotalCount [ScheduledEventInvocation])) Source #

deleteScheduledEvent :: ScheduledEventId -> ScheduledEventType -> ReaderT r m (Either QErr ()) Source #

insertAction :: ActionName -> SessionVariables -> [Header] -> Value -> ReaderT r m (Either QErr ActionId) Source #

fetchUndeliveredActionEvents :: ReaderT r m (Either QErr [ActionLogItem]) Source #

setActionStatus :: ActionId -> AsyncActionStatus -> ReaderT r m (Either QErr ()) Source #

fetchActionResponse :: ActionId -> ReaderT r m (Either QErr ActionLogResponse) Source #

clearActionData :: ActionName -> ReaderT r m (Either QErr ()) Source #

setProcessingActionLogsToPending :: LockedActionIdArray -> ReaderT r m (Either QErr ()) Source #

MonadMetadataStorage m => MonadMetadataStorage (StateT s m) Source # 
Instance details

Defined in Hasura.Metadata.Class

Methods

fetchMetadataResourceVersion :: StateT s m (Either QErr MetadataResourceVersion) Source #

fetchMetadata :: StateT s m (Either QErr MetadataWithResourceVersion) Source #

fetchMetadataNotifications :: MetadataResourceVersion -> InstanceId -> StateT s m (Either QErr [(MetadataResourceVersion, CacheInvalidations)]) Source #

setMetadata :: MetadataResourceVersion -> Metadata -> StateT s m (Either QErr MetadataResourceVersion) Source #

notifySchemaCacheSync :: MetadataResourceVersion -> InstanceId -> CacheInvalidations -> StateT s m (Either QErr ()) Source #

getCatalogState :: StateT s m (Either QErr CatalogState) Source #

setCatalogState :: CatalogStateType -> Value -> StateT s m (Either QErr ()) Source #

fetchSourceIntrospection :: MetadataResourceVersion -> StateT s m (Either QErr (Maybe StoredIntrospection)) Source #

storeSourceIntrospection :: StoredIntrospection -> MetadataResourceVersion -> StateT s m (Either QErr ()) Source #

getMetadataDbUid :: StateT s m (Either QErr MetadataDbId) Source #

checkMetadataStorageHealth :: StateT s m (Either QErr ()) Source #

getDeprivedCronTriggerStats :: [TriggerName] -> StateT s m (Either QErr [CronTriggerStats]) Source #

getScheduledEventsForDelivery :: [TriggerName] -> StateT s m (Either QErr ([CronEvent], [OneOffScheduledEvent])) Source #

insertCronEvents :: [CronEventSeed] -> StateT s m (Either QErr ()) Source #

insertOneOffScheduledEvent :: OneOffEvent -> StateT s m (Either QErr EventId) Source #

insertScheduledEventInvocation :: Invocation 'ScheduledType -> ScheduledEventType -> StateT s m (Either QErr ()) Source #

setScheduledEventOp :: ScheduledEventId -> ScheduledEventOp -> ScheduledEventType -> StateT s m (Either QErr ()) Source #

unlockScheduledEvents :: ScheduledEventType -> [ScheduledEventId] -> StateT s m (Either QErr Int) Source #

unlockAllLockedScheduledEvents :: StateT s m (Either QErr ()) Source #

clearFutureCronEvents :: ClearCronEvents -> StateT s m (Either QErr ()) Source #

getOneOffScheduledEvents :: ScheduledEventPagination -> [ScheduledEventStatus] -> RowsCountOption -> StateT s m (Either QErr (WithOptionalTotalCount [OneOffScheduledEvent])) Source #

getCronEvents :: TriggerName -> ScheduledEventPagination -> [ScheduledEventStatus] -> RowsCountOption -> StateT s m (Either QErr (WithOptionalTotalCount [CronEvent])) Source #

getScheduledEventInvocations :: GetScheduledEventInvocations -> StateT s m (Either QErr (WithOptionalTotalCount [ScheduledEventInvocation])) Source #

deleteScheduledEvent :: ScheduledEventId -> ScheduledEventType -> StateT s m (Either QErr ()) Source #

insertAction :: ActionName -> SessionVariables -> [Header] -> Value -> StateT s m (Either QErr ActionId) Source #

fetchUndeliveredActionEvents :: StateT s m (Either QErr [ActionLogItem]) Source #

setActionStatus :: ActionId -> AsyncActionStatus -> StateT s m (Either QErr ()) Source #

fetchActionResponse :: ActionId -> StateT s m (Either QErr ActionLogResponse) Source #

clearActionData :: ActionName -> StateT s m (Either QErr ()) Source #

setProcessingActionLogsToPending :: LockedActionIdArray -> StateT s m (Either QErr ()) Source #

createCronEvents :: MonadMetadataStorage m => [CronEventSeed] -> m (Either QErr ()) Source #

Record a cron event

deleteActionData :: MonadMetadataStorage m => ActionName -> m (Either QErr ()) Source #

Delete async action logs

fetchScheduledEvents :: MonadMetadataStorage m => GetScheduledEvents -> m (Either QErr Value) Source #

Fetch cron/oneoff scheduled events

dropEvent :: MonadMetadataStorage m => ScheduledEventId -> ScheduledEventType -> m (Either QErr ()) Source #

Drop a cron/oneoff scheduled event

fetchCatalogState :: MonadMetadataStorage m => m (Either QErr CatalogState) Source #

Retrieve the state from metadata storage catalog

updateCatalogState :: MonadMetadataStorage m => CatalogStateType -> Value -> m (Either QErr ()) Source #

Update the state from metadata storage catalog

class Monad m => MonadEECredentialsStorage m where Source #

Metadata database operations for EE credentials storage.

This class is only necessary because we haven't written an implementation for storing EE credentials in Cloud.

Instances

Instances details
MonadEECredentialsStorage AppM Source # 
Instance details

Defined in Hasura.App

MonadEECredentialsStorage m => MonadEECredentialsStorage (ManagedT m) Source # 
Instance details

Defined in Hasura.Metadata.Class

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

Defined in Hasura.Metadata.Class

(MonadEECredentialsStorage m, MonadTrans t, Monad (t m)) => MonadEECredentialsStorage (TransT t m) Source # 
Instance details

Defined in Hasura.Metadata.Class

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

Defined in Hasura.Metadata.Class

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

Defined in Hasura.Metadata.Class

MonadEECredentialsStorage m => MonadEECredentialsStorage (StateT s m) Source # 
Instance details

Defined in Hasura.Metadata.Class