[Dbix-class] Excluding columns from a query

Octavian Rasnita octavian at fcc.ro
Mon Feb 15 19:50:00 GMT 2010


From: "Robert Sedlacek" <rs at 474.at>

> Hey Nick,
>
> Nick Wellnhofer wrote:
>> It's simply an optimization. I have a table with a text column that can
>> contain tens of KB of data per row. I also have some queries that don't
>> need that column, so I'd like to avoid unnecessarily fetching all that
>> content from the DB.
>
> Depending on the queries you need to perform you might get away with
> separating the larger content out into a separate result source that you
> prefetch only when required.
>
> regards,
> -- 
> Robert 'phaylon' Sedlacek


Do I understand correctly that it is possible to create a Result class with 
fewer columns, give it another name but make it use the same table, and use 
it in relations as the original Result class?

Is it possible to subclass a Result class and just specify that we want to 
skip some columns from it?
If yes, is there a method for "deleting" those columns?

Thanks.

Octavian




More information about the DBIx-Class mailing list