line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MySQL::Util::Lite::Schema; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
7
|
use Modern::Perl; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
6
|
1
|
|
|
1
|
|
138
|
use Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
7
|
1
|
|
|
1
|
|
7414
|
use namespace::autoclean; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
9
|
|
8
|
1
|
|
|
1
|
|
77
|
use Method::Signatures; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
9
|
1
|
|
|
1
|
|
481
|
use Data::Printer alias => 'pdump'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
10
|
1
|
|
|
1
|
|
1748
|
use MySQL::Util::Lite::Table; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
95
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has name => ( |
13
|
|
|
|
|
|
|
is => 'ro', |
14
|
|
|
|
|
|
|
isa => 'Str', |
15
|
|
|
|
|
|
|
required => 1, |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
has tables => ( |
19
|
|
|
|
|
|
|
is => 'rw', |
20
|
|
|
|
|
|
|
isa => 'ArrayRef[MySQL::Util::Lite::Table]', |
21
|
|
|
|
|
|
|
lazy => 1, |
22
|
|
|
|
|
|
|
builder => '_build_tables', |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
has _util => ( |
26
|
|
|
|
|
|
|
is => 'ro', |
27
|
|
|
|
|
|
|
isa => 'MySQL::Util', |
28
|
|
|
|
|
|
|
required => 1, |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
|
31
|
1
|
0
|
0
|
1
|
|
3119
|
method get_table (Str $name) { |
|
0
|
0
|
|
0
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
my @tables = $self->get_tables; |
34
|
0
|
|
|
|
|
|
foreach my $t (@tables) { |
35
|
0
|
0
|
|
|
|
|
if ( $t->name eq $name ) { |
36
|
0
|
|
|
|
|
|
return $t; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
1
|
0
|
|
1
|
|
974
|
method get_tables { |
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
return @{ $self->tables }; |
|
0
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
1
|
0
|
|
1
|
|
733
|
method _build_tables { |
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
my $aref = $self->_util->get_tables; |
49
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
my @ret; |
51
|
0
|
|
|
|
|
|
foreach my $table (@$aref) { |
52
|
0
|
|
|
|
|
|
push @ret, |
53
|
|
|
|
|
|
|
MySQL::Util::Lite::Table->new( |
54
|
|
|
|
|
|
|
name => $table, |
55
|
|
|
|
|
|
|
schema_name => $self->name, |
56
|
|
|
|
|
|
|
_util => $self->_util |
57
|
|
|
|
|
|
|
); |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
0
|
|
|
|
|
|
return \@ret; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |