From 8a1b8173384b79e276b6c36ff125b02d8ab1dad7 Mon Sep 17 00:00:00 2001 From: johncurrier Date: Thu, 7 Aug 2008 22:28:52 +0000 Subject: [PATCH] Mostly complete docs on .properties files --- src/dbtypes.html | 107 +++++++++++++++++++++++++---------------------- 1 file changed, 57 insertions(+), 50 deletions(-) diff --git a/src/dbtypes.html b/src/dbtypes.html index e09a4c0..4227970 100644 --- a/src/dbtypes.html +++ b/src/dbtypes.html @@ -17,7 +17,7 @@

SchemaSpy Database Types

One goal of SchemaSpy is to support a wide range of JDBC-complaint databases. It uses the concept of "database types", as specified by .properties files, to achieve that goal. -"Out of the box" SchemaSpy supports a multitude of databases. +Out of the box SchemaSpy supports a multitude of databases. If your database isn't currently supported or needs to be customized then continue reading.

For SchemaSpy to support your database it must: @@ -28,7 +28,7 @@

SchemaSpy Database Types

The vast majority of relational databases have JDBC drivers that provide appropriate metadata. -

Database Type .property Files

+

Database Type .properties Files

The -t command-line parameter specified which type of database you're dealing with. For example: -t mysql says to use the MySQL-specific database type file named mysql.properties. @@ -69,8 +69,8 @@

Basic entries

host and db
- These entries provide documentation for the names surrounded by < and > - in connectionSpec. + These will vary for each type of database and provide documentation for the + names surrounded by < and > in connectionSpec. For example, if you forget to specify -host on the command line then you will get an error message that includes the text:

hostname[:port] host where database resides with optional port @@ -78,29 +78,17 @@

Basic entries

database-specific parameters.
-

Remaining entries

+

Custom SQL

The remaining entries in the .properties file are not required for most databases. They're typically used to provide functionality that either isn't provided by the JDBC metadata services or when those services are in some way inappropriate (performance, incorrect results, etc.). -

For the SQL-based entries you can use any of the following optional -"named parameters" in the SQL. +

For these SQL-based entries you can use optional "named parameters" in the SQL. +These named parameters are +:schema, :owner, :table and :view. They will be substituted with appropriate values at runtime. -

- -
dbThreads
-
- If your driver returns failures like "stream already closed" then its metadata - services probably aren't thread safe and you'll have to specify a value of 1 or - or specify "-dbThreads 1" on the command line. -
- +

@@ -109,22 +97,48 @@

Remaining entries

- - - - + + + + + + + + + + + + + + + + + + + + - + + + + + + - @@ -132,35 +146,28 @@

Remaining entries

- - - - - - - - - - - - -
Name Scope of query
selectViewSqltextReturns the details of a specific view, usually the SQL used to create the view.Single viewselectIndexesSqlindex_name, column_name, type, asc_or_desc (docs)Information about indexes in a specific table. + Single table
selectRowCountSqlrow_countNumber of rows in a specific table. + Single table
selectTableCommentsSqltable_name, commentsComments associated with tables. + Useful if the database driver doesn't return this info or if it's persisted elsewhere.Database
selectColumnCommentsSqltable_name, column_name, commentsComments associated with table columns. + Useful if the database driver doesn't return this info or if it's persisted elsewhere.Database
selectCheckConstraintsSql constraint_name, table_name, textReturns check constraint details of all check contraints, where 'text' is usually + Check constraint details of all check contraints, where 'text' is usually the SQL used to create the constraint. Database
selectViewSqltextDetails of a specific view, usually the SQL used to create the view.Single view
selectTableIdsSql table_id, table_nameReturns a unique ID for each table. + Unique ID for each table. This is useful for databases (such as DB2) that may give error messages with just table IDs instead of names. Database
selectIndexIdsSql index_id, index_name, table_nameReturns a unique ID for each table index. + Unique ID for each table index. This is useful for databases (such as DB2) that may give error messages with just index IDs instead of names. Database
selectTableCommentsSqltable_name, commentsReturns comments associated with tables. - Useful if the database driver doesn't return this info or if it's persisted elsewhere.Database
selectColumnCommentsSqltable_name, column_name, commentsReturns comments associated with table columns. - Useful if the database driver doesn't return this info or if it's persisted elsewhere.Database
-selectCheckConstraintsSql -selectColumnCommentsSql -selectIndexIdsSql -selectTableCommentsSql -selectTableIdsSql -selectViewSql -selectRowCountSql -selectIndexesSql +

Reusing Configurations

+For those instances where you have two almost identical configurations you can +use the extends entry, specifying another .properties file to be "extended." +Interaction with DB2 through its "type 4 network driver", for example, is almost identical +to the the DB2 "app driver". +db2net.properties therefore has a line that reads +extends=db2 and only includes those configuration options that +deviate from db2.properties. + +

Single-Threaded Drivers

+There's one remaining database configuration entry named dbThreads. +It is used for database drivers whose metadata queries aren't thread safe. +If your driver returns failures like "stream already closed" then you'll need +to specify either dbThreads=1 in your .properties or "-dbThreads 1" +on the command line. \ No newline at end of file