1{-# LANGUAGE OverloadedStrings #-}
2--compile with `cabal exec ghc -- examples/DynamicDatabaseContextFunctions.hs -package project-m36`
3--load with `loaddatabasecontextfunctions "DynamicDatabaseContextFunctions" "someDBCFunctions" "examples/DynamicDatabaseContextFunctions.o"`
4module DynamicDatabaseContextFunctions where
6import ProjectM36.Relation
7import ProjectM36.DatabaseContextFunctionError
8import qualified ProjectM36.Attribute as A
10import qualified Data.Map as M
13someDBCFunctions :: [DatabaseContextFunction]
14someDBCFunctions = [DatabaseContextFunction {
15 dbcFuncName = "addtestrel",
17 dbcFuncBody = DatabaseContextFunctionBody Nothing addTestRel
21 let attrs = A.attributesFromList [Attribute "word" TextAtomType]
22 eRel = mkRelationFromList attrs [[TextAtom "nice"]]
24 Left err -> Left (DatabaseContextFunctionUserError (show err))
26 pure $ ctx { relationVariables = M.insert "testRel" testRel (relationVariables ctx) }
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