1module ProjectM36.DatabaseContextFunctionUtils where
2import ProjectM36.RelationalExpression
4import ProjectM36.DatabaseContextFunctionError
6import Control.Monad.State
7import Control.Monad.Trans.Reader
9executeDatabaseContextExpr :: DatabaseContextExpr -> TransactionId -> TransactionGraph -> DatabaseContext -> Either DatabaseContextFunctionError DatabaseContext
10executeDatabaseContextExpr expr tid graph context' = case runState (evalDatabaseContextExpr expr tid graph) (freshDatabaseState context') of
11 (Right (), st) -> pure (context st)
12 (Left err, _) -> error (show err)
14executeRelationalExpr :: RelationalExpr -> DatabaseContext -> TransactionId -> TransactionGraph -> Either RelationalError Relation
15executeRelationalExpr expr context tid graph = do
16 gfExpr <- runReader (evalRelationalExpr expr) (mkRelationalExprState context tid graph)
17 evalGraphRefRelationalExpr gfExpr graph
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list