schemacrawler / SchemaCrawler

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

Run graph from command line without arguments (-g=<config-file>) #27

Closed adriens closed 8 years ago

adriens commented 8 years ago

Goal

Be able to generate a graph (or lint) from a single and short schemacrawler command line : ideally, just running :

schemacrawler

would use the conf file to generate a graph or lint

Description

Following the command line doc :

schemacrawler -g=schemacrawler.config.properties

or

schemacrawler -g

should do the trick with schemacrawler.config.properties containing :

server=postgresql
host=svi-postgres0.site-mairie.noumea.nc
port=5432
database=contratspart
user=contratspart_adm
password=******
infolevel=maximum
schemas=contratspart_adm
c=graph
outputfile=contratspart_adm.png
outputformat=png

Unfortunately, i get this message :

➜  tmp  schemacrawler -g=schemacrawler.config.properties
No database connection URL provided
Re-run SchemaCrawler with the
-?
option for help
Or, re-run SchemaCrawler with an additional
-loglevel=CONFIG
option for details on the error

with more details, i get :

option for details on the error
Feb 09, 2016 10:11:48 AM us.fatehi.commandlineparser.CommandLineUtility logSafeArguments
INFO: SchemaCrawler, v14.05.05
Feb 09, 2016 10:11:48 AM us.fatehi.commandlineparser.CommandLineUtility logSafeArguments
INFO: Command line: 
-g=schemacrawler.config.properties
-loglevel=CONFIG
Feb 09, 2016 10:11:48 AM us.fatehi.commandlineparser.CommandLineUtility logFullStackTrace
SEVERE: No database connection URL provided
schemacrawler.schemacrawler.SchemaCrawlerCommandLineException: No database connection URL provided
        at schemacrawler.tools.commandline.CommandLineConnectionOptionsParser.loadConfig(CommandLineConnectionOptionsParser.java:57)
        at schemacrawler.tools.commandline.SchemaCrawlerCommandLine.parseConnectionOptions(SchemaCrawlerCommandLine.java:188)
        at schemacrawler.tools.commandline.SchemaCrawlerCommandLine.<init>(SchemaCrawlerCommandLine.java:91)
        at schemacrawler.Main.main(Main.java:78)

it really seems to expect a jdbc url whereas all db connexion properties have been provided.

Any idea on what i'm doig wrong ?

Thank you in advance for your help.

Best Regards

PS :

➜  tmp  schemacrawler -version
SchemaCrawler 14.05.05
Database schema discovery and comprehension tool
Copyright (c) 2000-2016, Sualeh Fatehi <sualeh@hotmail.com>.

You can search for database schema objects using regular expressions, 
and output the schema and data in a readable text format. You can find 
potential schema design issues with lint. The output serves for 
database documentation is designed to be diff-ed against other database 
schemas. SchemaCrawler also generates schema diagrams.
adriens commented 8 years ago

if i put the jdbc url iw working properly, with the single following command as described in the doc :

schemacrawler -g

hence, ths only issue is that server, host, port, database are not taken in account from the property file.

schemacrawler commented 8 years ago

Try putting -server=postgresql on the command-line

adriens commented 8 years ago

When server property added on the command line it works properly.

schemacrawler commented 8 years ago

The -server property is needed on the command-line, since it attaches an internal config file to the specified config file.

adriens commented 8 years ago

arghhhh ;-( Ok, got it. Thanks.