ORM-ish à la TiddlyWiki 
<https://intertwingularityslicendice.neocities.org/CJ_ORM.html>

I've done a fair number of updates re cosmetics, a bit more additions to 
handle basic attributes (à la UML classes) or "value types" (à la ORM), and 
modularisation via transclusion templates.

Dissect the TiddlyWiki for your own adventure.  For your interest and 
convenience, I've plastered below the "code" that generates a summary of 
database details for the "Building"  entity.

Cheers !

[image: Screenshot 2020-11-15 at 12.29.05 AM.png]

<$vars DBL="[[" DBR="]]">

<table>
  <caption 
style="caption-side:top;border:solid;background-color:LightYellow;"><b>{{!!title}}</b></caption>

  <!-- 🔴 Attributes  -->
  <tr><th colspan="6"><i> attributes </i></th></tr>

  <tr>
    <th></th><th>name</th> <th>data type</th> <th>max size</th> <th>Not 
null</th> <th>Unique</th>
  </tr>

  <$list filter ="[contains:coded<currentTiddler>]">
  <$vars vKey={{{ [all[current]tags[]]+[match[PK]] }}}>
      <$list filter ="[all[current]get[coded]]">
        <tr>
          <$vars vNotNull={{{[all[current]split[ ]nth[2]split[:]nth[2]] 
+[removesuffix<DBR>] ☑ +[replace[1]] [[ ]] +[replace[0-1]]  }}} 
vUnique={{{[all[current]split[ ]nth[2]split[:]nth[1]] +[removeprefix<DBL>] 
[[ ]] +[replace[M]] ☑ +[replace[1]] }}}>
          <$list filter ="[all[current]split[ ]nth[3]] +[removeprefix<DBL>] 
+[removesuffix<DBR>]">
            <td>
                <!-- 🟠 Key  -->
                <<vKey>>
            </td>
            <td>
                <!-- 🟠 Name  -->
                {{||tAsDc}}
            </td>
            <td>
                <!-- 🟠 Data Type  -->
                {{!!o_data_type}}
            </td>
            <td style="text-align:right;">
                <!-- 🟠 Max Size  -->
                {{!!max_size}}
            </td>
            <td style="text-align:center;">
                <!-- 🟠 Not Null  -->
                <<vNotNull>>
            </td>
            <td style="text-align:center;">
                <!-- 🟠 Not Null  -->
                <<vUnique>>
            </td>
          </$list>
          </$vars>
        </tr>
      </$list>
  </$vars>
  </$list>

</table>

</$vars>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/219a25cd-2653-4e46-bd87-9274d9c21270n%40googlegroups.com.

Reply via email to