File Coverage

File:lib/DBIx/SchemaChecksum/App.pm
Coverage:100.0%

linestmtbrancondsubtimecode
1package DBIx::SchemaChecksum::App;
2
5
5
5
2110
9
130
use 5.010;
3
5
5
5
716
1426149
58
use MooseX::App qw(Config);
4extends qw(DBIx::SchemaChecksum);
5
6
5
5
5
2068394
16271
571
use DBI;
7
8option 'dsn' => (
9    isa => 'Str',
10    is => 'ro',
11    required => 1,
12    documentation => q[DBI Data Source Name]
13);
14option 'user' => (
15    isa => 'Str',
16    is => 'ro',
17    documentation => q[username to connect to database]
18);
19option 'password' => (
20    isa => 'Str',
21    is => 'ro',
22    documentation => q[password to connect to database]
23);
24option [qw(+catalog +schemata +tabletype)] => ();
25
26has '+dbh' => ( lazy_build => 1 );
27
28sub _build_dbh {
29
5
9
    my $self = shift;
30
5
116
    return DBI->connect(
31        $self->dsn, $self->user, $self->password,
32        { RaiseError => 1 } # TODO: set dbi->connect opts via App
33    );
34}
35
361;