Illustration Image

Cassandra.Link

The best knowledge base on Apache Cassandra®

Helping platform leaders, architects, engineers, and operators build scalable real time data platforms.

11/11/2017

Reading time:1 min

lbruand/cql2plantuml

by John Doe

README.md Turn any CQL ( Cassandra) schema into a graphical representation.A small scala tool to transform a schema to a plantuml puml file that can be in turn transformed into a graphical representation of your CQL schema.NB : Because the CQL Schema does not contain any relation between tables, it is up to you to define the relations in the plantuml file.Download a jar file from release.get a CQL schema from C* keyspace test :cqlsh -e 'describe keyspace test;' > test.cqlrun the jar file using :java -jar cql2plantuml-1.1-jar-with-dependencies.jar test.cqlThis creates a test.puml file from your input test.cql file.This .puml file does not contain any link.You can edit it to add links.You can then run plantuml to obtain a .png or .svg file:plantuml -Tpng test.pumlplantuml -Tsvg test.pumlYou can use cql2plantuml as a maven plugin : <build> <plugins> <plugin> <groupId>cql2plantuml</groupId> <artifactId>cql2plantuml</artifactId> <version>1.1</version> <executions> <execution> <phase>compile</phase> <goals> <goal>touch</goal> </goals> <configuration> <format>svg</format> <outputPuml>true</outputPuml> <sourceFiles> <directory>src/main/resources</directory> <includes><include>**/*.cql</include> </includes> </sourceFiles> </configuration> </execution> </executions> </plugin> </plugins> </build>NB : Because cql2plantuml uses plantuml, you need to install graphviz on the machine.This work includes classes (CQL AST Parser) originally written by Tamer AbdulRadi distributed under the Apache Licence 2.0 at (https://github.com/schemasafe/troy). These classes were then modified.This work includes classes originally written by Julien Eluard distributed under the Apache Licence 2.0 at (https://github.com/jeluard/maven-plantuml-plugin). These classes were then modified.

Illustration Image

README.md

Turn any CQL ( Cassandra) schema into a graphical representation.

A small scala tool to transform a schema to a plantuml puml file that can be in turn transformed into a graphical representation of your CQL schema.

system auth

NB : Because the CQL Schema does not contain any relation between tables, it is up to you to define the relations in the plantuml file.

Download a jar file from release.

get a CQL schema from C* keyspace test :

cqlsh -e 'describe keyspace test;' > test.cql

run the jar file using :

java -jar cql2plantuml-1.1-jar-with-dependencies.jar test.cql

This creates a test.puml file from your input test.cql file. This .puml file does not contain any link. You can edit it to add links. You can then run plantuml to obtain a .png or .svg file:

plantuml -Tpng test.puml
plantuml -Tsvg test.puml

You can use cql2plantuml as a maven plugin :

    <build>
        <plugins>
            <plugin>
                <groupId>cql2plantuml</groupId>
                <artifactId>cql2plantuml</artifactId>
                <version>1.1</version>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>touch</goal>
                        </goals>
                        <configuration>
                            <format>svg</format>
                            <outputPuml>true</outputPuml>
                            <sourceFiles>
                                <directory>src/main/resources</directory>
                                <includes><include>**/*.cql</include>
                                </includes>
                            </sourceFiles>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

NB : Because cql2plantuml uses plantuml, you need to install graphviz on the machine.

This work includes classes (CQL AST Parser) originally written by Tamer AbdulRadi distributed under the Apache Licence 2.0 at (https://github.com/schemasafe/troy). These classes were then modified.

This work includes classes originally written by Julien Eluard distributed under the Apache Licence 2.0 at (https://github.com/jeluard/maven-plantuml-plugin). These classes were then modified.

Related Articles

cassandra
github
docker

thelastpickle/docker-cassandra-bootstrap

John Doe

5/25/2018

cassandra
github

Checkout Planet Cassandra

Claim Your Free Planet Cassandra Contributor T-shirt!

Make your contribution and score a FREE Planet Cassandra Contributor T-Shirt! 
We value our incredible Cassandra community, and we want to express our gratitude by sending an exclusive Planet Cassandra Contributor T-Shirt you can wear with pride.

Join Our Newsletter!

Sign up below to receive email updates and see what's going on with our company

Explore Related Topics

AllKafkaSparkScyllaSStableKubernetesApiGithubGraphQl

Explore Further

cassandra