schemaspy / schemaspy Goto Github PK
View Code? Open in Web Editor NEWDatabase documentation built easy
Home Page: http://schemaspy.org
License: GNU Lesser General Public License v3.0
Database documentation built easy
Home Page: http://schemaspy.org
License: GNU Lesser General Public License v3.0
-dp takes a string, it can be either a single lib or list of libs separated by File.pathSeparator.
There is an option -loadjars which will load sibling libs, however this only works when -dp is set to a single lib.
I would propose that driver path (-dp) can be used with:
and thus remove the -loadjars option from command-line
A tiny hack would be that -loadjars only operate on the first lib found in -dp
failsafe-plugin that runs integration tests is bound to verify phase.
travis only runs clean package, package is the phase before verify.
See https://help.github.com/articles/setting-guidelines-for-repository-contributors/
There are some really nice examples of guidelines out there.
it will be great if this tool can read sql plsql code and create data lineage graph. something integrated to table page which can show source tables that feeding this table and target tables that reading fromt his table.
data lineage example tools:
https://sqldep.com/
http://www.sqlparser.com/
Open source SQL libraries can be used for this job
https://www.quora.com/What-is-the-best-free-commercial-SQL-parser-written-in-Java
Redshift is compatible to some extent with postgres driver, unfortunately at some point, schemaspy throws the following exception:
Connecting relationships....14:57:15.152 SEVERE: Main.main - Unable to determine a value for MaxIndexKeys due to missing system catalog data.
org.postgresql.util.PSQLException: Unable to determine a value for MaxIndexKeys due to missing system catalog data.
at org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getMaxIndexKeys(AbstractJdbc2DatabaseMetaData.java:64)
at org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getImportedExportedKeys(AbstractJdbc2DatabaseMetaData.java:3196)
at org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getImportedKeys(AbstractJdbc2DatabaseMetaData.java:3526)
at org.schemaspy.service.TableService.connectForeignKeys(TableService.java:207)
at org.schemaspy.service.DatabaseService.connectTables(DatabaseService.java:224)
at org.schemaspy.service.DatabaseService.gatheringSchemaDetails(DatabaseService.java:64)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:234)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:86)
at org.schemaspy.Main.main(Main.java:52)
There is a dedicated JDBC driver for redshift (https://docs.aws.amazon.com/redshift/latest/mgmt/configure-jdbc-connection.html), but it cannot be used in place of postgresql driver, due to different class naming.
I have comments on columns in my Oracle database. SchemaSpy 5.0 has picked them up correctly, but 6.0.0-rc1 does not, they appear blank in the html output. I am running on exactly the same schema and DB, the only change is the jar file used, and the issue is repeatable, i.e. occurs in 100% of the cases.
I am running against Oracle 12c, using the thin driver. My Java version is 1.8.0_131-b11.
Output on V5:
Clicking the Comments buttons shows/hides the column for comments, but the column is still empty.
I use MariaDB (not Oracle MySQL) and can't connect. Password works with mysql
client (in .my.cnf
hardcoded) and has no special characters, only alphanum.
I use RHEL7 VM.
# /usr/java/jre1.8.0_77/bin/java -jar /root/tmp/schemaspy-6.0.0-rc1.jar
Apr 21, 2017 3:56:32 PM org.springframework.context.annotation.AnnotationConfigApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@30dae81: startup date [Fri Apr 21 15:56:32 CEST 2017]; root of context hierarchy
Using database properties:
[/root/tmp/schemaspy-6.0.0-rc1.jar]/org/schemaspy/types/mysql.properties
Failed to connect to database URL [jdbc:mysql://localhost:3306/sbmongodb]
java.sql.SQLException: Invalid authorization specification message from server: "Access denied for user 'root'@'127.0.0.1' (using password: YES)"
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2001)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1907)
at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:2524)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:818)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1808)
at com.mysql.jdbc.Connection.<init>(Connection.java:452)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:411)
at org.schemaspy.DbDriverLoader.getConnection(DbDriverLoader.java:66)
at org.schemaspy.service.SqlService.connect(SqlService.java:65)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:197)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:86)
at org.schemaspy.Main.main(Main.java:52)
15:56:33.543 WARNING: Main.main - Connection Failure
org.schemaspy.model.ConnectionFailure: java.sql.SQLException: Invalid authorization specification message from server: "Access denied for user 'root'@'127.0.0.1' (using password: YES)"
at org.schemaspy.DbDriverLoader.getConnection(DbDriverLoader.java:92)
at org.schemaspy.service.SqlService.connect(SqlService.java:65)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:197)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:86)
at org.schemaspy.Main.main(Main.java:52)
Caused by: java.sql.SQLException: Invalid authorization specification message from server: "Access denied for user 'root'@'127.0.0.1' (using password: YES)"
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2001)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1907)
at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:2524)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:818)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1808)
at com.mysql.jdbc.Connection.<init>(Connection.java:452)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:411)
at org.schemaspy.DbDriverLoader.getConnection(DbDriverLoader.java:66)
... 4 more
# cat schemaspy.properties
# type of database. Run with -dbhelp for details
schemaspy.t=mysql
# optional path to alternative jdbc drivers.
schemaspy.dp=/root/tmp/mysql-connector-java-5.1.41/mysql-connector-java-5.1.41-bin.jar
# database properties: host, port number, name user, password
schemaspy.host=localhost
schemaspy.port=3306
schemaspy.db=mysql
schemaspy.u=root
schemaspy.p=rootroot
# output dir to save generated files
schemaspy.o=/root/tmp/sbmongodb
# db scheme for which generate diagrams
schemaspy.s=sbmongodb
I suspect a problem with Oracle MySQL JDBC and tried MariaDB JDBC connector
/usr/java/jre1.8.0_77/bin/java -jar /root/tmp/schemaspy-6.0.0-rc1.jar
Apr 24, 2017 10:23:26 AM org.springframework.context.annotation.AnnotationConfigApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@30dae81: startup date [Mon Apr 24 10:23:26 CEST 2017]; root of context hierarchy
Using database properties:
[/root/tmp/schemaspy-6.0.0-rc1.jar]/org/schemaspy/types/mysql.properties
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
Failed to load driver 'com.mysql.jdbc.Driver' from: [file:/root/tmp/mariadb-java-client-1.5.9.jar]
This entry doesn't point to a valid file/directory: [/mysql/mysql-connector-java-5.1.6-bin.jar]
Use the -dp option to specify the location of the database
drivers for your database (usually in a .jar or .zip/.Z).
10:23:26.770 WARNING: Main.main - Connection Failure
org.schemaspy.model.ConnectionFailure: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at org.schemaspy.DbDriverLoader.getDriver(DbDriverLoader.java:145)
at org.schemaspy.DbDriverLoader.getConnection(DbDriverLoader.java:54)
at org.schemaspy.service.SqlService.connect(SqlService.java:65)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:197)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:86)
at org.schemaspy.Main.main(Main.java:52)
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.schemaspy.DbDriverLoader.getDriver(DbDriverLoader.java:120)
... 5 more
[(module)='Policy',
(type)='Business Data']
[(module)] = 'Policy'
[(type)] = 'Dictionary'
module: Policy
type: Business Data
doc:
Tested using schemaspy-6.0.0-beta.3.jar
Orphan Tables
Orphans Tables
Great job so far guys, glad somethings being done.
Thanks for taking up work on the original schemaSpy - looks great!
While it says that graphviz 2.26 or >2.31 are supported graphviz versions SchemaSpy does not accept 2.26.0:
0 $ java -jar ./schemaspy-6.0.0-rc1.jar -configFile sqlite.properties -o ndm_html -u $USER -meta ndm.meta.xml
Jun 13, 2017 5:15:38 PM org.springframework.context.annotation.AnnotationConfigApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@7cd84586: startup date [Tue Jun 13 17:15:38 CEST 2017]; root of context hierarchy
17:15:39.599 WARNING: Config.getPort - null
java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:542)
at java.lang.Integer.valueOf(Integer.java:766)
at org.schemaspy.Config.getPort(Config.java:367)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.schemaspy.Config.populate(Config.java:1647)
at org.schemaspy.Config.getRemainingParameters(Config.java:1465)
at org.schemaspy.util.ConnectionURLBuilder.<init>(ConnectionURLBuilder.java:47)
at org.schemaspy.service.SqlService.connect(SqlService.java:46)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:197)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:86)
at org.schemaspy.Main.main(Main.java:52)
17:15:39.646 WARNING: Config.getPort - null
java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:542)
at java.lang.Integer.valueOf(Integer.java:766)
at org.schemaspy.Config.getPort(Config.java:367)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.schemaspy.Config.populate(Config.java:1647)
at org.schemaspy.Config.getRemainingParameters(Config.java:1465)
at org.schemaspy.util.ConnectionURLBuilder.<init>(ConnectionURLBuilder.java:53)
at org.schemaspy.service.SqlService.connect(SqlService.java:46)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:197)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:86)
at org.schemaspy.Main.main(Main.java:52)
17:15:39.647 WARNING: Config.getPort - null
java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:542)
at java.lang.Integer.valueOf(Integer.java:766)
at org.schemaspy.Config.getPort(Config.java:367)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.schemaspy.Config.populate(Config.java:1647)
at org.schemaspy.Config.getRemainingParameters(Config.java:1465)
at org.schemaspy.service.SqlService.connect(SqlService.java:50)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:197)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:86)
at org.schemaspy.Main.main(Main.java:52)
17:15:39.647 WARNING: Config.getPort - null
java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:542)
at java.lang.Integer.valueOf(Integer.java:766)
at org.schemaspy.Config.getPort(Config.java:367)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.schemaspy.Config.populate(Config.java:1647)
at org.schemaspy.Config.getRemainingParameters(Config.java:1465)
at org.schemaspy.service.SqlService.connect(SqlService.java:52)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:197)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:86)
at org.schemaspy.Main.main(Main.java:52)
17:15:39.648 WARNING: SqlService.connect - Unrecognized option(s): -configFile sqlite.properties db /ae/data/tmp/hjoukl/ndm.db connectionSpec jdbc:sqlite:<db> description SQLite driver org.sqlite.JDBC driverPath sqlite-jdbc-3.18.0.jar
Using database properties:
/ae/data/pydev/hjoukl/tmp/ER_from_db/schemaspy/github_fork/sqlite.properties
Gathering schema details.....(0sec)
Connecting relationships.....(0sec)
Writing/graphing summary....
Warning: Invalid version of Graphviz dot detected (2.26.0).
SchemaSpy requires dot graphvizVersion 2.26 or versions greater than 2.31. from www.graphviz.org.
Generated pages will not contain a diagramatic view of table relationships.
......(1sec)
Writing/diagramming details.Table -> Deal
.Table -> DealCost
(0sec)
Wrote relationship details of 2 tables/views to directory 'ndm_html' in 3 seconds.
View the results by opening ndm_html/index.html
0 $ dot -V
dot - graphviz version 2.26.0 (20091210.2329)
0 $
As far as I know there is no such graphviz version "2.26" but only "2.26.0", at least of what I can tell from http://www.graphviz.org/pub/graphviz/ARCHIVE/
I suggest correcting the version string to 2.26.0 as the supported version (
) or maybe adapting the regexp used to find the version from the dot -V command line to only consider the (major, minor) parts of the version.If anyone has this issue and can't upgrade to a modern graphviz easily (e.g. corporate env) here's a hack: I'm currently tricking SchemaSpy into accepting 2.26.0 by using a dumb script:
$ cat bin/dot
#!/bin/bash
MODIFIED_VERSION_OUTPUT="dot - graphviz version 2.26 (20091210.2329)"
if [ "$1" == "-V" ]; then
>&2 echo "$MODIFIED_VERSION_OUTPUT"
else
dot $@
fi
... and run the command with the -gv command line option to point to my (fake) graphviz installation dir:
$ java -jar ./schemaspy-6.0.0-rc1.jar -configFile sqlite.properties -o ndm_html -u $USER -meta ndm.meta.xml -gv /var/tmp/fake_graphviz # fake_graphviz contains bin/dot
All modern browsers will render SVG, and the images will be scalable and zoomable, and have pretty lines and arrows instead of the choppy ones rendered into the PNG images. I would request you consider rendering the images as SVG to take advantage of this. The only issue will be to make reference to the FK/PK images relative to the output directory so it works on a web browser.
(Copied from old sourceforge site)
Hi,
I tried to configure schemaspy to work against Impala, but after getting all the jdbc jars in place I hit a null pointer exception:
java.lang.ArrayIndexOutOfBoundsException: 1
at com.cloudera.hivecommon.core.CoreUtils.parseSubName(Unknown Source)
at com.cloudera.impala.jdbc41.Driver.parseSubName(Unknown Source)
at com.cloudera.jdbc.common.BaseConnectionFactory.acceptsURL(Unknown Source)
at com.cloudera.jdbc.common.AbstractDriver.connect(Unknown Source)
at net.sourceforge.schemaspy.SchemaAnalyzer.getConnection(SchemaAnalyzer.java:582)
at net.sourceforge.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:157)
at net.sourceforge.schemaspy.Main.main(Main.java:42)
Any hints?
Thanks!
Dan
Really great that the work is now continuing on schemaspy!
I just generated the database report and saw that several things are missing:
There is now a pagination mechanism and there is no way to be view everything on one page like in the 5.X. version. Or did I miss something? Certainly a question of taste however the 'everything on one page' really helped us for some overview matters and it would be nice to still have that option...
Additionally the culmulated number of rows and columns are missing (cp. screenshot) Which is quite important to us. The number of colums I can see in the column tab however rows seems to be completely gone. This was originally my request because in the old version I got an overflow in the datatype since MAX_INTEGER range was probably crossed and I got a neg. value...
Orphaned Tables (previously Utility Tables): Would it be possible to add an option to exclude the views and only show real tables? (like it is possible in some of the other tabs)
Anomalies: I miss the "Columns that are flagged as both 'nullable' and 'must be unique'" option. Was it removed for a specifc reasion?
If im using SchemaSpy from a pc without Internet, i would need an option to use only those CSS who are in localhost, not online.
I'm running
» java -jar schemaSpy_5.0.0.jar -t mssql -db <my db> -u <my user> -host <ip address> -o <output dir> -dp sqljdbc42.jar -port <my port>
Using database properties:
[schemaSpy_5.0.0.jar]/net/sourceforge/schemaspy/dbTypes/mssql.properties
java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver
Failed to load driver 'com.microsoft.jdbc.sqlserver.SQLServerDriver'from: [file:/Users/harrymoreno/programming/databases/sqljdbc42.jar]
These entries don't point to valid files/directories: [C, /Program Files/Microsoft SQL Server 2000 Driver for JDBC/lib/msbase.jar;C, /Program Files/Microsoft SQL Server 2000 Driver for JDBC/lib/mssqlserver.jar;C, /Program Files/Microsoft SQL Server 2000 Driver for JDBC/lib/msutil.jar]
Use the -dp option to specify the location of the database
drivers for your database (usually in a .jar or .zip/.Z).
thoughts? I used the driver from https://www.microsoft.com/en-us/download/details.aspx?id=11774 using jre8 on mac
Some have and some expects PORT to be included in
description=MariaDB
connectionSpec=jdbc:mariadb://<host>:<port>/<db>
host=hostname host where database resides with optional port
db=database name
description=MySQL
connectionSpec=jdbc:mysql://<host>/<db>
host=hostname[:port] host where database resides with optional port
db=database name
Thank you for taking up maintenance of the SchemaSpy project. I've been using it for a few years, and it definitely needs some finishing up.
A recent update to graphviz seems to have broken it for me on OSX. I thought I'd try your version to see if it fixes the issue, but it suffers from the same problem. When generating a diagram, we get errors like these:
.net.sourceforge.schemaspy.util.Dot$DotFailure: 'dot -Tpng:gd /Users/stebro/build/scan_priority.1degree.dot -o/Users/stebro/build/scan_priority.1degree.png -Tcmapx' failed with return code 139
Running that command directly from the command line also fails (with a segfault). Talking to the graphviz guys, it turns out there's something not right about the gd rendering library on our machines, but SchemaSpy works correctly with the cairo renderer, so this command succeeds:
dot -Tpng /Users/stebro/build/scan_priority.1degree.dot -o/Users/stebro/build/scan_priority.1degree.png -Tcmapx
(note the absence of :gd on the -T flag). I'm not a java developer, but in scanning through the code (Config.java) it looks like theres an option, "-renderer", that governs the behavior of what goes into the -T option, but I cannot get it to work, e.g., invoking schemaspy with -renderer png", "-renderer cairo" or "-renderer png:cairo" doesn't do anything (but doesn't give me an error for an unknown command line option).
Any ideas?
Hi Rafal,
first of all: Great work! Thanks for keeping up and enhancing this project and putting up so much time and effort in it! 👍 :-)
Peeking into the source I noticed there is a small built in Swing GUI that can be started by using the -gui
command line parameter (see https://github.com/schemaspy/schemaspy/blob/master/src/main/java/org/schemaspy/Main.java#L42).
I'm wondering if this feature is still needed.
There exists an advanced GUI using any Schemaspy JAR: http://schemaspygui.sourceforge.net/
(I tested it briefly with 6.0.0-rc1 - works fine.)
If we remove this built in GUI and delete the classes of the ui package https://github.com/schemaspy/schemaspy/tree/master/src/main/java/org/schemaspy/ui
we could focus more on the core functionality of Schemaspy.
In my opinion this would slim down the project.
Maybe you already have something like that in mind? I see there is a separate project https://github.com/schemaspy/schemaspygui
It looks like schemaspy send db user name in uppercase, even when I set it in lowercase.
my db configfile contains:
schemaspy.u="uzytkownik"
After trying to run there is error:
org.schemaspy.model.ConnectionFailure: org.netezza.error.NzSQLException: LDAP authentication failed for user 'UZYTKOWNIK'
Trying to generate diagram from database which port is different from default 5432, but doesn't matter, the error that I get in console is from port 5432:
Console
$ java -jar schemaspy6.jar -configFile schemaspy.properties
12:19:32.315 WARNING: Main.main - Connection Failure
org.schemaspy.model.ConnectionFailure: org.postgresql.util.PSQLException: Connection to database:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
schemaspy.properties
schemaspy.t=pgsql
schemaspy.dp=/home/schemaspy/postgresql-42.0.0.jar
schemaspy.host=host
schemaspy.port=5444
schemaspy.db=database
schemaspy.u=user
schemaspy.p=root
schemaspy.o=/home/schemaspy/generated
Running org.schemaspy.DbAnalyzerTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.966 sec
Running org.schemaspy.ConfigTest
Mar 09, 2017 6:11:09 AM org.schemaspy.Config loadProperties
WARNING: schemaspy.properties (No such file or directory)
java.io.FileNotFoundException: schemaspy.properties (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.(FileInputStream.java:138)
at org.schemaspy.Config.loadProperties(Config.java:1622)
at org.schemaspy.Config.fixupArgs(Config.java:1595)
at org.schemaspy.Config.(Config.java:141)
at org.schemaspy.ConfigTest.testConfig(ConfigTest.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at junit.framework.TestCase.runTest(TestCase.java:176)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
I propose that we move all wiring into @Configuration
classes. Limit the ComponentScan to only scan a subpackage configuration.
In @Configuration
class one would be free to use @Autowire
.
Reason for this is to expose dependencies as constructor arguments which is easy to mock instead of private fields, classes will also not depend on spring.
with following line template parameter is ignored when running program isJarFile.
/schemaspy/src/main/java/org/schemaspy/view/MustacheWriter.java
private String getTemplatePath(String templatePath) {
String path = "layout/"+templatePath; // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
if (!Config.getInstance().isJarFile()) {
path = new File(templateDirectory,templatePath).getPath();
}
return path;
}
I tried installing graphviz via homebrew and the .pkg distributed at http://www.graphviz.org/Download..php
Jun 06, 2017 5:57:57 PM org.springframework.context.annotation.AnnotationConfigApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@1b2c6ec2: startup date [Tue Jun 06 17:57:57 EDT 2017]; root of context hierarchy
Jun 06, 2017 5:57:57 PM org.schemaspy.Config loadProperties
INFO: Configuration file not found
Using database properties:
[schemaspy-6.0.0-rc1.jar]/org/schemaspy/types/mssql05.properties
Gathering schema details.........................................................................................................................................................................................................(18sec)
Connecting relationships.........................................................................................................................................................................................................(8sec)
Writing/graphing summary.....dot -Tpng:gd outDir/diagrams/summary/relationships.real.compact.dot -outDir/diagrams/summary/relationships.real.compact.png -Tcmapx: Fontconfig error: Cannot load default config file
org.schemaspy.util.Dot$DotFailure: 'dot -Tpng:gd outDir/diagrams/summary/relationships.real.compact.dot -outDir/diagrams/summary/relationships.real.compact.png -Tcmapx' failed with return code 139
.dot -Tpng:gd outDir/diagrams/orphans/AdjustmentType.1degree.dot -outDir/diagrams/orphans/AdjustmentType.1degree.png -Tcmapx: Fontconfig error: Cannot load default config file
org.schemaspy.util.Dot$DotFailure: 'dot -Tpng:gd outDir/diagrams/orphans/AdjustmentType.1degree.dot -outDir/diagrams/orphans/AdjustmentType.1degree.png -Tcmapx' failed with return code 139
.....(5sec)
Is there some "official" or recommended Docker image for SchemaSpy?
Writing or graphing the summary out fails with the error message
Unable to find requested file schemaspy-6.0.0-beta.2.jar!\layout\schemaSpy.css
Having anchors on the different sections on the pages generated for tables so you could make deep links to e.g. #relationships
would be very neat 👍 .... aaand useful too I think.
To not visually clutter up the very nice new page UI the anchors could just reveal themselves when you hovered over a section title, similar to the way it works with titles in Markdown text here on Github.
https://sourceforge.net/p/schemaspy/bugs/191/
Yes, it is still a problem in the new beta.
Using database properties:
[schemaspy-6.0.0-beta.1.jar]/org/schemaspy/types/mysql.properties
Gathering schema details...java.lang.NumberFormatException: For input string: "2827140533"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:583)
at java.lang.Integer.parseInt(Integer.java:615)
at org.schemaspy.service.DatabaseService.getBasicTableMeta(DatabaseService.java:381)
at org.schemaspy.service.DatabaseService.initTables(DatabaseService.java:81)
at org.schemaspy.service.DatabaseService.gatheringSchemaDetails(DatabaseService.java:48)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:175)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:83)
at org.schemaspy.Main.main(Main.java:52)
Connecting relationships..........16:58:37.313 WARNING: TableService.addForeignKey - Couldn't add FK 'FK_OTHER_fk_name' to table 'org.schemaspy.service.TableService@2784145d' - Column 'col' doesn't exist in table 'Table_In_dbo'
com.microsoft.sqlserver.jdbc.SQLServerException: The result set is closed.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:190)
at com.microsoft.sqlserver.jdbc.SQLServerResultSet.checkClosed(SQLServerResultSet.java:372)
at com.microsoft.sqlserver.jdbc.SQLServerResultSet.next(SQLServerResultSet.java:994)
at org.schemaspy.service.TableService.connectForeignKeys(TableService.java:209)
at org.schemaspy.service.DatabaseService.connectTables(DatabaseService.java:224)
at org.schemaspy.service.DatabaseService.gatheringSchemaDetails(DatabaseService.java:64)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:231)
at org.schemaspy.SchemaAnalyzer.analyzeMultipleSchemas(SchemaAnalyzer.java:129)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:82)
at org.schemaspy.Main.main(Main.java:52)
In Postgres, I use table inheritance to implement partitions to keep each individual table small. This grossly complicates the schema with nearly zero added benefit to understanding the relations. I would appreciate an option to have such tables removed from the summary diagrams at least. Right now I manually edit them out and re-draw my images using dot.
For my purposes I could exclude them using a pattern match.
Firstly a big thank you for picking up this tool, its easily one of the most useful and underrated open source tools.
Now for my issue, I have a ssh tunnel going from the database to my laptop, this works great and connections are established client side using tools such as heidiSQL. So I am very confused when SchemaSpy gives me an auth error when trying to connect using the same credentials which I know are working in heidiSQL.
{ schemaspy } » java -jar "C:\tools\schemaspy\schemaspy-6.0.0-beta.3.jar" -dp "C:\tools\schemaspy\drivers\postgres\postgresql-9.2-1004.jdbc41.jar" -t pgsql -db mydb -host 127.0.0.1 -port 1111 -u user -o "C:\tools\schemaspy\output" -p password
Feb 20, 2017 9:19:30 AM org.springframework.context.annotation.AnnotationConfigApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@30dae81: startup date [Mon Feb 20 09:19:30 GMT 2017]; root of context hierarchy
Using database properties:
[C:\tools\schemaspy\schemaspy-6.0.0-beta.3.jar]/org/schemaspy/types/pgsql.properties
Failed to connect to database URL [jdbc:postgresql://127.0.0.1/crm]
org.postgresql.util.PSQLException: FATAL: password authentication failed for user "crm_user"
at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:398)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:173)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:64)
at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:136)
at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:29)
at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:21)
at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:31)
at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:24)
at org.postgresql.Driver.makeConnection(Driver.java:397)
at org.postgresql.Driver.connect(Driver.java:267)
at org.schemaspy.DbDriverLoader.getConnection(DbDriverLoader.java:66)
at org.schemaspy.service.SqlService.connect(SqlService.java:65)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:194)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:86)
at org.schemaspy.Main.main(Main.java:52)
Any help is greatly appreciated, I'm on postgres v9.2.20
class Main
looks for a non-null
return value to determine exit code.
rc = analyzer.analyze(new Config(argv)) == null ? 1 : 0;
However, when using the -all
flag to analyze multiple schemas, null
is always returned regardless of success.
This makes it difficult determine if schema generation was successful within CI.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.