Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data SchemaExpr
- isomorphs :: Schema -> SchemaIsomorphs
- validateSchema :: Schema -> DatabaseContext -> Maybe SchemaError
- invert :: SchemaIsomorph -> SchemaIsomorph
- isomorphInRelVarNames :: SchemaIsomorph -> [RelVarName]
- isomorphsInRelVarNames :: SchemaIsomorphs -> Set RelVarName
- isomorphOutRelVarNames :: SchemaIsomorph -> [RelVarName]
- isomorphsOutRelVarNames :: SchemaIsomorphs -> Set RelVarName
- validateRelationalExprInSchema :: Schema -> RelationalExpr -> Either RelationalError ()
- processRelationalExprInSchema :: Schema -> RelationalExpr -> Either RelationalError RelationalExpr
- validateDatabaseContextExprInSchema :: Schema -> DatabaseContextExpr -> Either RelationalError ()
- processDatabaseContextExprInSchema :: Schema -> DatabaseContextExpr -> Either RelationalError DatabaseContextExpr
- processDatabaseContextExprSchemaUpdate :: Schema -> DatabaseContextExpr -> Schema
- processDatabaseContextExprSchemasUpdate :: Subschemas -> DatabaseContextExpr -> Subschemas
- relExprMorph :: SchemaIsomorph -> RelationalExpr -> Either RelationalError RelationalExpr
- relExprMogrify :: (RelationalExpr -> Either RelationalError RelationalExpr) -> RelationalExpr -> Either RelationalError RelationalExpr
- databaseContextExprMorph :: SchemaIsomorph -> (RelationalExpr -> Either RelationalError RelationalExpr) -> DatabaseContextExpr -> Either RelationalError DatabaseContextExpr
- applyRelationalExprSchemaIsomorphs :: SchemaIsomorphs -> RelationalExpr -> Either RelationalError RelationalExpr
- inclusionDependencyInSchema :: Schema -> InclusionDependency -> Either RelationalError InclusionDependency
- inclusionDependenciesInSchema :: Schema -> InclusionDependencies -> Either RelationalError InclusionDependencies
- relationVariablesInSchema :: Schema -> DatabaseContext -> Either RelationalError RelationVariables
- applyRelationVariablesSchemaIsomorphs :: SchemaIsomorphs -> RelationVariables -> Either RelationalError RelationVariables
- applySchemaIsomorphsToDatabaseContext :: SchemaIsomorphs -> DatabaseContext -> Either RelationalError DatabaseContext
- createIncDepsForIsomorph :: SchemaName -> SchemaIsomorph -> InclusionDependencies
- evalSchemaExpr :: SchemaExpr -> DatabaseContext -> Subschemas -> Either RelationalError (Subschemas, DatabaseContext)
Documentation
data SchemaExpr Source #
Instances
isomorphs :: Schema -> SchemaIsomorphs Source #
validateSchema :: Schema -> DatabaseContext -> Maybe SchemaError Source #
Return an error if the schema is not isomorphic to the base database context. A schema is fully isomorphic iff all relvars in the base context are in the "out" relvars, but only once. TODO: add relvar must appear exactly once constraint
isomorphsInRelVarNames :: SchemaIsomorphs -> Set RelVarName Source #
Relation variables names represented in the virtual schema space. Useful for determining if a relvar name is valid in the schema.
validateRelationalExprInSchema :: Schema -> RelationalExpr -> Either RelationalError () Source #
Check that all mentioned relvars are actually present in the current schema.
processRelationalExprInSchema :: Schema -> RelationalExpr -> Either RelationalError RelationalExpr Source #
validateDatabaseContextExprInSchema :: Schema -> DatabaseContextExpr -> Either RelationalError () Source #
processDatabaseContextExprInSchema :: Schema -> DatabaseContextExpr -> Either RelationalError DatabaseContextExpr Source #
processDatabaseContextExprSchemaUpdate :: Schema -> DatabaseContextExpr -> Schema Source #
If the database context expression adds or removes a relvar, we need to update the isomorphs to create a passthrough Isomorph.
relExprMorph :: SchemaIsomorph -> RelationalExpr -> Either RelationalError RelationalExpr Source #
Morph a relational expression in one schema to another isomorphic schema.
relExprMogrify :: (RelationalExpr -> Either RelationalError RelationalExpr) -> RelationalExpr -> Either RelationalError RelationalExpr Source #
databaseContextExprMorph :: SchemaIsomorph -> (RelationalExpr -> Either RelationalError RelationalExpr) -> DatabaseContextExpr -> Either RelationalError DatabaseContextExpr Source #
applyRelationalExprSchemaIsomorphs :: SchemaIsomorphs -> RelationalExpr -> Either RelationalError RelationalExpr Source #
Apply the isomorphism transformations to the relational expression to convert the relational expression from operating on one schema to a disparate, isomorphic schema.
inclusionDependencyInSchema :: Schema -> InclusionDependency -> Either RelationalError InclusionDependency Source #
inclusionDependenciesInSchema :: Schema -> InclusionDependencies -> Either RelationalError InclusionDependencies Source #
relationVariablesInSchema :: Schema -> DatabaseContext -> Either RelationalError RelationVariables Source #
applyRelationVariablesSchemaIsomorphs :: SchemaIsomorphs -> RelationVariables -> Either RelationalError RelationVariables Source #
applySchemaIsomorphsToDatabaseContext :: SchemaIsomorphs -> DatabaseContext -> Either RelationalError DatabaseContext Source #
createIncDepsForIsomorph :: SchemaName -> SchemaIsomorph -> InclusionDependencies Source #
Create inclusion dependencies mainly for IsoRestrict because the predicate should hold in the base schema.