schemacrawler / SchemaCrawler

Free database schema discovery and comprehension tool
http://www.schemacrawler.com/
Other
1.6k stars 199 forks source link

Support multiple output types in a single invocation #232

Closed morl-la closed 5 years ago

morl-la commented 5 years ago

Describe the solution you'd like I would like to be able to generate multiple output formats in a single crawl - given all other parameters are common.

Use Case: I want to generate both an HTML for diff, documentation etc. and a PDF for ERD.

Sample cli usage: ... -outputformat=html,pdf outputfile=myschema would generate 2 files - myschema.html and myschema.pdf

This would improve times by a lot - as only 1 crawl is needed for any n desired output types.

Describe alternatives you've considered Running SchemaCrawler once for each output type (slow)

Additional context n/a

Thanks!

pyrocks commented 5 years ago

It's an issue I opened with my other user by mistake.

sualeh commented 5 years ago

@pyrocks - this is called a "chain" in SchemaCrawler. The easiest way to do this without writing too much code is to script it in JavaScript. Please download the SchemaCrawler distribution, and try out the chain example. Please also look at the Python example, since you can write chains in any scripting language supported by Java.

pyrocks commented 5 years ago

Thanks, I'll check.

I would consider however re-opening this and implementing it (on low priority) as:

  1. It is useful and intuitive
  2. Not everyone is a developer (although I'm sure the examples are simple enough).

If I have time I'll try to tackle it myself.

sualeh commented 5 years ago

@pyrocks - Mor - any luck with the JavaScript?

pyrocks commented 5 years ago

Hi,

Actually it was super easy.

BUT - I think it should be better documented - on the website and the example readme. chain.addNext("a", "b", "c"); I assumed a=command b=outputformat c=outputfile

Are other parameters supported? These should be explicitly written.

sualeh commented 5 years ago

@pyrocks - Mor, I have added documentation for the arguments to chain.addNext.

I am closing this issue, since it can be addressed using SchemaCrawler Shell, or by scripting using chain.