Games::StarCraft::DB class for schtarr database
[perl/schtarr.git] / Games / StarCraft / DB.pm
1 package Games::StarCraft::DB;
2
3 use strict;
4 use warnings;
5 use DBIx::Simple;
6 use Carp;
7 use base 'DBIx::Simple';
8
9 our $VERSION = '1.00';
10 our @Conf;  # database connect options
11
12 sub connect {
13         my $self = shift;
14         eval { require Games::StarCraft::DB::Local };  # local @Conf overrides
15         my @options = @Conf;
16         if (@_ >= 1 and ref (my $manual = shift) eq "HASH") {
17                 while (my ($key, $value) = each %$manual) {
18                         $options[3]->{$key} = $value;
19                 }
20         }
21         return $self->SUPER::connect(@options);
22 }
23
24 1;
25