Tool of the week – SchemaCrawler
We have began a new section in our blog called “tool of the week”. In this section, we will post a new tool or application that are mainly beneficial for DBAs, System Administrators and Programmers. In this week’s posting, we are naming SchemaCrawler as the tool of the week. What is SchemaCrawler and do?
- SchemaCrawler is an open-source Java API that makes working with database metadata as easy as working with plain old Java objects.
- SchemaCrawler is also a command-line tool to output your database schema and data in a readable form. The output is designed to be different with previous versions of your database schema.
SchemaCrawler is free and open-source API available under the LGPL license. SchemaCrawler is written in Java, making it operating system agnostic. Since it leverages JDBC, it is also database independent. It deliberately doesn’t have any RDBMS-specific code. SchemaCrawler allows you to compare structures between two different database servers, or even two different database systems, from different vendors.
SchemaCrawler comes with a set of command line tools that allow database metadata to be output as plain text , XHTML, or comma-separated text (CSV). The XHTML output is a combination of valid XML (that can be manipulated by XML tools or XSLT), and HTML that can be viewed in a browser. All formats are designed to be easy to diff , or find differences with other schemas that may have been output in the same format.
SchemaCrawler has grep functionality that allows you to search for table and column names using regular expressions. SchemaCrawler is capable of creating entity-relationship diagrams in DOT format, which GraphViz can convert into schema diagrams. SchemaCrawler has powerful scripting ability, using JavaScript. A live connection is provided to the JavaScript context to allow you to select from or even modify your database. Examples are provided for all of these with the download .
SchemaCrawler is integrated with, and allows you to write templates to generate SQL scripts or any other text output, using templating engines, such as Apache Velocity or <FreeMarker> . However, you will need to download Apache Velocity or <FreeMarker> separately, since these are not part of the SchemaCrawler download.
With all the above features, what better tool can you ask for?