I'm trying to get a diagram from my sqlite3 file, a ruby-on-rails db in development. I read the docs and some other sites about how to make this happen on the command line:
. ./schemacrawler.sh server=sqlite -database=/absolute/path/to/db/developer.sqlite3 -outputformat=png -outputfile=/Users/myuser/ER.png -command=graph -infolevel=maximum -user= -password= -loglevel=ALL
but it is constantly asking for "Please provde a database connection URL". What am I missing here? As far as I know is, that sqlite needs no database-connection - all is stored in that file.sqlite3. I tried -server=offline and provided a developer.xml file. Same result. Here is the log:
. ./schemacrawler.sh server=sqlite -database=/absolute/path/to/db/developer.sqlite3 -outputformat=png -outputfile=/Users/myuser/ER.png -command=graph -infolevel=maximum -user= -password= -loglevel=CONFIG
Sep 12, 2017 10:12:48 PM us.fatehi.commandlineparser.CommandLineUtility logSafeArguments
INFORMATION: SchemaCrawler, v14.16.03
Sep 12, 2017 10:12:48 PM us.fatehi.commandlineparser.CommandLineUtility logSafeArguments
INFORMATION: Command line:
server=sqlite
-database=/absolute/path/to/db/developer.sqlite3
-outputformat=png
-outputfile=/Users/myuser/ER.png
-command=graph
-infolevel=maximum
-user=
-password=*****
-loglevel=CONFIG
Sep 12, 2017 10:12:48 PM us.fatehi.commandlineparser.CommandLineUtility logSystemProperties
KONFIGURATION: System properties:
java.awt.graphicsenv=sun.awt.CGraphicsEnvironment
java.awt.printerjob=sun.lwawt.macosx.CPrinterJob
java.class.version=52.0
java.endorsed.dirs=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/endorsed
java.ext.dirs=/Users/myuser/Library/Java/Extensions:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/ext:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre
java.io.tmpdir=/var/folders/2s/z3r402895bv4gz9db5sm_m8w0000gn/T/
java.runtime.name=Java(TM) SE Runtime Environment
java.runtime.version=1.8.0_144-b01
java.specification.name=Java Platform API Specification
java.specification.vendor=Oracle Corporation
java.specification.version=1.8
java.vendor=Oracle Corporation
java.vendor.url=http://java.oracle.com/
java.vendor.url.bug=http://bugreport.sun.com/bugreport/
java.version=1.8.0_144
java.vm.info=mixed mode
java.vm.name=Java HotSpot(TM) 64-Bit Server VM
java.vm.specification.name=Java Virtual Machine Specification
java.vm.specification.vendor=Oracle Corporation
java.vm.specification.version=1.8
java.vm.vendor=Oracle Corporation
java.vm.version=25.144-b01
os.arch=x86_64
os.name=Mac OS X
os.version=10.10.5
Sep 12, 2017 10:12:48 PM us.fatehi.commandlineparser.CommandLineUtility logSystemProperties
KONFIGURATION: Classpath:
lib/derby-10.13.1.1.jar
lib/h2-1.4.196.jar
lib/hsqldb-2.4.0.jar
lib/mssql-jdbc-6.2.0.jre8.jar
lib/mysql-connector-java-6.0.6.jar
lib/postgresql-42.1.1.jar
lib/schemacrawler-14.16.03.jar
lib/schemacrawler-db2-14.16.03.jar
lib/schemacrawler-hsqldb-14.16.03.jar
lib/schemacrawler-lint-14.16.03.jar
lib/schemacrawler-mysql-14.16.03.jar
lib/schemacrawler-offline-14.16.03.jar
lib/schemacrawler-oracle-14.16.03.jar
lib/schemacrawler-postgresql-14.16.03.jar
lib/schemacrawler-sqlite-14.16.03.jar
lib/schemacrawler-sqlserver-14.16.03.jar
lib/sqlite-jdbc-3.7.8.jar
lib/xmlpull-1.1.3.1.jar
lib/xpp3_min-1.1.4c.jar
lib/xstream-1.4.10.jar
config
Sep 12, 2017 10:12:48 PM schemacrawler.tools.databaseconnector.DatabaseConnectorRegistry loadDatabaseConnectorRegistry
KONFIGURATION: Loading database connector, db2=schemacrawler.server.db2.DB2DatabaseConnector
Sep 12, 2017 10:12:48 PM schemacrawler.tools.databaseconnector.DatabaseConnectorRegistry loadDatabaseConnectorRegistry
KONFIGURATION: Loading database connector, hsqldb=schemacrawler.server.hsqldb.HyperSQLDatabaseConnector
Sep 12, 2017 10:12:48 PM schemacrawler.tools.databaseconnector.DatabaseConnectorRegistry loadDatabaseConnectorRegistry
KONFIGURATION: Loading database connector, mysql=schemacrawler.server.mysql.MySQLDatabaseConnector
Sep 12, 2017 10:12:48 PM schemacrawler.tools.databaseconnector.DatabaseConnectorRegistry loadDatabaseConnectorRegistry
KONFIGURATION: Loading database connector, offline=schemacrawler.tools.offline.OfflineDatabaseConnector
Sep 12, 2017 10:12:48 PM schemacrawler.tools.databaseconnector.DatabaseConnectorRegistry loadDatabaseConnectorRegistry
KONFIGURATION: Loading database connector, oracle=schemacrawler.server.oracle.OracleDatabaseConnector
Sep 12, 2017 10:12:48 PM schemacrawler.tools.databaseconnector.DatabaseConnectorRegistry loadDatabaseConnectorRegistry
KONFIGURATION: Loading database connector, postgresql=schemacrawler.server.postgresql.PostgreSQLDatabaseConnector
Sep 12, 2017 10:12:48 PM schemacrawler.tools.databaseconnector.DatabaseConnectorRegistry loadDatabaseConnectorRegistry
KONFIGURATION: Loading database connector, sqlite=schemacrawler.tools.sqlite.SQLiteDatabaseConnector
Sep 12, 2017 10:12:48 PM schemacrawler.tools.databaseconnector.DatabaseConnectorRegistry loadDatabaseConnectorRegistry
KONFIGURATION: Loading database connector, sqlserver=schemacrawler.server.sqlserver.SqlServerDatabaseConnector
Sep 12, 2017 10:12:48 PM schemacrawler.tools.databaseconnector.DatabaseConnectorRegistry logRegisteredJdbcDrivers
KONFIGURATION: Registered JDBC drivers:
org.apache.derby.jdbc.AutoloadedDriver 10.13
org.h2.Driver 1.4
org.hsqldb.jdbc.JDBCDriver 2.4
com.microsoft.sqlserver.jdbc.SQLServerDriver 6.2
com.mysql.cj.jdbc.Driver 6.0
org.postgresql.Driver 42.1
schemacrawler.tools.offline.jdbc.OfflineDriver 0.0
org.sqlite.JDBC 3.7
Sep 12, 2017 10:12:48 PM schemacrawler.tools.commandline.SchemaCrawlerCommandLine <init>
INFORMATION: Using database plugin <>
Sep 12, 2017 10:12:48 PM sf.util.PropertiesUtility loadProperties
KONFIGURATION: Cannot load properties from resource <null>
Sep 12, 2017 10:12:48 PM sf.util.PropertiesUtility loadProperties
KONFIGURATION: Cannot load properties from file </Users/lutz/Documents/schemacrawler/_schemacrawler/schemacrawler.config.properties>
Sep 12, 2017 10:12:48 PM schemacrawler.tools.commandline.SchemaCrawlerOptionsParser getOptions
WARNUNG: Please provide a -schemas option for efficient retrieval of database metadata
SchemaCrawler 14.16.03
Error: Please provde a database connection URL
Re-run SchemaCrawler with just the
-?
option for help
Or, re-run SchemaCrawler with an additional
-loglevel=CONFIG
option for details on the error
Sep 12, 2017 10:12:48 PM us.fatehi.commandlineparser.CommandLineUtility logSafeArguments
INFORMATION: SchemaCrawler, v14.16.03
Sep 12, 2017 10:12:48 PM us.fatehi.commandlineparser.CommandLineUtility logSafeArguments
INFORMATION: Command line:
server=sqlite
-database=/absolute/path/to/db/developer.sqlite3
-outputformat=png
-outputfile=/Users/myuser/ER.png
-command=graph
-infolevel=maximum
-user=
-password=*****
-loglevel=CONFIG
Sep 12, 2017 10:12:48 PM us.fatehi.commandlineparser.CommandLineUtility logFullStackTrace
SCHWERWIEGEND: Please provde a database connection URL
schemacrawler.schemacrawler.SchemaCrawlerCommandLineException: Please provde a database connection URL
at schemacrawler.tools.commandline.CommandLineConnectionOptionsParser.loadConfig(CommandLineConnectionOptionsParser.java:65)
at schemacrawler.tools.commandline.SchemaCrawlerCommandLine.parseConnectionOptions(SchemaCrawlerCommandLine.java:204)
at schemacrawler.tools.commandline.SchemaCrawlerCommandLine.<init>(SchemaCrawlerCommandLine.java:98)
at schemacrawler.Main.main(Main.java:88)
My shell is a "oh-my-zsh". Thanks.
The error message is misleading. You are missing a dash before "
server
" and you need to use command "schema
". Use the following command, all on one line. Modify the paths as needed, of course../schemacrawler.sh -server=sqlite -database=/absolute/path/to/db/developer.sqlite3 -outputformat=png -outputfile=/path/to/ER.png -command=schema -infolevel=maximum -user= -password=
Sualeh Fatehi, SchemaCrawler