diff --git a/src/dbtypes.html b/dist/dbtypes.html similarity index 93% rename from src/dbtypes.html rename to dist/dbtypes.html index 5ae57a9..4eabc86 100644 --- a/src/dbtypes.html +++ b/dist/dbtypes.html @@ -95,7 +95,7 @@

Custom SQL

Name Req'd Column(s) - Description + Returns Scope of query @@ -127,14 +127,18 @@

Custom SQL

selectCheckConstraintsSql constraint_name, table_name, text - Check constraint details of all check contraints, where 'text' is usually - the SQL used to create the constraint. + Check constraint details of all check constraints, where 'text' is usually + the SQL used to create the constraint. + These details will be displayed on the table detail pages. + Database selectViewSql text - Details of a specific view, usually the SQL used to create the view. + Details of a specific view, usually the SQL used to create the view. + These details will be displayed on the view detail pages. + Single view diff --git a/dist/index.php b/dist/index.php index 1fa5084..f9bd156 100644 --- a/dist/index.php +++ b/dist/index.php @@ -79,369 +79,379 @@ Do you hate starting on a new project and having to try to figure out someone else's idea of a database? -Or are you in QA and the -developers expect you to understand all the relationships in their -schema? +Or are you in QA and the developers expect you to understand all the +relationships in their schema? If so then this tool's for you.
-
SchemaSpy is a Java-based tool (requires Java 5 or higher) that analyzes the -metadata of a schema in a database and generates a visual representation of it in a -browser-displayable format. -It lets you click through the -hierarchy of database tables via child and parent table relationships. +
+SchemaSpy is a Java-based tool (requires Java 5 or higher) +that analyzes the metadata of a schema in a database and generates a +visual representation of it in a browser-displayable format. +It lets you click through the hierarchy of database tables via child and parent table +relationships. The browsing through relationships can occur though HTML links and/or though the graphical representation of the relationships. -It's also designed -to help resolve the obtuse errors that a database sometimes gives related -to failures due to constraints.
-

-It is free software that is distributed under the terms of the +It's also designed to help resolve the obtuse errors that a database sometimes gives +related to failures due to constraints.
+

It is free software that is distributed under the terms of the Lesser GNU Public License 2.1. Your donations are, however, greatly appreciated.
-

-If you like SchemaSpy then please vote for it on freshmeat, - digg it, - and tag it on del.icio.us. -

-SchemaSpy uses the dot +

+

If you like SchemaSpy then please +vote for it on freshmeat, + +digg it, +and +tag it on del.icio.us. +

+

SchemaSpy uses the dot executable from Graphviz to generate graphical representations of the table/view relationships. This was initially added for people who see things visually. -Now the graphical representation of relationships is a fundamental feature of the tool. -Graphvis is not required to view the output generated by SchemaSpy, but the dot program should be in your PATH +Now the graphical representation of relationships is a fundamental +feature of the tool. +Graphvis is not required to view the output generated by SchemaSpy, but +the dot program should be in your PATH (not CLASSPATH) when running SchemaSpy or none of the graphs will be generated. -

-SchemaSpy uses JDBC's database metadata extraction services to gather -the majority of its information, -but has to make vendor-specific SQL queries to gather some information -such as the SQL associated with a view and the details of check -constraints. -The differences between vendors have been isolated to configuration files and are extremely limited. -Almost all of the vendor-specific SQL is optional.
+

+

SchemaSpy uses JDBC's database metadata extraction services to gather +the majority of its information, but has to make vendor-specific SQL queries +to gather some information such as the SQL associated with a view and the +details of check constraints. +The differences between vendors have been isolated to configuration +files and are extremely limited. Almost all of the vendor-specific SQL +is optional.

Sample output of the tool is available at here. -Note that this was run against an extremely limited schema so it doesn't show the full power of the tool.
-


-

Running SchemaSpy

-

You run SchemaSpy from the command line:

- - - - - - - -
    java -jar schemaSpy.jar -t dbType -db dbName [-s schema] -u user [-p password] -o outputDir [-nohtml][-noimplied] -
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 ParameterDescription
 -t databaseTypeType of database (e.g. ora, db2, etc.). - Use -dbhelp for a list of built-in types. - Defaults to ora. -
