Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Documentation
class (Backend b, Eq (AggregationPredicates b (PartialSQLExp b)), Eq (BooleanOperators b (PartialSQLExp b)), Eq (FunctionArgumentExp b (PartialSQLExp b)), Ord (BackendInvalidationKeys b), Hashable (AggregationPredicates b (PartialSQLExp b)), Hashable (BooleanOperators b (PartialSQLExp b)), Hashable (FunctionArgumentExp b (PartialSQLExp b)), Monoid (BackendInvalidationKeys b)) => BackendMetadata (b :: BackendType) where Source #
buildComputedFieldInfo, fetchAndValidateEnumValues, resolveSourceConfig, resolveDatabaseMetadata, parseBoolExpOperations, buildObjectRelationshipInfo, buildArrayRelationshipInfo, buildFunctionInfo, updateColumnInEventTrigger, parseCollectableType, postDropSourceHook, buildComputedFieldBooleanExp, prepareCatalog, listAllTables, listAllTrackables, getTableInfo, supportsBeingRemoteRelationshipTarget
type BackendInvalidationKeys b Source #
type BackendInvalidationKeys b = ()
buildComputedFieldInfo :: MonadError QErr m => HashSet (TableName b) -> TableName b -> HashSet (Column b) -> ComputedFieldName -> ComputedFieldDefinition b -> RawFunctionInfo b -> Comment -> m (ComputedFieldInfo b) Source #
fetchAndValidateEnumValues :: (MonadIO m, MonadBaseControl IO m) => SourceConfig b -> TableName b -> Maybe (PrimaryKey b (RawColumnInfo b)) -> [RawColumnInfo b] -> m (Either QErr EnumValues) Source #
resolveBackendInfo :: (ArrowChoice arr, ArrowCache m arr, ArrowDistribute arr, ArrowWriter (Seq CollectItem) arr, MonadIO m, MonadBaseControl IO m, ProvidesNetwork m) => Logger Hasura -> (Dependency (Maybe (BackendInvalidationKeys b)), BackendConfig b) `arr` BackendInfo b Source #
default resolveBackendInfo :: (Arrow arr, BackendInfo b ~ ()) => Logger Hasura -> (Dependency (Maybe (BackendInvalidationKeys b)), BackendConfig b) `arr` BackendInfo b Source #
resolveSourceConfig :: (MonadIO m, MonadBaseControl IO m, MonadResolveSource m) => SourceName -> SourceConnConfiguration b -> BackendSourceKind b -> BackendInfo b -> Environment -> Manager -> m (Either QErr (SourceConfig b)) Source #
Function that resolves the connection related source configuration, and creates a connection pool (and other related parameters) in the process
resolveDatabaseMetadata :: (MonadIO m, MonadBaseControl IO m, MonadResolveSource m) => Logger Hasura -> SourceMetadata b -> SourceConfig b -> m (Either QErr (DBObjectsIntrospection b)) Source #
Function that introspects a database for tables, columns, functions etc.
parseBoolExpOperations :: MonadError QErr m => ValueParser b m v -> FieldInfoMap (FieldInfo b) -> FieldInfoMap (FieldInfo b) -> ColumnReference b -> Value -> m [OpExpG b v] Source #
buildObjectRelationshipInfo :: MonadError QErr m => SourceConfig b -> SourceName -> HashMap (TableName b) (HashSet (ForeignKey b)) -> TableName b -> ObjRelDef b -> m (RelInfo b, Seq SchemaDependency) Source #
buildArrayRelationshipInfo :: MonadError QErr m => SourceConfig b -> SourceName -> HashMap (TableName b) (HashSet (ForeignKey b)) -> TableName b -> ArrRelDef b -> m (RelInfo b, Seq SchemaDependency) Source #
:: MonadError QErr m | |
=> SourceName | |
-> FunctionName b | |
-> SystemDefined | |
-> FunctionConfig b | |
-> FunctionPermissionsMap | |
-> RawFunctionInfo b | |
-> Maybe Text | the function comment |
-> NamingCase | |
-> m (FunctionInfo b, SchemaDependency) |
updateColumnInEventTrigger :: TableName b -> Column b -> Column b -> TableName b -> EventTriggerConf b -> EventTriggerConf b Source #
parseCollectableType :: (MonadError QErr m, MonadReader r m, Has (ScalarTypeParsingContext b) r) => CollectableType (ColumnType b) -> Value -> m (PartialSQLExp b) Source #
postDropSourceHook :: (MonadError QErr m, MonadIO m, MonadBaseControl IO m) => SourceConfig b -> TableEventTriggers b -> m () Source #
validateRelationship :: MonadError QErr m => TableCache b -> TableName b -> Either (ObjRelDef b) (ArrRelDef b) -> m () Source #
default validateRelationship :: MonadError QErr m => TableCache b -> TableName b -> Either (ObjRelDef b) (ArrRelDef b) -> m () Source #
buildComputedFieldBooleanExp :: (MonadError QErr m, TableCoreInfoRM b m) => BoolExpResolver b m v -> BoolExpRHSParser b m v -> FieldInfoMap (FieldInfo b) -> FieldInfoMap (FieldInfo b) -> ComputedFieldInfo b -> Value -> m (AnnComputedFieldBoolExp b v) Source #
Function that that builds a boolean expression field out of a computed field
prepareCatalog :: (MonadIO m, MonadBaseControl IO m) => SourceConfig b -> ExceptT QErr m (RecreateEventTriggers, SourceCatalogMigrationState) Source #
Run all operations required to create, update, or migrate the internal catalog used by the backend for internal bookkeeping, if any. The return type indicates whether the performed operations subsequently require re-creating event trigers.
listAllTables :: (CacheRM m, MonadBaseControl IO m, MetadataM m, MonadError QErr m, MonadIO m, MonadReader r m, Has (Logger Hasura) r, ProvidesNetwork m) => SourceName -> m [TableName b] Source #
List all the tables on a given data source, including those not tracked by Hasura. Primarily useful for user interfaces to allow untracked tables to be tracked.
listAllTrackables :: (CacheRM m, MonadBaseControl IO m, MetadataM m, MonadError QErr m, MonadIO m, MonadReader r m, Has (Logger Hasura) r, ProvidesNetwork m) => SourceName -> m (TrackableInfo b) Source #
List all the functions on a given data source, including those not tracked by Hasura. Primarily useful for user interfaces to allow untracked functions to be tracked.
getTableInfo :: (CacheRM m, MetadataM m, MonadError QErr m, MonadBaseControl IO m, MonadIO m) => SourceName -> TableName b -> m (Maybe (SourceTableInfo b)) Source #
Get information about a given table on a given source, whether tracked or not. Primarily useful for user interfaces.
validateNativeQuery :: (MonadIO m, MonadError QErr m) => Environment -> SourceConnConfiguration b -> LogicalModelInfo b -> NativeQueryMetadata b -> m (InterpolatedQuery ArgumentName) Source #
validateStoredProcedure :: (MonadIO m, MonadError QErr m) => Environment -> SourceConnConfiguration b -> LogicalModelInfo b -> StoredProcedureMetadata b -> m () Source #
getStoredProcedureGraphqlName :: MonadError QErr m => FunctionName b -> StoredProcedureConfig -> m Name Source #
supportsBeingRemoteRelationshipTarget :: SourceConfig b -> Bool Source #
Allows the backend to control whether or not a particular source supports being the target of remote relationships or not