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 <<a href="mailto:dbix-class@trout.me.uk">dbix-class@trout.me.uk</a>> 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>> ><br>> ><br>> > On Feb 8, 2008 7:59 AM, Matt S Trout <<a href="mailto:dbix-class@trout.me.uk">dbix-class@trout.me.uk</a>> wrote:<br>
> ><br>> > ><br>> > > What business requirement is leading you to want on-demand loading?<br>> > ><br>> ><br>> Oops sorry about that last reply.<br>><br>> Basically I work on a poorly structured application, the in-house method of<br>
> determining the columns for a table is to query the INFORMATION_SCHEMA of<br>> the mysql database at runtime, or to embed column names in SQL statements<br>> (eww). I have opted to place the results of INFORMATION_SCHEMA queries in<br>
> __PACKAGE__->add_columns but this is going to result in a lot of unnecessary<br>> DB calls. I think I will write some additional code to pre-cache the column<br>> names somewhere.<br><br></div>Why don'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>> In the interim, can you tell me if my approach of placing calls to<br>> DB::Main->load_classes inside the body of DB::Main::Foo a sane approach? I<br>
> happened upon it through experimentation.<br><br></div>Sane? ... well, I don't think anything that requires that approach is sane.<br>But once you -do- require something like that, it'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"> Matt S Trout Need help with your Catalyst or DBIx::Class project?<br> Technical Director <a href="http://www.shadowcat.co.uk/catalyst/" target="_blank">http://www.shadowcat.co.uk/catalyst/</a><br>
Shadowcat Systems Ltd. Want a managed development or deployment platform?<br><a href="http://chainsawblues.vox.com/" target="_blank">http://chainsawblues.vox.com/</a> <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>