Skip to content

Turn any Cassandra CQL schema into a graphical representation.

License

Notifications You must be signed in to change notification settings

lbruand/cql2plantuml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CQL2Plantuml

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.

Gallery

System auth from Cassandra

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.

Downloads

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

Maven plugin

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.

Derivative work warning

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.

About

Turn any Cassandra CQL schema into a graphical representation.

Resources

License

Stars

Watchers

Forks

Packages

No packages published