Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/felixoid/clickhouse-plantuml
PlantUML generator for ClickHouse DBs and tables
https://github.com/felixoid/clickhouse-plantuml
clickhouse clickhouse-database plantuml python python3 scripts
Last synced: 2 months ago
JSON representation
PlantUML generator for ClickHouse DBs and tables
- Host: GitHub
- URL: https://github.com/felixoid/clickhouse-plantuml
- Owner: Felixoid
- License: apache-2.0
- Created: 2020-04-18T08:34:33.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-06-28T22:03:08.000Z (over 3 years ago)
- Last Synced: 2024-08-10T21:21:28.565Z (5 months ago)
- Topics: clickhouse, clickhouse-database, plantuml, python, python3, scripts
- Language: Python
- Homepage:
- Size: 108 KB
- Stars: 26
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![Python package](https://github.com/Felixoid/clickhouse-plantuml/workflows/Python%20package/badge.svg)
# PlantUML generator for ClickHouse tables
This is a very early version of diagrams generator. It parses `system.tables` table and produces [PlantUML](https://plantuml.com) diagrams source. Here's example of produced diagram:
```plantuml
@startuml
' This diagram is generated with https://github.com/Felixoid/clickhouse-plantuml
!define Table(x) class x << (T,mistyrose) >>
!define View(x) class x << (V,lightblue) >>
!define MaterializedView(x) class x << (m,orange) >>
!define Distributed(x) class x << (D,violet) >>hide empty methods
hide stereotypes
skinparam classarrowcolor grayDistributed(graphite.data) {
ENGINE=**Distributed**
..engine config..
cluster: graphite_data
database: graphite
table: data_lr
sharding_key: cityHash64(Path)
==columns==
Path: String
Value: Float64
Time: UInt32
Date: Date
Timestamp: UInt32
}Table(graphite.data_lr) {
ENGINE=**ReplicatedGraphiteMergeTree**
..engine config..
rollup_config: graphite_rollup
..replication..
zoo_path: /clickhouse/tables/graphite.data_lr/{shard}
replica: {replica}
==columns==
Path: String <&signal>
Value: Float64
Time: UInt32 <&signal>
Date: Date <&list-rich>
Timestamp: UInt32
..<&list-rich>partition key..
toYYYYMMDD(toStartOfInterval(Date, toIntervalDay(3)))
..<&signal>sorting key..
Path, Time
}Table(graphite.index) {
ENGINE=**ReplicatedReplacingMergeTree**
..engine config..
version: Version
..replication..
zoo_path: /clickhouse/tables/graphite.index/1
replica: {replica}
==columns==
Date: Date <&list-rich> <&signal>
Level: UInt32 <&signal>
Path: String <&signal>
Version: UInt32
..<&list-rich>partition key..
toYYYYMM(Date)
..<&signal>sorting key..
Level, Path, Date
}Table(graphite.tagged) {
ENGINE=**ReplicatedReplacingMergeTree**
..engine config..
version: Version
..replication..
zoo_path: /clickhouse/tables/graphite.tagged/1
replica: {replica}
==columns==
Date: Date <&list-rich> <&signal>
Tag1: String <&signal>
Path: String <&signal>
Tags: Array(String)
Version: UInt32
..<&list-rich>partition key..
toYYYYMM(Date)
..<&signal>sorting key..
Tag1, Path, Date
}graphite.data_lr -|> graphite.data
@enduml
```And how it looks after running PlantUML:
![example](./docs/example.png)## Usage
```bash
python setup.py install
clickhouse-plantuml
```