App-AutoCRUD
view release on metacpan or search on metacpan
lib/App/AutoCRUD/DataSource.pm view on Meta::CPAN
$table, undef);
my $columns = $sth->fetchall_hashref('COLUMN_NAME');
# TMP HACK, Oracle-specific. Q: How to design a good abstraction for this ?
$columns = $self->_columns_from_Oracle_synonym($db_schema, $table)
if ! keys %$columns and $self->dbh->{Driver}{Name} eq 'Oracle';
# mark primary keys
$columns->{$_}{is_pk} = 1 foreach @pk;
# attach paths (in alphabetic order) to relevant columns
foreach my $path (map {$paths{$_}} sort keys %paths) {
# name of column(s) from which this path starts
my %path_on = $path->on;
my ($col_name, @others) = keys %path_on;
# for the moment, don't handle assoc on multiple columns (TODO)
next if @others;
my $col = $columns->{$col_name} or next;
my $path_subdata = { name => $path->name,
lib/App/AutoCRUD/View/Xlsx.pm view on Meta::CPAN
autofilter => 1,
});
$worksheet->freeze_panes(4, 0);
# finalize the workbook
$workbook->close();
# return Plack response
my @http_headers = (
'Content-type' => 'application/xlsx',
'Content-disposition' => qq{attachment; filename="$table.xlsx"},
);
return [200, \@http_headers, [$str] ];
}
1;
__END__
( run in 0.545 second using v1.01-cache-2.11-cpan-e1769b4cff6 )