DBIx::Class::Schema::Loader it is!<br><br>Many thanks<br><br>f<br><br><br><div class="gmail_quote">On Feb 8, 2008 1:43 PM, Matt S Trout &lt;<a href="mailto:dbix-class@trout.me.uk">dbix-class@trout.me.uk</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Fri, Feb 08, 2008 at 09:52:28AM +0000, Frazer Irving wrote:<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; On Feb 8, 2008 7:59 AM, Matt S Trout &lt;<a href="mailto:dbix-class@trout.me.uk">dbix-class@trout.me.uk</a>&gt; wrote:<br>
&gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; What business requirement is leading you to want on-demand loading?<br>&gt; &gt; &gt;<br>&gt; &gt;<br>&gt; Oops sorry about that last reply.<br>&gt;<br>&gt; Basically I work on a poorly structured application, the in-house method of<br>
&gt; determining the columns for a table is to query the INFORMATION_SCHEMA of<br>&gt; the mysql database at runtime, or to embed column names in SQL statements<br>&gt; (eww). I have opted to place the results of INFORMATION_SCHEMA queries in<br>
&gt; __PACKAGE__-&gt;add_columns but this is going to result in a lot of unnecessary<br>&gt; DB calls. I think I will write some additional code to pre-cache the column<br>&gt; names somewhere.<br><br></div>Why don&#39;t you just use DBIx::Class::Schema::Loader ?<br>
<br>That can dump column and rel info to disk, or grab it at startup, and supports<br>only doing so for some tables.<br><div class="Ih2E3d"><br>&gt; In the interim, can you tell me if my approach of placing calls to<br>&gt; DB::Main-&gt;load_classes inside the body of DB::Main::Foo a sane approach? I<br>
&gt; happened upon it through experimentation.<br><br></div>Sane? ... well, I don&#39;t think anything that requires that approach is sane.<br>But once you -do- require something like that, it&#39;s probably not so horrific<br>
a way of making it work :)<br><font color="#888888"><br>--<br></font><div><div></div><div class="Wj3C7c"> &nbsp; &nbsp; &nbsp;Matt S Trout &nbsp; &nbsp; &nbsp; Need help with your Catalyst or DBIx::Class project?<br> &nbsp; Technical Director &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="http://www.shadowcat.co.uk/catalyst/" target="_blank">http://www.shadowcat.co.uk/catalyst/</a><br>
&nbsp;Shadowcat Systems Ltd. &nbsp;Want a managed development or deployment platform?<br><a href="http://chainsawblues.vox.com/" target="_blank">http://chainsawblues.vox.com/</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="http://www.shadowcat.co.uk/servers/" target="_blank">http://www.shadowcat.co.uk/servers/</a><br>
<br>_______________________________________________<br>List: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class</a><br>IRC: irc.perl.org#dbix-class<br>
SVN: <a href="http://dev.catalyst.perl.org/repos/bast/DBIx-Class/" target="_blank">http://dev.catalyst.perl.org/repos/bast/DBIx-Class/</a><br>Searchable Archive: <a href="http://www.grokbase.com/group/dbix-class@lists.rawmode.org" target="_blank">http://www.grokbase.com/group/dbix-class@lists.rawmode.org</a><br>
</div></div></blockquote></div><br>