https://github.com/mbarre/schemacrawler-additional-lints
Some additionnal lints for Schemacrawler
https://github.com/mbarre/schemacrawler-additional-lints
database java lints schemacrawler
Last synced: about 2 months ago
JSON representation
Some additionnal lints for Schemacrawler
- Host: GitHub
- URL: https://github.com/mbarre/schemacrawler-additional-lints
- Owner: mbarre
- License: other
- Created: 2015-07-16T23:45:16.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2023-01-23T07:02:37.000Z (over 2 years ago)
- Last Synced: 2025-04-23T08:16:50.608Z (about 2 months ago)
- Topics: database, java, lints, schemacrawler
- Language: Java
- Size: 7.94 MB
- Stars: 13
- Watchers: 3
- Forks: 7
- Open Issues: 41
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Schemacrawler Additional Lints
[](http://mbarre.github.io/schemacrawler-additional-lints/)
[](https://travis-ci.org/mbarre/schemacrawler-additional-lints)
[](https://jitpack.io/mbarre/schemacrawler-additional-lints)
[](https://coveralls.io/github/mbarre/schemacrawler-additional-lints?branch=master)
[](https://gitter.im/mbarre/schemacrawler-additional-lints?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Some additional lints for [Schemacrawler](http://sualeh.github.io/SchemaCrawler/)
# Main purpose
The main purpose of this lint library is to enhance native schemacrawler lints
with some more hardcore constraints and some specific postgres types. That's
why a postgreSQL database instance is required to test.This project has been created to be used at our former office
[Mairie de la Ville de Nouméa](http://www.noumea.nc/) to test our database
schema quality in a more easy way and make it possible for our partners to
apply our database quality policy the easy way.# Build and install lint
**Notice that this version is designed to run on schemacrawler `14.x.x`...
and hence is requiring JDK-1.8 to be built and run.**For now the jar is not available on maven central repo, so you'll have to build it yourself :
git clone https://github.com/mbarre/schemacrawler-additional-lints.git schemacrawler-additional-lints
cd schemacrawler-additional-lints
export LINT_VERSION=1.02.02Build without testing as a local postgres install is required to test.
mvn install -Dmaven.test.skip=true
cp target/schemacrawler-additional-lints-${LINT_VERSION}.jar $SCHEMACRAWLER_HOME/lib... and you're done, you just have to pass your
normal [schemacrawler lint](http://sualeh.github.io/SchemaCrawler/lint.html)
command and enjoy.# Build and test
To be able to test locally, assuming you have a locally postgreSQL instance
up and running with the proper `superuser` account, then run the following
commandsdropdb --if-exists sc_lint_test
createdb sc_lint_test
mvn install
cp target/schemacrawler-additional-lints-${LINT_VERSION}.jar $SCHEMACRAWLER_HOME/lib
Or, install [Docker Compose](https://docs.docker.com/compose/install/) to deploy PostgreSQL and the databasedocker-compose -f docker/postgresql.yml up
mvn install
cp target/schemacrawler-additional-lints-${LINT_VERSION}.jar $SCHEMACRAWLER_HOME/lib
# Docker ImageSchemacrawler Additional Lints is now released with an image on Docker Hub. This is an extension of the [SchemaCrawler Docker Image](https://www.schemacrawler.com/docker-image.html).
You can run docker container like this :
docker run --name schemacrawler-additional-lints --rm -i -t --entrypoint=/bin/bash --net=host mbarre/schemacrawler-additional-lints
--net=host option will allow you to work on database deployed on your host.
Use the Schemacrawler Interactive Shell
schemacrawler --shell
Use the following script from within the shell to launch the lints analysis :connect --server=your_db_server --database=your_db --user=your_user
load --info-level=minimum
execute --command lintOr, simplier...
schemacrawler --server=your_db_server --database=your_db --user=your_user --info-level=minimum --command lintThe docker image also includes the command which export lints in csv files, for more information see [adriens/schemacrawler-additional-command-lints-as-csv](https://github.com/adriens/schemacrawler-additional-command-lints-as-csv)
You can try it this way :
schemacrawler --server=your_db_server --database=your_db --user=your_user --info-level=minimum --command csv
A default linter config file is available in the schemacrawler container home directory : **schemacrawler-linter-config.xml**.
You can use it to include or exclude tables, change the lints severity, by adding **--linter-configs=schemacrawler-linter-config.xml** to lint and csv commands.# Pre-release tasks
Check that dependencies are up-to-date :
mvn versions:display-dependency-updates
Check that plugins are up-to-date :
mvn versions:display-plugin-updates
# Command line examples
schemacrawler -server=postgresql -host=localhost -port=5432 -database=pdc -user=pdc_adm -password=pdc_adm -infolevel=maximum -schemas=pdc_adm -loglevel=INFO -c=lint --outputfile=lint_pdc.html -outputformat=html
# Donate
If you like this lint library, you can donate :
* Stars on github
* Ideas for new lints
* Code for new lints
* Code to increase code coverage
* [Create issue](https://github.com/mbarre/schemacrawler-additional-lints/issues)
* A nice logo
* Feebdack on this library
* Anything you think that could make us happy to go on developing this library,
including just some kind words on our gitter# Thanks
![]()
To Jetbrains for offering an [IntelliJ IDEA](https://www.jetbrains.com/idea/?fromMenu) Free Open Source License to this project contributors.