Nearly all enterprise applications are backed by a database in some form. In most cases, the database metadata sufficiently represents the data model of the application. Unfortunately, the methods for extracting this critical information vary across database management systems. Although graphical database applications can produce schema diagrams, these tools generally do not facilitate the development of custom metadata interpretations like datamodel code generation. In addition, more complex information, like indirect and recursive relationships, is often difficult to retrieve through the facilities provided by the DBMS (typically SQL) and these tools.

This talk presents a simpler and more flexible approach to extracting and taking advantage of database metadata through a software interface using the database independent DB::Introspector modules. We will briefly discuss the design philosophy behind DB::Introspector while more closely examining its more complex aspects. Finally, we will highlight the ease of use and utility of these modules by providing simple implementations for the following set of non trivial applications: (1) a complete schema extraction and DDL generation tool that converts between Oracle, MySQL, Postgres, and
Microsoft SQL Server, (2) a simple schema diagram generator, and (3) a tool that can find mapped and unmapped paths between two tables using foreign keys as edges and tables as nodes (using preexisting rendering modules to output graphical representations of these paths).