File Coverage

blib/lib/DBIx/SchemaChecksum/App.pm
Criterion Covered Total %
statement 10 10 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 14 14 100.0


line stmt bran cond sub pod time code
1             package DBIx::SchemaChecksum::App;
2              
3             # ABSTRACT: Manage your datebase schema via checksums
4             our $VERSION = '1.104'; # VERSION
5              
6 4     4   2661 use 5.010;
  4         20  
7 4     4   2441 use MooseX::App 1.21 qw(Config ConfigHome);
  4         309834  
  4         30  
8             extends qw(DBIx::SchemaChecksum);
9              
10 4     4   1737368 use DBI;
  4         38345  
  4         875  
11              
12             option 'dsn' => (
13             isa => 'Str',
14             is => 'ro',
15             required => 1,
16             documentation => q[DBI Data Source Name]
17             );
18             option 'user' => (
19             isa => 'Str',
20             is => 'ro',
21             documentation => q[username to connect to database]
22             );
23             option 'password' => (
24             isa => 'Str',
25             is => 'ro',
26             documentation => q[password to connect to database]
27             );
28             option [qw(+catalog +schemata +driveropts)] => ();
29              
30             has '+dbh' => ( lazy_build => 1 );
31              
32             sub _build_dbh {
33 5     5   14 my $self = shift;
34 5         202 return DBI->connect(
35             $self->dsn, $self->user, $self->password,
36             { RaiseError => 1 } # TODO: set dbi->connect opts via App
37             );
38             }
39              
40             __PACKAGE__->meta->make_immutable();
41             1;
42              
43             __END__
44              
45             =pod
46              
47             =encoding UTF-8
48              
49             =head1 NAME
50              
51             DBIx::SchemaChecksum::App - Manage your datebase schema via checksums
52              
53             =head1 VERSION
54              
55             version 1.104
56              
57             =head1 DESCRIPTION
58              
59             Manage your datebase schema via checksums
60              
61             =over
62              
63             =item * Use C<checksum> to calculate the current checksum of your database.
64              
65             =item * Use C<new_changes_file> to generate a new db update script based on the current checksum.
66              
67             =item * Use C<apply_changes> to apply all update scripts starting from the current checksum.
68              
69             =back
70              
71             For more background information, check out the man-page via C<perldoc DBIx::SchemaChecksum> or on L<https://metacpan.org/pod/DBIx::SchemaChecksum>
72              
73             =head1 AUTHORS
74              
75             =over 4
76              
77             =item *
78              
79             Thomas Klausner <domm@plix.at>
80              
81             =item *
82              
83             Maroš Kollár <maros@cpan.org>
84              
85             =item *
86              
87             Klaus Ita <koki@worstofall.com>
88              
89             =back
90              
91             =head1 COPYRIGHT AND LICENSE
92              
93             This software is copyright (c) 2012 - 2021 by Thomas Klausner, Maroš Kollár, Klaus Ita.
94              
95             This is free software; you can redistribute it and/or modify it under
96             the same terms as the Perl 5 programming language system itself.
97              
98             =cut