schemacrawler / SchemaCrawler

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

Additinal command > additionalConfiguration behavior changed ? #208

Closed adriens closed 6 years ago

adriens commented 6 years ago

Environment

Specify the

  • version of SchemaCrawler that you are using : 15.01.02
  • version of Java that you are using oraclejdk-1.8 (indeed not important in this case)
  • operating system and version that you are using 'Win10` (indeed not important in this case)
  • relational datavase and version that you are using Not applicable
  • JDBC driver and version that you are using Not applicable

Issue

While implementing a new command, code that was working on previous release does not seem to work anymore, on the additionalConfiguration. As some constructors have became private, I has to change my code a bit to parse additional parameters, but since that can't get these parameters.

Here is the CONFIG log output (check outputfile ) :

INFOS: Command line:
-server=postgresql
-user=postgres
-database=sc_lint_test
-user=postgres
-password=*****
-outputfile=demo.csv
-c=csv
-loglevel=INFO

Next, in the code,I have this :

final LintOptions lintOptions = LintOptionsBuilder.builder().
        fromConfig(additionalConfiguration).toOptions();
        setLintsFilename(additionalConfiguration.getStringValue("outputfile",
        DEFAULT_LINTS_FILENAME));

which always leads me to the default param... looks like the code does not see the additional paramater.

Could you please provide some guideline to make it work in the 15.x ? I guess there's something wrong while I call LintOptionsBuilder.builder() as it is the only thing I changed.

Thank you in advance for your help. 🙏

sualeh commented 6 years ago

Let me check and see if this is a regression.

adriens commented 6 years ago

I'm in the execute() part of the AdditionalCommand class.

adriens commented 6 years ago

Hi @sualeh , do you think there is a chance to get this fixed this we ? My prototype begins to be quite consistent, but providing custom properties could make things really much more interesting 😸 Hopefully I'll release something soon with a linkedIn article also to present this in a synthetic and attractive way 😍

sualeh commented 6 years ago

@adriens - there is no regression as far as additional parameters are concerned. Can you share you repository, so I can fork the code and take a look?

sualeh commented 6 years ago

Or, explain what exactly you are trying to do?

adriens commented 6 years ago

I saw that i've developed the plugin on the 15.01.02 but that the schemcrawler version I run is the 15.01.01

I'll release the new chocolatey package hopefully today https://github.com/adriens/chocolatey-schemacrawler/projects/1 https://github.com/adriens/chocolatey-schemacrawler/issues/21

And will let you know if the issue's still here.

By the way, could you provide me some guidelines on compatibilities between plugins and schemacrawler main program ? Will for example all 15.x plugins be compatible with any of the schemacrawler 15.X ?

adriens commented 6 years ago

For now, what i'm trying to do is getting additional parameters passed at the command line....this is pretty dummy hum 😄

sualeh commented 6 years ago

Can you name the parameter something else? That works. If you need the ‘-outputfilename’ I will need to add some plumbing.

adriens commented 6 years ago

This was the parameter i overloaded 😄 I give a try with a one you don't already user and let you know 👍 Manwhile, i release the latest choco pakcage.

adriens commented 6 years ago

I canf confirm you that, on the 15.01.02, I can successfully get additional command parameters if I give them a non reserved schemacrawler keyword 👍

sualeh commented 6 years ago

By the way, could you provide me some guidelines on compatibilities between plugins and schemacrawler main program ? Will for example all 15.x plugins be compatible with any of the schemacrawler 15.X ?

I try to keep the APIs consistent for a minor SchemaCrawler version. At the minimum, you can expect the APIs not to change between 15.X.Y and 15.X.Z. Changes between 15.A.B and 15.C.D usually should be minimal. Breaking changes will be a new major version.

adriens commented 6 years ago

That's what I wax expecting. Thanks for havong confirmed it.