Skip to main content

Generates PlantUML diagrams for clickhouse databases

Project description

Python package

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
' 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 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
}

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
}

graphite.data_lr -|> graphite.data
@enduml

And how it looks after running PlantUML:
example

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.2.tar.gz (52.6 kB view details)

Uploaded Source

Built Distribution

clickhouse_plantuml-0.2.2-py3-none-any.whl (56.4 kB view details)

Uploaded Python 3

File details

Details for the file clickhouse_plantuml-0.2.2.tar.gz.

File metadata

  • Download URL: clickhouse_plantuml-0.2.2.tar.gz
  • Upload date:
  • Size: 52.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for clickhouse_plantuml-0.2.2.tar.gz
Algorithm Hash digest
SHA256 8fb392cec5ffcb7b40b56b48e0a069edd331391a98dc0a0df517fdf4fcf1256b
MD5 d8edcb7e124a50d200067dd2357ac2b0
BLAKE2b-256 047bd2932fdfaed238ea279376428a430edd3839498d323a8f96d9c511aae6d0

See more details on using hashes here.

File details

Details for the file clickhouse_plantuml-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: clickhouse_plantuml-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 56.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for clickhouse_plantuml-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3e43f3aebdb487a9693091269df18bf6a66247aeb5357f04da20c9d015aaf8bd
MD5 e5738e8c8c22b163be383484f6814b35
BLAKE2b-256 88679078d49083e12042311acf195dbbf99b5850fbf6d4406a8661ca12003592

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page