1{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
2{-# OPTIONS_GHC -fno-warn-orphans #-}
3module TutorialD.Interpreter.TransGraphRelationalOperator where
4import ProjectM36.TransGraphRelationalExpression
5import ProjectM36.TransactionGraph
6import qualified ProjectM36.Client as C
8import TutorialD.Interpreter.Base
9import TutorialD.Interpreter.RelationalExpr
12import Text.Megaparsec.Text
14import qualified Data.Text as T
16instance RelationalMarkerExpr TransactionIdLookup where
17 parseMarkerP = string "@" *> transactionIdLookupP
19data TransGraphRelationalOperator = ShowTransGraphRelation TransGraphRelationalExpr
21transactionIdLookupP :: Parser TransactionIdLookup
22transactionIdLookupP = (TransactionIdLookup <$> uuidP) <|>
23 (TransactionIdHeadNameLookup <$> identifier)
25transGraphRelationalOpP :: Parser TransGraphRelationalOperator
26transGraphRelationalOpP = showTransGraphRelationalOpP
28showTransGraphRelationalOpP :: Parser TransGraphRelationalOperator
29showTransGraphRelationalOpP = do
30 reservedOp ":showtransgraphexpr"
31 ShowTransGraphRelation <$> relExprP
33evalTransGraphRelationalOp :: C.SessionId -> C.Connection -> TransGraphRelationalOperator -> IO TutorialDOperatorResult
34evalTransGraphRelationalOp sessionId conn (ShowTransGraphRelation expr) = do
35 res <- C.executeTransGraphRelationalExpr sessionId conn expr
37 Left err -> pure $ DisplayErrorResult $ T.pack (show err)
38 Right rel -> pure $ DisplayRelationResult rel
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