Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data CreateFromSourceRelationship (b :: BackendType) = CreateFromSourceRelationship {}
- runCreateRemoteRelationship :: forall b m. (MonadError QErr m, CacheRWM m, MetadataM m, BackendMetadata b) => CreateFromSourceRelationship b -> m EncJSON
- runUpdateRemoteRelationship :: forall b m. (MonadError QErr m, CacheRWM m, MetadataM m, BackendMetadata b) => CreateFromSourceRelationship b -> m EncJSON
- data DeleteFromSourceRelationship (b :: BackendType) = DeleteFromSourceRelationship {
- _drrSource :: SourceName
- _drrTable :: TableName b
- _drrName :: RelName
- runDeleteRemoteRelationship :: forall b m. (BackendMetadata b, MonadError QErr m, CacheRWM m, MetadataM m) => DeleteFromSourceRelationship b -> m EncJSON
- data CreateRemoteSchemaRemoteRelationship = CreateRemoteSchemaRemoteRelationship {}
- runCreateRemoteSchemaRemoteRelationship :: forall m. (MonadError QErr m, CacheRWM m, MetadataM m) => CreateRemoteSchemaRemoteRelationship -> m EncJSON
- runUpdateRemoteSchemaRemoteRelationship :: forall m. (MonadError QErr m, CacheRWM m, MetadataM m) => CreateRemoteSchemaRemoteRelationship -> m EncJSON
- data DeleteRemoteSchemaRemoteRelationship = DeleteRemoteSchemaRemoteRelationship {}
- runDeleteRemoteSchemaRemoteRelationship :: forall m. (MonadError QErr m, CacheRWM m, MetadataM m) => DeleteRemoteSchemaRemoteRelationship -> m EncJSON
- data PartiallyResolvedSource b = PartiallyResolvedSource {
- _prsSourceMetadata :: SourceMetadata b
- _resolvedSource :: ResolvedSource b
- _tableCoreInfoMap :: HashMap (TableName b) (TableCoreInfoG b (ColumnInfo b) (ColumnInfo b))
- _eventTriggerInfoMap :: HashMap (TableName b) (EventTriggerInfoMap b)
- buildRemoteFieldInfo :: QErrM m => LHSIdentifier -> HashMap FieldName lhsJoinField -> RemoteRelationship -> HashMap SourceName (AnyBackend PartiallyResolvedSource) -> RemoteSchemaMap -> m (RemoteFieldInfo lhsJoinField, [SchemaDependency])
- getRemoteSchemaEntityJoinColumns :: MonadError QErr m => RemoteSchemaName -> RemoteSchemaIntrospection -> Name -> m (HashMap FieldName Name)
Documentation
data CreateFromSourceRelationship (b :: BackendType) Source #
Argument to the _create_remote_relationship
and
_update_remote_relationship
families of metadata commands.
For historical reason, this type is also used to represent a db-to-rs schema in the metadata.
Instances
runCreateRemoteRelationship :: forall b m. (MonadError QErr m, CacheRWM m, MetadataM m, BackendMetadata b) => CreateFromSourceRelationship b -> m EncJSON Source #
runUpdateRemoteRelationship :: forall b m. (MonadError QErr m, CacheRWM m, MetadataM m, BackendMetadata b) => CreateFromSourceRelationship b -> m EncJSON Source #
data DeleteFromSourceRelationship (b :: BackendType) Source #
Argument to the _drop_remote_relationship
family of metadata commands.
Instances
Backend b => FromJSON (DeleteFromSourceRelationship b) Source # | |
Defined in Hasura.RQL.DDL.RemoteRelationship parseJSON :: Value -> Parser (DeleteFromSourceRelationship b) parseJSONList :: Value -> Parser [DeleteFromSourceRelationship b] |
runDeleteRemoteRelationship :: forall b m. (BackendMetadata b, MonadError QErr m, CacheRWM m, MetadataM m) => DeleteFromSourceRelationship b -> m EncJSON Source #
data CreateRemoteSchemaRemoteRelationship Source #
Instances
runCreateRemoteSchemaRemoteRelationship :: forall m. (MonadError QErr m, CacheRWM m, MetadataM m) => CreateRemoteSchemaRemoteRelationship -> m EncJSON Source #
runUpdateRemoteSchemaRemoteRelationship :: forall m. (MonadError QErr m, CacheRWM m, MetadataM m) => CreateRemoteSchemaRemoteRelationship -> m EncJSON Source #
data DeleteRemoteSchemaRemoteRelationship Source #
Argument to the _drop_remote_relationship
family of metadata commands.
DeleteRemoteSchemaRemoteRelationship | |
|
Instances
FromJSON DeleteRemoteSchemaRemoteRelationship Source # | |
Defined in Hasura.RQL.DDL.RemoteRelationship parseJSON :: Value -> Parser DeleteRemoteSchemaRemoteRelationship parseJSONList :: Value -> Parser [DeleteRemoteSchemaRemoteRelationship] |
runDeleteRemoteSchemaRemoteRelationship :: forall m. (MonadError QErr m, CacheRWM m, MetadataM m) => DeleteRemoteSchemaRemoteRelationship -> m EncJSON Source #
data PartiallyResolvedSource b Source #
Internal intermediary step.
We build the output of sources in two steps: 1. we first resolve sources, and collect the core info of their tables 2. we then build the entire output from the collection of partially resolved sources
We need this split to be able to resolve cross-source relationships: to process one source's remote relationship, we need to know about the target source's tables core info.
This data structure is used as an argument to AnyBackend
in the backend-agnostic intermediary
collection, and used here to build remote field info.
PartiallyResolvedSource | |
|
:: QErrM m | |
=> LHSIdentifier | The entity on which the remote relationship is defined |
-> HashMap FieldName lhsJoinField | join fields provided by the LHS entity |
-> RemoteRelationship | definition of remote relationship |
-> HashMap SourceName (AnyBackend PartiallyResolvedSource) | Required context to process cross boundary relationships |
-> RemoteSchemaMap | Required context to process cross boundary relationships |
-> m (RemoteFieldInfo lhsJoinField, [SchemaDependency]) | returns 1. schema cache representation of the remote relationships 2. the dependencies on the RHS of the join. The dependencies on the LHS entities has to be handled by the calling function |
Builds the schema cache representation of a remote relationship TODO: this is not actually called by the remote relationship DDL API and is only used as part of the schema cache process. Should this be moved elsewhere?
getRemoteSchemaEntityJoinColumns :: MonadError QErr m => RemoteSchemaName -> RemoteSchemaIntrospection -> Name -> m (HashMap FieldName Name) Source #