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

Hasura.RQL.Types.Metadata.Backend

Documentation

class (Backend b, Eq (AggregationPredicates b (PartialSQLExp b)), Eq (BooleanOperators b (PartialSQLExp b)), Eq (FunctionArgumentExp b (PartialSQLExp b)), Hashable (AggregationPredicates b (PartialSQLExp b)), Hashable (BooleanOperators b (PartialSQLExp b)), Hashable (FunctionArgumentExp b (PartialSQLExp b))) => BackendMetadata (b :: BackendType) where Source #

Methods

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 #

resolveSourceConfig :: (MonadIO m, MonadResolveSource m) => Logger Hasura -> SourceName -> SourceConnConfiguration b -> BackendSourceKind b -> BackendConfig 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) => SourceMetadata b -> SourceConfig b -> SourceTypeCustomization -> m (Either QErr (ResolvedSource b)) Source #

Function that introspects a database for tables, columns, functions etc.

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

buildFunctionInfo Source #

Arguments

:: MonadError QErr m 
=> SourceName 
-> FunctionName b 
-> SystemDefined 
-> FunctionConfig 
-> 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 => 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 #

buildComputedFieldBooleanExp :: (MonadError QErr m, TableCoreInfoRM b m) => BoolExpResolver b m v -> BoolExpRHSParser b m v -> TableName 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 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.

Instances

Instances details
BackendMetadata 'MSSQL Source # 
Instance details

Defined in Hasura.Backends.MSSQL.Instances.Metadata

Methods

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

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

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

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

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

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

updateColumnInEventTrigger :: TableName 'MSSQL -> Column 'MSSQL -> Column 'MSSQL -> TableName 'MSSQL -> EventTriggerConf 'MSSQL -> EventTriggerConf 'MSSQL Source #

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

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

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

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

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

BackendMetadata 'BigQuery Source # 
Instance details

Defined in Hasura.Backends.BigQuery.Instances.Metadata

Methods

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

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

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

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

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

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

updateColumnInEventTrigger :: TableName 'BigQuery -> Column 'BigQuery -> Column 'BigQuery -> TableName 'BigQuery -> EventTriggerConf 'BigQuery -> EventTriggerConf 'BigQuery Source #

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

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

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

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

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

BackendMetadata 'MySQL Source # 
Instance details

Defined in Hasura.Backends.MySQL.Instances.Metadata

Methods

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

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

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

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

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

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

updateColumnInEventTrigger :: TableName 'MySQL -> Column 'MySQL -> Column 'MySQL -> TableName 'MySQL -> EventTriggerConf 'MySQL -> EventTriggerConf 'MySQL Source #

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

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

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

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

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

BackendMetadata 'DataConnector Source # 
Instance details

Defined in Hasura.Backends.DataConnector.Adapter.Metadata

Methods

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

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

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

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

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

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

updateColumnInEventTrigger :: TableName 'DataConnector -> Column 'DataConnector -> Column 'DataConnector -> TableName 'DataConnector -> EventTriggerConf 'DataConnector -> EventTriggerConf 'DataConnector Source #

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

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

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

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

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

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

Defined in Hasura.Backends.Postgres.Instances.Metadata

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 #