graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellNone
LanguageHaskell2010

Hasura.Backends.Postgres.Instances.Metadata

Description

Postgres Instances Metadata

Defines a BackendMetadata type class instance for Postgres.

Synopsis

Documentation

class PostgresMetadata (pgKind :: PostgresKind) where Source #

We differentiate the handling of metadata between Citus and Vanilla Postgres because Citus imposes limitations on the types of joins that it permits, which then limits the types of relations that we can track.

Methods

validateRel :: MonadError QErr m => TableCache ('Postgres pgKind) -> QualifiedTable -> Either (ObjRelDef ('Postgres pgKind)) (ArrRelDef ('Postgres pgKind)) -> m () Source #

Orphan instances

(Backend ('Postgres pgKind), PostgresMetadata pgKind, FetchTableMetadata pgKind, FetchFunctionMetadata pgKind, ToMetadataFetchQuery pgKind) => BackendMetadata ('Postgres pgKind) Source # 
Instance details

Methods

buildComputedFieldInfo :: MonadError QErr m => HashSet (TableName ('Postgres pgKind)) -> TableName ('Postgres pgKind) -> HashSet (Column ('Postgres pgKind)) -> ComputedFieldName -> ComputedFieldDefinition ('Postgres pgKind) -> RawFunctionInfo ('Postgres pgKind) -> Comment -> m (ComputedFieldInfo ('Postgres pgKind)) Source #

fetchAndValidateEnumValues :: (MonadIO m, MonadBaseControl IO m) => SourceConfig ('Postgres pgKind) -> TableName ('Postgres pgKind) -> Maybe (PrimaryKey ('Postgres pgKind) (RawColumnInfo ('Postgres pgKind))) -> [RawColumnInfo ('Postgres pgKind)] -> m (Either QErr EnumValues) Source #

resolveSourceConfig :: (MonadIO m, MonadResolveSource m) => Logger Hasura -> SourceName -> SourceConnConfiguration ('Postgres pgKind) -> BackendSourceKind ('Postgres pgKind) -> BackendConfig ('Postgres pgKind) -> Environment -> Manager -> m (Either QErr (SourceConfig ('Postgres pgKind))) Source #

resolveDatabaseMetadata :: (MonadIO m, MonadBaseControl IO m, MonadResolveSource m) => SourceMetadata ('Postgres pgKind) -> SourceConfig ('Postgres pgKind) -> SourceTypeCustomization -> m (Either QErr (ResolvedSource ('Postgres pgKind))) Source #

parseBoolExpOperations :: (MonadError QErr m, TableCoreInfoRM ('Postgres pgKind) m) => ValueParser ('Postgres pgKind) m v -> TableName ('Postgres pgKind) -> FieldInfoMap (FieldInfo ('Postgres pgKind)) -> ColumnReference ('Postgres pgKind) -> Value -> m [OpExpG ('Postgres pgKind) v] Source #

buildFunctionInfo :: MonadError QErr m => SourceName -> FunctionName ('Postgres pgKind) -> SystemDefined -> FunctionConfig -> FunctionPermissionsMap -> RawFunctionInfo ('Postgres pgKind) -> Maybe Text -> NamingCase -> m (FunctionInfo ('Postgres pgKind), SchemaDependency) Source #

updateColumnInEventTrigger :: TableName ('Postgres pgKind) -> Column ('Postgres pgKind) -> Column ('Postgres pgKind) -> TableName ('Postgres pgKind) -> EventTriggerConf ('Postgres pgKind) -> EventTriggerConf ('Postgres pgKind) Source #

parseCollectableType :: MonadError QErr m => CollectableType (ColumnType ('Postgres pgKind)) -> Value -> m (PartialSQLExp ('Postgres pgKind)) Source #

postDropSourceHook :: (MonadError QErr m, MonadIO m, MonadBaseControl IO m) => SourceConfig ('Postgres pgKind) -> TableEventTriggers ('Postgres pgKind) -> m () Source #

validateRelationship :: MonadError QErr m => TableCache ('Postgres pgKind) -> TableName ('Postgres pgKind) -> Either (ObjRelDef ('Postgres pgKind)) (ArrRelDef ('Postgres pgKind)) -> m () Source #

buildComputedFieldBooleanExp :: (MonadError QErr m, TableCoreInfoRM ('Postgres pgKind) m) => BoolExpResolver ('Postgres pgKind) m v -> BoolExpRHSParser ('Postgres pgKind) m v -> TableName ('Postgres pgKind) -> FieldInfoMap (FieldInfo ('Postgres pgKind)) -> ComputedFieldInfo ('Postgres pgKind) -> Value -> m (AnnComputedFieldBoolExp ('Postgres pgKind) v) Source #

prepareCatalog :: forall (m :: Type -> Type). (MonadIO m, MonadBaseControl IO m) => SourceConfig ('Postgres pgKind) -> ExceptT QErr m RecreateEventTriggers Source #