Generates PlantUML diagrams for clickhouse databases
Project description
PlantUML generator for ClickHouse tables
This is a very early version of diagrams generator. It parses system.tables
table and produces PlantUML diagrams source. Here's example of produced diagram:
@startuml
!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 gray
Distributed(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
}
graphite.data_lr -|> graphite.data
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 <size:15><&signal></size>
Value: Float64
Time: UInt32 <size:15><&signal></size>
Date: Date <size:15><&list-rich></size>
Timestamp: UInt32
..<size:15><&list-rich></size>partition key..
toYYYYMMDD(toStartOfInterval(Date, toIntervalDay(3)))
..<size:15><&signal></size>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 <size:15><&list-rich></size> <size:15><&signal></size>
Level: UInt32 <size:15><&signal></size>
Path: String <size:15><&signal></size>
Version: UInt32
..<size:15><&list-rich></size>partition key..
toYYYYMM(Date)
..<size:15><&signal></size>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 <size:15><&list-rich></size> <size:15><&signal></size>
Tag1: String <size:15><&signal></size>
Path: String <size:15><&signal></size>
Tags: Array(String)
Version: UInt32
..<size:15><&list-rich></size>partition key..
toYYYYMM(Date)
..<size:15><&signal></size>sorting key..
Tag1, Path, Date
}
@enduml
And how it looks after running PlantUML:
Usage
python setup.py install
clickhouse-plantuml
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
clickhouse_plantuml-0.2.0.tar.gz
(52.2 kB
view hashes)
Built Distribution
Close
Hashes for clickhouse_plantuml-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5920687ae06a795b62b15f986dd47a207391680cf1cf174bbc6c89a3cfa06f21 |
|
MD5 | c06b0ee7ec9288ef33d648d9b946ece4 |
|
BLAKE2b-256 | 9ec2dbdf65bf26b99775eb733bbad2fd76c8c3954173151bd196a8098329117d |
Close
Hashes for clickhouse_plantuml-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14e7896470e326775f2e32da9ff33ffffe559e4f6f85b2cba73e61d5aa772c4c |
|
MD5 | a2cb8470e03fb40a4bc523aed05ba55b |
|
BLAKE2b-256 | 78b64f924b321a98b6252c1693ae0d243fbb3dfc67eee6e4db8c84f4c0b4e67f |