*-db dbNameName of database to connect to
*-u userValid database user id with read access
 -s schemaDatabase schema - (optional if the same as user or isn't supported by your database)
 -p passwordPassword associated with that user. - Defaults to no password.
*-o outputDirectoryDirectory to write the generated HTML/graphs to
 -dp pathToDriversLooks for drivers here before looking in driverPath in [databaseType].properties
 -desc "Schema description"Displays the specified textual description on summary pages. - If your description includes an equals sign then escape it with a backslash.
- For example:
- -desc "<a href\='http://schemaspy.sourceforge.net'>SchemaSpy</a>". -
 -allEvaluate all schemas in a database. - Generates a high-level index of the schemas evaluated and allows for - traversal of cross-schema foreign key relationships.
- Use with -schemaSpec "schemaRegularExpression" - to narrow-down the schemas to include. -
 -schemas "schema1,schema2"Evaluate specified schemas. - Similar to -all, but explicitly specifies which - schema to evaluate without interrogating the database's metadata. - Can be used with databases like MySQL where a database isn't - composed of multiple schemas. -
 -meta metafile - metafile is either the name of an individual - XML file or the directory that contains meta files. - If a directory is specified then it is expected to contain files - matching the pattern [schema].meta.xml.
- For databases that don't have schema substitute database for schema.
- See Providing Additional Metadata for details. -
 -lqGenerate lower-quality diagrams. - Note that the default is intended to be "higher quality", but - various installations of - Graphviz - may have have different abilities. - That is, some might not have the "lower quality" libraries and others - might not have the "higher quality" libraries.
- Higher quality output takes longer to generate and results in significantly - larger image files (which take longer to download / display), - but the resultant Entity Relationship diagrams generally look better. -
 -i "tableNamesRegex"Only include matching tables/views. - This is a regular expression that's used to determine which - tables/views to include.
For example: -i "(.*book.*)|(library.*)" - includes only those tables/views with 'book' in their names or that start with 'library'.
- You might want to use -desc with this option to describe the subset of tables. -
 -x "columnNamesRegex"Exclude matching columns from relationship analysis to - simplify the generated graphs. - This is a regular expression that's used to determine which - columns to exclude. It must match table name, followed by a dot, followed by - column name.
For example: -x "(book.isbn)|(borrower.address)"
- Note that each column name regular expression must be surround by ()'s and - separated from other column names by a |. -
Excluded relationships will still show up on detail pages. -
 -X "columnNamesRegex" - Same as -x but excluded relationships will not show up on detail pages. -
 -ahicAllow HTML In Comments.
- Any HTML embedded in comments normally gets encoded so that it's rendered as text. - This option allows it to be rendered as HTML.
 -norowsDon't query or display row counts.
 -noimpliedDon't include implied foreign key relationships in the generated table details
 -nohtmlOnly generate files needed for insertion/deletion of data (e.g. for scripts)
- * denotes required parameter. -
-

Here are the currently supported database types. - Use java -jar schemaSpy.jar -dbhelp for a complete list of the supported - database types and the parameters that each one requires.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeDescription
db2IBM DB2 with 'app' Driver
db2netIBM DB2 with 'net' Driver
derbyDerby (JavaDB) Embedded Server
derbynetDerby (JavaDB) Network Server
firebirdFirebird
hsqldbHSQLDB Server
informixInformix
maxdbMaxDB
mssqlMicrosoft SQL Server 2000
mssql05Microsoft SQL Server 2005
mssql-jtdsMicrosoft SQL Server with jTDS Driver
mysqlMySQL
oraOracle with OCI8 Driver
orathinOracle with Thin Driver
pgsqlPostgreSQL
sybaseSybase Server with JDBC3 Driver
sybase2Sybase Server with JDBC2 Driver
udbt4DB2 UDB Type 4 Driver
-
-

A MySQL example:

- - - - - - -
  - java -jar schemaSpy.jar -t mysql -o library -host localhost -db library -u user -p password -
-

will create a series of files in the library - directory that give the details of the schema in the database library. - This is what I used to generate the sample output. -

An MS SQL Server example:

- - - - - - -
  - java -jar schemaSpy.jar -t mssql -db library -host localhost -port 1433 -u user -p password -o library -
-

does the same thing as the MySQL example, but specifies an mssql - database type with MS SQL Server-specific database connection parameters. - -


-

Providing Additional Metadata

- Metafiles are XML-based files that provide additional metadata - about the schema being evaluated. - See the -meta parameter. - Here are some of the things that you can define in this XML: - - The XML schema that defines the structure of these files is available - here. - There are also some - sample XML files - (a work in progress) that were used to generate - these pages. - Note that this group of MySQL databases had almost no foreign key - relationships defined. -



- Some information about the developer, John Currier, is available here. -
Feedback on problems and/or enhancements is appreciated. - - - - - - +Note that this was run against an extremely limited schema so it doesn't show the +full power of the tool.
+

+

Running SchemaSpy

+

You run SchemaSpy from the command line:

+ + + + + + + +
    java -jar schemaSpy.jar -t dbType -db dbName [-s schema] -u user [-p password] -o outputDir [-nohtml][-noimplied] +
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 ParameterDescription
 -t databaseTypeType of database (e.g. ora, db2, etc.). + Use -dbhelp for a list of built-in types. + Defaults to ora. +
*-db dbNameName of database to connect to
*-u userValid database user id with read access
 -s schemaDatabase schema + (optional if the same as user or isn't supported by your database)
 -p passwordPassword associated with that user. + Defaults to no password.
*-o outputDirectoryDirectory to write the generated HTML/graphs to
 -dp pathToDriversLooks for drivers here before looking in driverPath in [databaseType].properties. + The drivers are usually contained in .jar or .zip files and are typically + provided by your database vendor.
 -desc "Schema description"Displays the specified textual description on summary pages. + If your description includes an equals sign then escape it with a backslash.
+ For example:
+ -desc "<a href\='http://schemaspy.sourceforge.net'>SchemaSpy</a>". +
 -allEvaluate all schemas in a database. + Generates a high-level index of the schemas evaluated and allows for + traversal of cross-schema foreign key relationships.
+ Use with -schemaSpec "schemaRegularExpression" + to narrow-down the schemas to include. +
 -schemas "schema1,schema2"Evaluate specified schemas. + Similar to -all, but explicitly specifies which + schema to evaluate without interrogating the database's metadata. + Can be used with databases like MySQL where a database isn't + composed of multiple schemas. +
 -meta metafile + metafile is either the name of an individual + XML file or the directory that contains meta files. + If a directory is specified then it is expected to contain files + matching the pattern [schema].meta.xml.
+ For databases that don't have schema substitute database for schema.
+ See Providing Additional Metadata for details. +
 -lqGenerate lower-quality diagrams. + Note that the default is intended to be "higher quality", but + various installations of + Graphviz + may have have different abilities. + That is, some might not have the "lower quality" libraries and others + might not have the "higher quality" libraries.
+ Higher quality output takes longer to generate and results in significantly + larger image files (which take longer to download / display), + but the resultant Entity Relationship diagrams generally look better. +
 -i "tableNamesRegex"Only include matching tables/views. + This is a regular expression that's used to determine which + tables/views to include.
For example: -i "(.*book.*)|(library.*)" + includes only those tables/views with 'book' in their names or that start with 'library'.
+ You might want to use -desc with this option to describe the subset of tables. +
 -x "columnNamesRegex"Exclude matching columns from relationship analysis to + simplify the generated graphs. + This is a regular expression that's used to determine which + columns to exclude. It must match table name, followed by a dot, followed by + column name.
For example: -x "(book.isbn)|(borrower.address)"
+ Note that each column name regular expression must be surround by ()'s and + separated from other column names by a |. +
Excluded relationships will still show up on detail pages. +
 -X "columnNamesRegex" + Same as -x but excluded relationships will not show up on detail pages. +
 -ahicAllow HTML In Comments.
+ Any HTML embedded in comments normally gets encoded so that it's rendered as text. + This option allows it to be rendered as HTML.
 -norowsDon't query or display row counts.
 -noimpliedDon't include implied foreign key relationships in the generated table details
 -nohtmlOnly generate files needed for insertion/deletion of data (e.g. for scripts)
+ * denotes required parameter. +
+

Here are the currently supported database types. + Use java -jar schemaSpy.jar -dbhelp for a complete list of the built-in + database types and the parameters that each one requires.
+ See the database types documentation + if you want to add support for other types of databases or add additional + functionality (e.g. to display view and check constraint SQL) + to supported databases. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
db2IBM DB2 with 'app' Driver
db2netIBM DB2 with 'net' Driver
derbyDerby (JavaDB) Embedded Server
derbynetDerby (JavaDB) Network Server
firebirdFirebird
hsqldbHSQLDB Server
informixInformix
maxdbMaxDB
mssqlMicrosoft SQL Server 2000
mssql05Microsoft SQL Server 2005
mssql-jtdsMicrosoft SQL Server with jTDS Driver
mysqlMySQL
oraOracle with OCI8 Driver
orathinOracle with Thin Driver
pgsqlPostgreSQL
sybaseSybase Server with JDBC3 Driver
sybase2Sybase Server with JDBC2 Driver
udbt4DB2 UDB Type 4 Driver
+
+

A MySQL example:

+ + + + + + +
  + java -jar schemaSpy.jar -t mysql -o library -host localhost -db library -u user -p password +
+

will create a series of files in the library + directory that give the details of the schema in the database library. + This is what I used to generate the sample output. +

An MS SQL Server example:

+ + + + + + +
  + java -jar schemaSpy.jar -t mssql -db library -host localhost -port 1433 -u user -p password -o library +
+

does the same thing as the MySQL example, but specifies an mssql + database type with MS SQL Server-specific database connection parameters. + +


+

Providing Additional Metadata

+ Metafiles are XML-based files that provide additional metadata + about the schema being evaluated. + See the -meta parameter. + Here are some of the things that you can define in this XML: + + The XML schema that defines the structure of these files is available + here. + There are also some + sample XML files + (a work in progress) that were used to generate + these pages. + Note that this group of MySQL databases had almost no foreign key + relationships defined. +



+ Some information about the developer, John Currier, is available here. +
Feedback on problems and/or enhancements is appreciated. + + + + + +