Subject: | Feature request: get_colnames and get_all_as_list |
Hi,
I'm currently developing a piece of SW which queries data from a data
source (instrumented via YAML) and put it into a report using
Template::Plugin::Latex.
Currently it's complicated doing this with Template::DBI - that's why
I've extended my local copy with 3 methods:
sub get_colnames
{
my $self = shift;
my $sth = $self->{_STH};
my $error;
my $data = $sth->{NAME_lc};
$self->throw($error) if ( $error = $sth->err() );
return $data;
}
sub get_COLnames
{
my $self = shift;
my $sth = $self->{_STH};
my $error;
my $data = $sth->{NAME_uc};
$self->throw($error) if ( $error = $sth->err() );
return $data;
}
sub get_all_list
{
my $self = shift;
my $sth = $self->{_STH};
my $error;
my $data = $sth->fetchall_arrayref();
$self->throw($error) if ( $error = $sth->err() );
unshift( @$data, $self->{NEXT} ) if $self->{NEXT};
$self->{LAST} = 1;
$self->{NEXT} = undef;
$sth->finish();
return $data;
}
Maybe you find it worth to add it (even modified) to your module.
Best regards,
Jens