[Dbix-class] using load_classes selectively

Frazer Irving superfraz at clumsyjedi.com
Fri Feb 8 09:52:28 GMT 2008


>
>
> On Feb 8, 2008 7:59 AM, Matt S Trout <dbix-class at trout.me.uk> wrote:
>
> >
> > What business requirement is leading you to want on-demand loading?
> >
>
Oops sorry about that last reply.

Basically I work on a poorly structured application, the in-house method of
determining the columns for a table is to query the INFORMATION_SCHEMA of
the mysql database at runtime, or to embed column names in SQL statements
(eww). I have opted to place the results of INFORMATION_SCHEMA queries in
__PACKAGE__->add_columns but this is going to result in a lot of unnecessary
DB calls. I think I will write some additional code to pre-cache the column
names somewhere.

In the interim, can you tell me if my approach of placing calls to
DB::Main->load_classes inside the body of DB::Main::Foo a sane approach? I
happened upon it through experimentation.

Cheers for the response.

f





>
> > --
> >      Matt S Trout       Need help with your Catalyst or DBIx::Class
> > project?
> >   Technical Director
> > http://www.shadowcat.co.uk/catalyst/
> >  Shadowcat Systems Ltd.  Want a managed development or deployment
> > platform?
> > http://chainsawblues.vox.com/
> > http://www.shadowcat.co.uk/servers/
> >
> > _______________________________________________
> > List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> > IRC: irc.perl.org#dbix-class
> > SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> > Searchable Archive:
> > http://www.grokbase.com/group/dbix-class@lists.rawmode.org
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20080208/ea5=
d4040/attachment.htm


More information about the DBIx-Class mailing list