<br><font size=2 face="sans-serif">[ I tried to make the attributions clear
via some liberal editing...laj] </font>
<br>
<br><font size=2 face="sans-serif">&gt; &gt; &gt; &gt; Jon Warbrick started
it all by asking: </font>
<br><font size=2 face="sans-serif">&gt; &gt; &gt; &gt; [ how do I configure
DBIC::Schema models via YAML? ] </font>
<br>
<br><font size=2 face="sans-serif">&gt; &gt; &gt; Brian Cassidy replied:
</font>
<br><font size=2 face="sans-serif">&gt; &gt; &gt; [ yaml example edited
- for brevity ]</font>
<br>
<br><font size=2 face="sans-serif">&gt; &gt; Len Jaffe then asked: </font>
<br><font size=2 face="sans-serif">&gt; &gt; How do I make sure that my
SchemaLoader can see the config when it tries to execute </font>
<br><font size=2 face="sans-serif">&gt; &gt; __PACKAGE__-&gt;connection?
</font>
<br><font size=2 face="sans-serif">&nbsp; </font>
<br><font size=2 face="sans-serif">&gt; To which &quot;Brandon Black&quot;
&nbsp;Replied:</font>
<br><font size=2 face="sans-serif">&gt; As with all things Perl, TIMTOWTDI.
&nbsp;While you *can* specify the connection in the Schema, </font>
<br><font size=2 face="sans-serif">&gt; its generally not a great idea.</font>
<br><font size=2 face="sans-serif">&gt; </font>
<br><font size=2 face="sans-serif">&gt; Best practice would be that myapp::SchemaLoader::foo
should just contain the &quot;loader_options&quot; </font>
<br><font size=2 face="sans-serif">&gt; method, and really nothing else
(no connect/connection call). &nbsp;Then when the Model makes the </font>
<br><font size=2 face="sans-serif">&gt; connection using your connect_info
configuration, that's when the actual dynamic loading will </font>
<br><font size=2 face="sans-serif">&gt; happen. </font>
<br>
<br><font size=2 face="sans-serif">I dug back into the source code and
discovered this shortly after sending my question. </font>
<br><font size=2 face="sans-serif">What I then discovered is threaded DBI
problems, which I believe can be alleviated by </font>
<br><font size=2 face="sans-serif">installing DBI from CPAN rather than
PPM. Which puts a few more yaks into my shave queue</font>
<br><font size=2 face="sans-serif">as I need to reset my development install
of perl before I'll upgrade anything on my prod box.</font>
<br>
<br><font size=2 face="sans-serif">That being said - at least I now know
how to get that info up into the YAML file.</font>
<br>
<br>
<br><font size=2 face="sans-serif">&gt; Even better practice would be to
use the helper in create=static mode instead of create=dynamic, </font>
<br><font size=2 face="sans-serif">&gt; so that you're not re-scanning
the table definitions at every server start. &nbsp;If you insist on </font>
<br><font size=2 face="sans-serif">&gt; maintaining your database the old-fashioned
way (or have no control over it), you can regenerate </font>
<br><font size=2 face="sans-serif">&gt; via create=static each time there's
a change in the DDL, and diff versus the previous version to </font>
<br><font size=2 face="sans-serif">&gt; see the changes, etc. </font>
<br>
<br><font size=2 face="sans-serif">Hmm. Interesting. &nbsp;I'll try this
on my dev system. After I reset it.</font>
<br><font size=2 face="sans-serif">$yaks-&gt;push('create=static');</font>
<br>
<br>
<br><font size=2 face="sans-serif">&gt; The next step beyond that is to
start maintaining your database tables using the generated </font>
<br><font size=2 face="sans-serif">&gt; DBIC schema and the SQLT/-&gt;deploy
support. &nbsp;Then you won't need Loader at all.</font>
<br>
<br><font size=2 face="sans-serif">$future_yaks-&gt;push(SQLT/deploy);</font>
<br>
<br><font size=2 face="sans-serif">&nbsp;</font>
<br><font size=2 face="sans-serif">&gt; Another good practice is to move
the Schema definitions outside of the myapp:: Catalyst-app </font>
<br><font size=2 face="sans-serif">&gt; namespace, so that you can deploy
the Schema independently for other tools that might need </font>
<br><font size=2 face="sans-serif">&gt; access to your database. </font>
<br>
<br><font size=2 face="sans-serif">Then what? </font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; package myapp::Schema::foo;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; use base qq/some::other::namespace::Schema::foo/;</font>
<br>
<br><font size=2 face="sans-serif">Flashing back to CDBI...seems reasonable...might
do this if i end up porting from mysql to db2.</font>
<br>
<br>
<br><font size=2 face="sans-serif">Thanks for all of the advice.</font>
<br>
<br><font size=2 face="sans-serif">Len.</font>
<br><font size=2 face="sans-serif">$c-&gt;model('len::yaks')-&gt;find('shears');</font>

<HTML><BODY><P><hr size=1></P><br>
<P><br>
This transmission may contain information that is privileged,<br>
confidential, legally privileged, and/or exempt from disclosure<br>
under applicable law.  If you are not the intended recipient, you<br>
are hereby notified that any disclosure, copying, distribution, or<br>
use of the information contained herein (including any reliance<br>
thereon) is STRICTLY PROHIBITED.  Although this transmission and<br>
any attachments are believed to be free of any virus or other<br>
defect that might affect any computer system into which it is<br>
received and opened, it is the responsibility of the recipient to<br>
ensure that it is virus free and no responsibility is accepted by<br>
JPMorgan Chase & Co., its subsidiaries and affiliates, as<br>
applicable, for any loss or damage arising in any way from its use.<br>
If you received this transmission in error, please immediately<br>
contact the sender and destroy the material in its entirety,<br>
whether in electronic or hard copy format. Thank you.<br>
</P></BODY></HTML>