project-m36-0.1: Relational Algebra Engine

Safe HaskellNone
LanguageHaskell2010

ProjectM36.IsomorphicSchema

Synopsis

Documentation

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.

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.

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.

createIncDepsForIsomorph :: SchemaName -> SchemaIsomorph -> InclusionDependencies Source #

Create inclusion dependencies mainly for IsoRestrict because the predicate should hold in the base schema.