[Dbix-class] Schema Components

Marco Silva marco.prado.bs at gmail.com
Tue Sep 20 15:32:39 GMT 2016


Excerpts from Dave Cross's message of 2016-09-16 17:08:14 +0100:
> 
> In the documentation of DBIx::Class::Schema::Loader::Base there is a  
> reference to adding "schema components"[1] to the generated classes.  
> But I can't find any documentation on how you might write such a  
> component - or any clearly-labelled examples of a schema component.
> 
> I think I have an example of something that I'd like to write as a  
> schema component. Please either tell me that I'm wrong, or gently  
> nudge me in the right direction.

I don't know if it is the right direction, but you could simple use
inheritance in this case. Creating a subclass of DBIx::Class::Schema
with your 'get_schema' method or simple overriding ->connection to search
for a sensible environment if not given explicit arguments.


-- 
Marco Arthur @ (M)arco Creatives



More information about the DBIx-Class mailing list