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

Hasura.Backends.Postgres.Instances.Metadata

Description

Postgres Instances Metadata

Defines a BackendMetadata type class instance for Postgres.

Orphan instances

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

Associated Types

type BackendInvalidationKeys ('Postgres pgKind) Source #

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 #

resolveBackendInfo :: forall arr (m :: Type -> Type). (ArrowChoice arr, ArrowCache m arr, ArrowDistribute arr, ArrowWriter (Seq CollectItem) arr, MonadIO m, MonadBaseControl IO m, ProvidesNetwork m) => Logger Hasura -> arr (Dependency (Maybe (BackendInvalidationKeys ('Postgres pgKind))), BackendConfig ('Postgres pgKind)) (BackendInfo ('Postgres pgKind)) Source #

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

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

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

buildObjectRelationshipInfo :: MonadError QErr m => SourceConfig ('Postgres pgKind) -> SourceName -> HashMap (TableName ('Postgres pgKind)) (HashSet (ForeignKey ('Postgres pgKind))) -> TableName ('Postgres pgKind) -> ObjRelDef ('Postgres pgKind) -> m (RelInfo ('Postgres pgKind), Seq SchemaDependency) Source #

buildArrayRelationshipInfo :: MonadError QErr m => SourceConfig ('Postgres pgKind) -> SourceName -> HashMap (TableName ('Postgres pgKind)) (HashSet (ForeignKey ('Postgres pgKind))) -> TableName ('Postgres pgKind) -> ArrRelDef ('Postgres pgKind) -> m (RelInfo ('Postgres pgKind), Seq SchemaDependency) Source #

buildFunctionInfo :: MonadError QErr m => SourceName -> FunctionName ('Postgres pgKind) -> SystemDefined -> FunctionConfig ('Postgres pgKind) -> 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, MonadReader r m, Has (ScalarTypeParsingContext ('Postgres pgKind)) r) => 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 -> FieldInfoMap (FieldInfo ('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, SourceCatalogMigrationState) Source #

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 ('Postgres pgKind)] Source #

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 ('Postgres pgKind)) Source #

getTableInfo :: (CacheRM m, MetadataM m, MonadError QErr m, MonadBaseControl IO m, MonadIO m) => SourceName -> TableName ('Postgres pgKind) -> m (Maybe (SourceTableInfo ('Postgres pgKind))) Source #

validateNativeQuery :: (MonadIO m, MonadError QErr m) => Environment -> SourceConnConfiguration ('Postgres pgKind) -> LogicalModelInfo ('Postgres pgKind) -> NativeQueryMetadata ('Postgres pgKind) -> m (InterpolatedQuery ArgumentName) Source #

validateStoredProcedure :: (MonadIO m, MonadError QErr m) => Environment -> SourceConnConfiguration ('Postgres pgKind) -> LogicalModelInfo ('Postgres pgKind) -> StoredProcedureMetadata ('Postgres pgKind) -> m () Source #

getStoredProcedureGraphqlName :: MonadError QErr m => FunctionName ('Postgres pgKind) -> StoredProcedureConfig -> m Name Source #

supportsBeingRemoteRelationshipTarget :: SourceConfig ('Postgres pgKind) -> Bool Source #