2017-09-12 143 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先生。那样做了! –