Safe Haskell | None |
---|---|
Language | Haskell2010 |
The RQL query ('v1query')
Synopsis
- data RQLQueryV1
- = RQAddExistingTableOrView !(TrackTable ('Postgres 'Vanilla))
- | RQTrackTable !(TrackTable ('Postgres 'Vanilla))
- | RQUntrackTable !(UntrackTable ('Postgres 'Vanilla))
- | RQSetTableIsEnum !SetTableIsEnum
- | RQSetTableCustomization !(SetTableCustomization ('Postgres 'Vanilla))
- | RQTrackFunction !(TrackFunction ('Postgres 'Vanilla))
- | RQUntrackFunction !(UnTrackFunction ('Postgres 'Vanilla))
- | RQCreateObjectRelationship !(CreateObjRel ('Postgres 'Vanilla))
- | RQCreateArrayRelationship !(CreateArrRel ('Postgres 'Vanilla))
- | RQDropRelationship !(DropRel ('Postgres 'Vanilla))
- | RQSetRelationshipComment !(SetRelComment ('Postgres 'Vanilla))
- | RQRenameRelationship !(RenameRel ('Postgres 'Vanilla))
- | RQAddComputedField !(AddComputedField ('Postgres 'Vanilla))
- | RQDropComputedField !(DropComputedField ('Postgres 'Vanilla))
- | RQCreateRemoteRelationship !(CreateFromSourceRelationship ('Postgres 'Vanilla))
- | RQUpdateRemoteRelationship !(CreateFromSourceRelationship ('Postgres 'Vanilla))
- | RQDeleteRemoteRelationship !(DeleteFromSourceRelationship ('Postgres 'Vanilla))
- | RQCreateInsertPermission !(CreatePerm InsPerm ('Postgres 'Vanilla))
- | RQCreateSelectPermission !(CreatePerm SelPerm ('Postgres 'Vanilla))
- | RQCreateUpdatePermission !(CreatePerm UpdPerm ('Postgres 'Vanilla))
- | RQCreateDeletePermission !(CreatePerm DelPerm ('Postgres 'Vanilla))
- | RQDropInsertPermission !(DropPerm ('Postgres 'Vanilla))
- | RQDropSelectPermission !(DropPerm ('Postgres 'Vanilla))
- | RQDropUpdatePermission !(DropPerm ('Postgres 'Vanilla))
- | RQDropDeletePermission !(DropPerm ('Postgres 'Vanilla))
- | RQSetPermissionComment !(SetPermComment ('Postgres 'Vanilla))
- | RQGetInconsistentMetadata !GetInconsistentMetadata
- | RQDropInconsistentMetadata !DropInconsistentMetadata
- | RQInsert !InsertQuery
- | RQSelect !SelectQuery
- | RQUpdate !UpdateQuery
- | RQDelete !DeleteQuery
- | RQCount !CountQuery
- | RQBulk ![RQLQuery]
- | RQAddRemoteSchema !AddRemoteSchemaQuery
- | RQUpdateRemoteSchema !AddRemoteSchemaQuery
- | RQRemoveRemoteSchema !RemoteSchemaNameQuery
- | RQReloadRemoteSchema !RemoteSchemaNameQuery
- | RQIntrospectRemoteSchema !RemoteSchemaNameQuery
- | RQCreateEventTrigger !(CreateEventTriggerQuery ('Postgres 'Vanilla))
- | RQDeleteEventTrigger !(DeleteEventTriggerQuery ('Postgres 'Vanilla))
- | RQRedeliverEvent !(RedeliverEventQuery ('Postgres 'Vanilla))
- | RQInvokeEventTrigger !(InvokeEventTriggerQuery ('Postgres 'Vanilla))
- | RQCreateCronTrigger !CreateCronTrigger
- | RQDeleteCronTrigger !ScheduledTriggerName
- | RQCreateScheduledEvent !CreateScheduledEvent
- | RQCreateQueryCollection !CreateCollection
- | RQRenameQueryCollection !RenameCollection
- | RQDropQueryCollection !DropCollection
- | RQAddQueryToCollection !AddQueryToCollection
- | RQDropQueryFromCollection !DropQueryFromCollection
- | RQAddCollectionToAllowlist !AllowlistEntry
- | RQDropCollectionFromAllowlist !DropCollectionFromAllowlist
- | RQRunSql !RunSQL
- | RQReplaceMetadata !ReplaceMetadata
- | RQExportMetadata !ExportMetadata
- | RQClearMetadata !ClearMetadata
- | RQReloadMetadata !ReloadMetadata
- | RQCreateAction !CreateAction
- | RQDropAction !DropAction
- | RQUpdateAction !UpdateAction
- | RQCreateActionPermission !CreateActionPermission
- | RQDropActionPermission !DropActionPermission
- | RQCreateRestEndpoint !CreateEndpoint
- | RQDropRestEndpoint !DropEndpoint
- | RQDumpInternalState !DumpInternalState
- | RQSetCustomTypes !CustomTypes
- data RQLQueryV2
- data RQLQuery
- = RQV1 !RQLQueryV1
- | RQV2 !RQLQueryV2
- runQuery :: (MonadIO m, MonadTrace m, MonadBaseControl IO m, MonadMetadataStorage m, MonadResolveSource m, MonadQueryTags m) => Environment -> Logger Hasura -> InstanceId -> UserInfo -> RebuildableSchemaCache -> Manager -> ServerConfigCtx -> RQLQuery -> m (EncJSON, RebuildableSchemaCache)
- queryModifiesSchemaCache :: RQLQuery -> Bool
- queryModifiesUserDB :: RQLQuery -> Bool
- runQueryM :: (CacheRWM m, UserInfoM m, MonadBaseControl IO m, MonadIO m, HasHttpManagerM m, HasServerConfigCtx m, MonadTrace m, MetadataM m, MonadMetadataStorageQueryAPI m, MonadQueryTags m, MonadReader r m, Has (Logger Hasura) r) => Environment -> RQLQuery -> m EncJSON
- requiresAdmin :: RQLQuery -> Bool
Documentation
data RQLQueryV1 Source #
data RQLQueryV2 Source #
Instances
FromJSON RQLQuery Source # | |
Defined in Hasura.Server.API.Query parseJSON :: Value -> Parser RQLQuery parseJSONList :: Value -> Parser [RQLQuery] |
runQuery :: (MonadIO m, MonadTrace m, MonadBaseControl IO m, MonadMetadataStorage m, MonadResolveSource m, MonadQueryTags m) => Environment -> Logger Hasura -> InstanceId -> UserInfo -> RebuildableSchemaCache -> Manager -> ServerConfigCtx -> RQLQuery -> m (EncJSON, RebuildableSchemaCache) Source #
queryModifiesSchemaCache :: RQLQuery -> Bool Source #
A predicate that determines whether the given query might modify/rebuild the schema cache. If so, it needs to acquire the global lock on the schema cache so that other queries do not modify it concurrently.
Ideally, we would enforce this using the type system — queries for which this function returns
False
should not be allowed to modify the schema cache. But for now we just ensure consistency
by hand.
queryModifiesUserDB :: RQLQuery -> Bool Source #
A predicate that determines whether the given query might modify user's Database. If so, when the server is run in safe mode, we should not proceed with those operations.
runQueryM :: (CacheRWM m, UserInfoM m, MonadBaseControl IO m, MonadIO m, HasHttpManagerM m, HasServerConfigCtx m, MonadTrace m, MetadataM m, MonadMetadataStorageQueryAPI m, MonadQueryTags m, MonadReader r m, Has (Logger Hasura) r) => Environment -> RQLQuery -> m EncJSON Source #
requiresAdmin :: RQLQuery -> Bool Source #