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

Kiffin Gish kiffin.gish at planet.nl
Fri Dec 25 18:57:16 GMT 2009


Great Octavian, thanks alot! Now I only need to figure out how to
translate this into a template.

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





More information about the DBIx-Class mailing list