line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Schema::RDBMS::AUS; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
314303
|
use 5.006; |
|
4
|
|
|
|
|
15
|
|
|
4
|
|
|
|
|
172
|
|
4
|
4
|
|
|
4
|
|
25
|
use strict; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
133
|
|
5
|
4
|
|
|
4
|
|
18
|
use warnings; |
|
4
|
|
|
|
|
14
|
|
|
4
|
|
|
|
|
102
|
|
6
|
|
|
|
|
|
|
|
7
|
4
|
|
|
4
|
|
19
|
use DBI; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
160
|
|
8
|
4
|
|
|
4
|
|
19
|
use DBIx::Transaction; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
122
|
|
9
|
4
|
|
|
4
|
|
28
|
use DBIx::Migration::Directories::Base; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
1805
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
12
|
|
|
|
|
|
|
our $SCHEMA_VERSION = '0.01'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our @optmap = ( |
15
|
|
|
|
|
|
|
['AUS_DB_DSN', 'DBI_DSN'], |
16
|
|
|
|
|
|
|
['AUS_DB_USER', 'DBI_USER'], |
17
|
|
|
|
|
|
|
['AUS_DB_PASS', 'DBI_PASS'], |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub sdbh { |
21
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
22
|
0
|
|
|
|
|
|
my $dbh = $class->dbh(@_); |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
DBIx::Migration::Directories::Base->new(dbh=>$dbh)->require_schema( |
25
|
|
|
|
|
|
|
'Schema-RDBMS-AUS' => $VERSION |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
return $dbh; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub db_opts { |
32
|
0
|
|
|
0
|
0
|
|
my($class, @db_opts) = @_; |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
$db_opts[$_->[0]] = $ENV{$_->[1]} |
35
|
0
|
|
|
|
|
|
foreach( |
36
|
0
|
|
|
|
|
|
grep { defined $_->[1] } |
37
|
0
|
|
|
|
|
|
map { [ $_, (grep { defined $ENV{$_} } @{$optmap[$_]})[0] ] } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
grep { !defined $db_opts[$_] } |
39
|
|
|
|
|
|
|
($[ .. $#optmap) |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
|
42
|
0
|
0
|
|
|
|
|
$db_opts[3] = { |
43
|
|
|
|
|
|
|
RaiseError => 1, PrintError => 0, PrintWarn => 0, AutoCommit => 1 |
44
|
|
|
|
|
|
|
} unless defined $db_opts[3]; |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
return(@db_opts); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub dbh { |
50
|
0
|
|
|
0
|
1
|
|
my($class, @db_opts) = @_; |
51
|
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
@db_opts = $class->db_opts(@db_opts); |
53
|
|
|
|
|
|
|
|
54
|
0
|
0
|
|
|
|
|
my $dbh = DBIx::Transaction->connect_cached(@db_opts) |
55
|
|
|
|
|
|
|
or die "Database connection @db_opts[0,1] failed: ", DBI->errstr; |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
return $dbh; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
1; |