This module helps abstract the process of working with complex schemas of relational SQL database tables. As with DBI, it lets you work with data a row at a time, but gives you the extra ability to, with a single method call, reach across and grab rows of related data from tables located elsewhere in your database, without having to construct an SQL join clause youself. The 'distance' from the originating table to the related one can be arbitrarily long, so long as they are related in some way -- i.e., could both return data through a single (though perhaps quite lengthy) SQL query.
You can grab my local copy of the latest distribution, or get it from CPAN.
You can check out the thing's embedded documentation, which has plenty of examples.
DBIx::Schema has two mailing lists.
schema-announce is a one-way list for announcing updates to, and other important information regarding, this Perl module.
schema-discuss is a two-way list for all general discussion of this module.
Both lists, at this time, enjoy very low traffic, and will likely continue doing do foreseeably.
To subscribe to either, send mail to firstname.lastname@example.org, with a subject line of 'subscribe list-name', where list-name is one of the two list names above.
New in version 0.07 (the latest, as of July 15, 2000):
The module used to choke on databases containing circular relationship paths; i.e., allowing two or more different ways to relate tables A and B. It now picks the shortest available path (or picks one of the shortest and generates a warning if there is a tie). These additional checks make its schema-crawling a tad slower, adding about a thousandth of a second of CPU time to a simple statement handle construction, according to the Benchmark module on my P-266, and more time if it has lots of circular paths to walk to choose from (at which point I question your database design philosophy anyway ;-) ), but I consider this a reasonable cost for fixing this yucky bug.
New in version 0.06:
The interface was pathological in some places, and so has been simplified. The statement handle constructor now takes a 'table' key, rather than 'fields', which was rather misleading.
The previous version of this module leaked memory like nobody's business when used in a sustained environment (such as with mod_perl), due to a big ol' circular reference. This has been quashed.
The documentation was similarly schizophrenic here and there, and has also seen corrections and clarifications.
The test scripts actually work now, on at least one machine.
Andy Turner (of DBIx::Abstract fame) got his fingers into it, writing the Datadict module, which speeds up DBIx::Schema quite a bit. It is included with this distribution.
All content on this page is copyright © 2000 by Jason McIntosh.
Return to jmac.org