aboutsummaryrefslogtreecommitdiff
path: root/dump.scm
diff options
context:
space:
mode:
authorArun Isaac2021-12-11 18:56:39 +0530
committerArun Isaac2021-12-11 18:56:39 +0530
commit2625d55ec1c46e0bdde77e4f94729de055359ba1 (patch)
tree8aca67b4a0e4cb789d079866d3715eccfbab196a /dump.scm
parenta8d8bda3ea03b2f4d1cc99c66e8d2defaffc2758 (diff)
downloadgn-transform-databases-2625d55ec1c46e0bdde77e4f94729de055359ba1.tar.gz
Highlight dumped tables and columns.
* dump.scm (dump-schema): Highlight tables and columns.
Diffstat (limited to 'dump.scm')
-rwxr-xr-xdump.scm28
1 files changed, 21 insertions, 7 deletions
diff --git a/dump.scm b/dump.scm
index 43f3ea6..3d86536 100755
--- a/dump.scm
+++ b/dump.scm
@@ -610,15 +610,29 @@ metric."
((@@ (ccwl graphviz) graph-node)
(table-name table)
`((shape . "record")
- (label . ,(format #f "{~a (~a) | ~a}"
+ (style . "filled")
+ (fillcolor . ,(if (find (match-lambda
+ ((dumped-table . _)
+ (string=? (symbol->string dumped-table)
+ (table-name table))))
+ %dumped)
+ "lightgrey"
+ "white"))
+ (label . ,(format #f "<<table border=\"0\"><tr><td border=\"1\">~a (~a)</td></tr>~a</table>>"
(table-name table)
(human-units (table-size table))
- (string-replace-substring
- (string-replace-substring
- (string-join (map column-name (table-columns table))
- "\\l" 'suffix)
- "<" "\\<")
- ">" "\\>"))))))
+ (string-join (map (lambda (column)
+ (format #f "<tr><td~a>~a</td></tr>"
+ (if (member (cons (string->symbol (table-name table))
+ (string->symbol (column-name column)))
+ %dumped)
+ " bgcolor=\"green\""
+ "")
+ (replace-substrings
+ (column-name column)
+ '(("<" . "&lt;")
+ (">" . "&gt;")))))
+ (table-columns table))))))))
tables)
#:edges (append-map (lambda (table)
(filter-map (lambda (column)