use List::Util qw( pairs pairkeys );
my $db = eval {
- my @dbinfo = (
- 'DBI:Pg:dbname=sheet;host=localhost', 'sheetadmin', 'fairuse',
- ) or die "database not configured\n";
- require DBIx::Simple;
- DBIx::Simple->new(@dbinfo[0..2], {
- RaiseError => 1,
- pg_enable_utf8 => 1,
- });
+ require Shiar_Sheet::DB;
+ Shiar_Sheet::DB->connect;
} or Abort('Database error', 501, $@);
-$db->abstract->{array_datatypes}++;
my $user = eval {
if (defined $post{username}) {
sub imagepath {
my ($row, $col) = @_;
return "data/word/org/$row->{id}.jpg" if $col eq 'source';
- return "data/word/en/$row->{form}.jpg" if $col eq 'thumb';
+ return "data/word/en/$row->{id}.jpg" if $col eq 'thumb';
return;
}
}