[Catalyst] Hops-0.05 and two questions

James Tolley james at bitperfect.com
Tue Jul 5 14:32:19 CEST 2005


> 1. By default, Class::DBI::Loader::Generic tries to create classes for
> all tables. I have over a hundred tables serving about 10 applications,
> and I don't want to auto-discover all of the tables. So, I'd like to use
> my own loader that specifies which tables to load.

You can tell Loader which tables to load with the constraint and exclude
(undocumented in 0.22) args.

> However, it's not so easy, because Class::DBI::Loader::Generic
> autodiscovers the loader class that's appropriate for the database type.
> I'd like to override the loader name at this point, but I'm not sure how.

You can "use" the standard loader class, and then load a custom module which
redefines whatever routines you want to override in the original. It may be
bad manners, but c'est la vie; it works. I don't like how CDBI::Loader
discovers relationships, so I redefined &_relationships in
CDBI::Loader::mysql::Grok (on CPAN). Ideally, I'd like to patch the
original, but in the meantime, there's nothing wrong with the results.

Best,

James





More information about the Catalyst mailing list