[Dbix-class] Ordered columns and data type ...

Rob Kinyon rob.kinyon at gmail.com
Fri Dec 25 20:35:39 GMT 2009


It's a ResultSource (not to be confused with a ResultSet).

http://search.cpan.org/~frew/DBIx-Class-0.08115/lib/DBIx/Class/ResultSource.pm#column_info

On Fri, Dec 25, 2009 at 15:18, Kiffin Gish <kiffin.gish at planet.nl> wrote:
> What does $t refer to? $row?
>
> On Fri, 2009-12-25 at 17:32 +0200, Octavian Râşniţă wrote:
>> From: "Kiffin Gish" <kiffin.gish at planet.nl>
>> > Is there a way to get an array of ordered column names from a given row
>> > object?
>>
>> my @columns = $row->columns;
>>
>> > How do I get the data type of a given column?
>>
>> my $row = $schema->resultset('TheResultSet')->search({},{rows => 1})->first;
>>
>> my @columns = $row->columns;
>>
>> for(@columns) {
>> print "Col: $_\n";
>> my $info = $t->column_info($_);
>>
>> print Dumper($info) . "\n\n";
>> }
>>
>> HTH.
>>
>> Octavian
>>
>>
>> _______________________________________________
>> 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.scsys.co.uk
>
>
> --
> Kiffin Gish <Kiffin.Gish at planet.nl>
> Gouda, The Netherlands
>
>
>
> _______________________________________________
> 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.scsys.co.uk
>



-- 
Thanks,
Rob Kinyon



More information about the DBIx-Class mailing list