<br><br><div><span class="gmail_quote">On 8/24/06, <b class="gmail_sendername">Matt S Trout</b> <<a href="mailto:dbix-class@trout.me.uk">dbix-class@trout.me.uk</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Andreas Dembach wrote:<br>> 1) I could not figure out how to get rid of the initial connect_info set<br>> by the ->config() call that Cat::DBIC::Schema seems to need during<br>> startup, which annoys a little since I do not have any configuration
<br>> information during Apache startup.<br><br>Just don't set it, IIRC</blockquote><div><br>I think the current C:M:DBIC::Schema requires that it be set by the time the Model's new() method runs. It doesn't care whether its hardcoded in the schema_class, or set via $random_config_method, but it does care that its set at all. The basic flow of C::M::DBIC::Schema::new()'s schema manipulation stuff is:
<br><br>compose_namespace from schema_class to model class, saving return value in $self->composed_schema<br>$self->schema($self->composed_schema->connect($connect_info));<br><br>I could make it optional and not set up ->schema, but its just one more place where we're catching errors when people do bad things and fail to supply a connect_info when they really should have.
<br><br>In the long-term, once we get DBIx::Class schema-inheritance sufficiently magical, most of C::M::DBIC::Schema's magic can dissappear, and the model can just inherit the schema and do a tiny bit of work to set up the resultset shortcut ACCEPT_CONTEXT/COMPONENT stuff and use ->config. Then these sorts of things will be easier (but by then we'll be close to multiple instances of the same cat app working in mod_perl anyways I suspect).
<br><br>In the meantime, Andreas, you may want to override new() completely, or just write your own model base class that handles this for now (since new() is just about all the code anyways).<br><br></div>-- Brandon<br></div>