[Dbix-class] DBIx::Class column list

Matt S Trout dbix-class at trout.me.uk
Tue Mar 11 04:04:00 GMT 2008


On Mon, Mar 10, 2008 at 09:39:59AM -0800, Bruce J Keeler wrote:
> Ryan D Johnson wrote:
> >xyon <xyon at indigorobot.com> writes:
> >
> >  
> >>I just want to fetch the column names.  Below is essentially what I
> >>want to do (but it obviously doesn't work;)):
> >>
> >>my @columns	= $schema->resultset('data')->columns;
> >>    
> >
> >  
> I also have this need.
> >Is this what you're looking for:
> >
> >$ $schema->resultset('User')->result_source->columns;
> >$ARRAY1 = [
> >            'id',
> >            'email',
> >            'username',
> >            'password',
> >            'signup_time',
> >            'activation_code',
> >            'invitations_left'
> >          ];
> >  
> And this isn't what I need.  A result set might have columns from joined 
> tables, or it might not have all of the columns from its base table.
> 
> I have the following in my custom ResultSet class, which does what I 
> need.  Perhaps it would be a useful addition to the base ResultSet?

Maybe.

I think I'd like to see this feature, but I'm not sure we can implement it
very well currently because a lot of information isn't preserved.

When we start rounding up 09 plans, sign out and we'll discuss this in
more detail.

-- 
      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/



More information about the DBIx-Class mailing list