[Dbix-class] [PATCH] Schema::Loader add components per-class

Tom Lanyon tom at netspot.com.au
Tue Jul 7 01:58:41 GMT 2009


On 07/07/2009, at 9:55 AM, Kieren Diment wrote:
> Here's a script from the new Catalyst book that seems to achieve  
> what you wanted, at least to some degree.  In this case you  
> regenerate the classes  for particular tables to which you want to  
> add specific components, so for lots of tables and lots of specific  
> components this approach is repetitive.  I don't know how close this  
> is to doing what your patch achieves, but I do note that to be  
> accepted into DBIC, your patch would need to include suitable tests.


Thanks - your script does pretty much the same thing, but the patch to  
Schema::Loader is designed so that you can simply have a pre-defined  
hash of tables and associated components in your loader scripts, in  
hope to avoid the repetitive re-generation if you have many tables  
with extra required components.

I imagine a test could just involve adding another TestComponent-style  
library and then adding it to only one table in the  
dbixcsl_common_tests and testing whether a component-provided method  
is available on that table and not the others - but I'd need guidance  
on the best place to insert this from someone more familiar with the  
Schema::Loader test packages...

Tom



More information about the DBIx-Class mailing list