2017-09-12 57 views
0

我想從我的sqlite3文件,開發中的ruby-on-rails數據庫中得到一個圖。我閱讀文檔,以及如何使這種情況發生在命令行上其他一些網站:schemacrawler和sqlite3 - 請求數據庫連接URL

. ./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 

,但它不斷要求「請provde數據庫連接的URL」。 我在這裏錯過了什麼? 據我所知,該sqlite不需要數據庫連接 - 所有都存儲在該file.sqlite3。我嘗試了-server = offline並提供了一個developer.xml文件。同樣的結果。 這裏是日誌:

. ./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) 

我的殼是一個 「哦,我的-的zsh」。 謝謝。

回答

0

錯誤消息是誤導性的。您在「server」之前缺少短劃線,並且您需要使用命令「schema」。使用以下命令,全部在一行上。當然,根據需要修改路徑。

./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

+0

謝謝Sualeh Fatehi先生。那樣做了! –