About dbmstools
dbmstools is a set of utilities for software developers who work with databases. dbmstools understands database schemas (tables, sequences, views etc.) and DBMSs (Database Management Systems, e.g. Oracle, Postgres). It can:- Generate the same (or similar) schema for many different DBMSs, all from a single XML representation
- Migrate a schema from one DBMS to another, via an XML representation
- Given 2 versions of the schema in XML, generate schema upgrade scripts for one or more DBMS
- Generate HTML documentation (including diagrams) from an XML schema representation
- Export a schema from a DBMS to XML
- Export data from a schema, in many different formats
- Clear all data from a schema (or some tables)
- Drop all objects (tables, views, sequences) from a schema (or some objects)
- Customise data import scripts for different DBMSs.
dbmstools is mainly aimed at developers who work with databases, and particularly those who need to support schemas on more than one DBMS. The base tools are intended to allow all the database information (schema and base data) to be kept in one single place, and to have DBMS-specific scripts (to create and populate the database schema, and upgrade from one version to the next) generated from that data. If you're anything like me you hate duplication in software code, and I wrote dbmstools to remove that duplication.
As well as the tools for manipulating schemas, there's a second group of tools to help with common database-related tasks, in particular those that are needed during system testing (clearing or dropping tables, inserting or exporting test data).
All tools can be run from the command line on most operating systems. There are also wrappers for several of the tools, so that they can be run from within Apache Ant (a Java build system).
The DBMS's supported (and the completeness/maturity of that support) are:
- Postgres (7 and 8) - good
- Oracle - good
- Microsoft SQLServer - good
- MySQL - good
- Hypersonic - limited
- Sqlite - limited.
Sample output from dbmstools
These samples give an idea of what dbmstools can produce. They're from the schema for my jcr project, which is somewhat trivial, but hopefully you'll get the idea.- The XML schema definition from which all these samples are generated
- Schema creation script for Postgres 8
- Schema creation script for MySQL
- Schema drop script for Postgres 8
- Upgrade scripts for Postgres 7. Note that deltaddl splits the upgrade
process across 2 or 3 scripts, so you have the flexibility to tweak just
the bits you want
- Initial upgrade script (creates new objects, renames, drops constraints)
- DML script (performs any DML required, i.e. massaging of data)
- Final upgrade script (adds constraints, drops any objects no longer needed).
- Schema documentation for Postgres 8 (frames-based)
- Schema documentation for Postgres 8 (no frames)
Requirements for running dbmstools
Most of the individual tools in dbmstools require only Python (version 2.2 or later, but 2.3+ recommended). However:- db2xml, db2sql, dbclear and dbdrop require Java, as well as a JDBC driver for your DBMS
- If schema diagrams are to be generated, xml2doc requires the 'dot' program from the Graphviz package
For further information, see the dbmstools installation documentation.
Download
dbmstools is hosted on SourceForge - you'll find the project download page here.Quick start with dbmstools
The quick start page will give you a fast run through most of the tools, so you can see them in action.Installing dbmstools
Mostly, all you have to do is unzip the package. See the installation page for more information.Documentation
See the documentation index here.Licence
dbmstools is released under the GNU Public Licence.Contact Me
My name's John Dickson, and you can reach me at captsens at gmail dot com. I'd love to hear you get on with dbmstools.And remember, if you're wedded to Java, Python makes a very appealing mistress.