[CDBI] Write out CDBI modules from Loader and Loader::Relationship

Matt S Trout dbix-class at trout.me.uk
Fri Jan 27 13:42:43 GMT 2006

On Thu, Jan 26, 2006 at 07:17:39PM -0800, Randal L. Schwartz wrote:
> >>>>> "John" == John Li <johnli at accessmedia.tv> writes:
> John> Is there a CPAN module to generate CDBI table definitions automatically
> John> such as results from Class::DBI::Loader and
> John> Class::DBI::Loader::Relationship? If not, I don't mind to write another
> John> one which uses those 2 modules when I have time.
> John> I'd like to examine the results and add things like triggers. I may also
> John> like to run CDBI from non mod_perl environment.
> John> Tim Bunce had a 'define_columns' method which makes it easier to define
> John> all table columns but I don't think he submitted it. Even with that,
> John> it's too time consuming to define hundreds of tables.
> I have code that runs Class::DBI::Loader's moral equivalent
> (the code I wrote for a magazine column) and then walks the table
> definitions to dump out all the has_a and has_many as Perl code.
> Is that what you're looking for?

Won't passing debug => 1 to Loader cause it to dump out the column and
relationship definitions anyway?

There's also a Class::DBI producer for SQL::Translator (though it doesn't
preserve nearly as much metadata as the one included in the latest DBIx::Class
dev releases)

     Matt S Trout       Offering custom development, consultancy and support
  Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +

More information about the ClassDBI mailing list