To be able to use a Wiki as a Database we thought we should hack up some Macro. Markus Maier in fact wrote then two of them:

  • attachment:?GetValues.py
  • attachment:?GetUniqueValues.py These suppose you organize information in definition lists like:
    Host::: ?SomeHost
    IP::: 182.168.0.1

The definition term is the database key, the definition itself is the value. One Page with such definitions is a database record.

?GetUniqueValues

This macro shows a list of unique definition values from pages

  1. whose names match the given regular expression and
  2. who contain a definition with a certain heading Usage: <span class="createlink"><a href="/sw/wiki/ikiwiki.cgi?page=GetUniqueValues__40__PageRE__44__DefinitionTermRE__41__&amp;from=TipsAnd%2FMoinMoin%2FDataBase&amp;do=create" rel="nofollow">?</a>GetUniqueValues&#40;PageRE&#44;DefinitionTermRE&#41;</span>

Examples: <span class="createlink"><a href="/sw/wiki/ikiwiki.cgi?page=GetUniqeVals__40__.__42__Service__44__Host__41__&amp;from=TipsAnd%2FMoinMoin%2FDataBase&amp;do=create" rel="nofollow">?</a>GetUniqeVals&#40;.&#42;Service&#44;Host&#41;</span> might output the following:

        Host    ?SomeHost
                ?AnotherHost
                ?TestSystem

Get Values

This macro shows a list of pages

  1. whose names match the given regular expression and
  2. who contain a definition with a certain heading which optionally has a value matching a certain regular expresion Usage: [[GetValues(PageRE,DefinitionTermRE[,DefinitionValueRE])]]

Examples: <span class="createlink"><a href="/sw/wiki/ikiwiki.cgi?page=GetValues__40__.__42__Service__44__Host__41__&amp;from=TipsAnd%2FMoinMoin%2FDataBase&amp;do=create" rel="nofollow">?</a>GetValues&#40;.&#42;Service&#44;Host&#41;</span> might output the following:

        . ?FooService
                Host:
                        ?FooHost
        . ?BarService
                Host:
                        ?BarHost