Skip to main content

Generates PlantUML diagrams for clickhouse databases

Project description

Python build and test PyPI version

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

pip install clickhouse-plantuml
clickhouse-plantuml

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clickhouse_plantuml-0.3.0-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: clickhouse_plantuml-0.3.0.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for clickhouse_plantuml-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e25ab319e85c282e6b26be0c74ef4190c0fe0cb37b225899261d962406d07dc2
MD5 12bb8aa5306d3136f2ce159f1fdf553d
BLAKE2b-256 038a1abb58415c7d621edd75fe86c071f069dd5e1ab55990cace3dd9bd54a51a

See more details on using hashes here.

Provenance

The following attestation bundles were made for clickhouse_plantuml-0.3.0.tar.gz:

Publisher: upload.yml on Felixoid/clickhouse-plantuml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for clickhouse_plantuml-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f078e2df861ebd97fd7db7d0fa406977634829006b15690ab45a014159eeb6a9
MD5 d77e811e40013a6eb1138caff88a686d
BLAKE2b-256 544da5ce5b6d299156e238d1bd55c8d433a804ad8d01329ead45cc6bb652496e

See more details on using hashes here.

Provenance

The following attestation bundles were made for clickhouse_plantuml-0.3.0-py3-none-any.whl:

Publisher: upload.yml on Felixoid/clickhouse-plantuml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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