Giter Site home page Giter Site logo

adriens / schemacrawler-additional-command-lints-as-csv Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 2.0 349 KB

An additional command for schemacrawler to dump lints as csv files and produce analytics

Home Page: https://www.linkedin.com/pulse/continuous-database-linting-dashboards-bring-analytics-adrien-sales/

License: MIT License

Java 100.00%
csv elasticsearch kibana database lint dashoard logstash schemacrawler

schemacrawler-additional-command-lints-as-csv's Introduction

Build Status

schemacrawler-additional-command-lints-as-csv

An additional command for schemacrawler to dump lints as csv files, with some additional fields.

See first linkedIn article for more details or check the Pinterest album for more samples

For people interested by gdpr, take a look at this other linkedIn article.

Usage

This additional schemacrawler command is dedicated to produce csv files that can be used to produce advanced reporting for :

  • database lints
  • table sizes (number of rows and columns), so you can report and monitor them, etc...

Thanks to the fact that csv is a very common data format, it can be used to produce intelligence and reporting in numerous technologies. I'll focus on Elastic Search reporting, but it would also be very efficient to produce analytics with any other reporting tools like Jupyter Notebook or R.

Install steps

Build the jar :

mvn clean package

then copy the jar to $SCHEMACRAWLER_HOME/lib and you're done with install steps.

To get help, simply run :

schemacrawler -help -c=csv

This jar adds the following command with the following options :

-c=csv -dbid=666 -dbenv=hell
  • -c=csv : tells that we want to dump the lints as a csv file
  • -dbid : optional paramater if you want to stick on a given database
  • -dbenv : optional paramater if you want to tag a database to an environment (typically prod, dev, test, ...)

For each run, you then get the following csv files in your working directory :

  • schemacrawler-lints-<UUID>.csv : this file contains lint outputs
  • schemacrawler-tables-<UUID>.csv : this file contains datas reporting number of rows and columns of tables, with schema, tableName, ...
  • schemacrawler-columns-<UUID>.csv : this file contains datas about table/columns

To load these files, you need the dedicated logstash configuration files. Therefore, you have two logstash configuration files samples :

  • for lints, check logstash-lints.conf
  • for table datas, check logstash-tables.conf
  • for column datas, check logstash-columns.conf

For each, you have to customize index names and input.file.path according to your needs.

Contribute

You can contribute code, but also your own dashoard realizations. Therefore, just make a PR that :

  • add an image to the img directory
  • add the screenshot to the dedicated SCREENSHOTS.md file or a link to a video : any cool demo is welcome
  • also you can ask (fill and issue on Github for that) to contribute to the dedicated Pinterest album

Contribute ideas

If you have ideas for dashboard but don't know how to create them, but still are convinced that the are interesting, please fill an issue on the project, explaining what you'd like to produce. A hand made drawing can also be a very good beginning !

Details and samples

See linkedIn article for more details or visit the dedicated Pinterest album.

Simple Kibana dashboard screenshot

Youtube demos

schemacrawler-additional-command-lints-as-csv's People

Contributors

adriens avatar dependabot-preview[bot] avatar dependabot-support avatar mbarre avatar sualeh avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

schemacrawler-additional-command-lints-as-csv's Issues

New csv for table/columns

Drop a csv with

runid, dbid,dbenv, schema, tableName, coumnPosition, columnName, ... all column available properties (type, length, ...) including the remarks

Add option to count (or not) table rows

Add an option to count (or not) table rows (see #5).

Add a switch count=y/yes or count=n/no

By default, make it count hence making this the default beahavior.

In the case the option is set to no, do no even fetch tables nor create dedicated csv

hyphen after UUID csv name files

Hi,

An hyphen exists after the UUID in the exported names file schemacrawler-columns-* and schemacrawler-tables-*.
For example :

  • schemacrawler-columns-3aa58ba3-5dda-48fd-a01b-7ac92cf0c5d7-.csv
  • schemacrawler-tables-3aa58ba3-5dda-48fd-a01b-7ac92cf0c5d7-.csv

is it possible to remove it according to the lint file format ?

Regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.