line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MySQL::Util::Lite::Schema; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
8
|
use Modern::Perl; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
6
|
1
|
|
|
1
|
|
140
|
use Moose; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
7
|
|
7
|
1
|
|
|
1
|
|
6281
|
use namespace::autoclean; |
|
1
|
|
|
|
|
15
|
|
|
1
|
|
|
|
|
10
|
|
8
|
1
|
|
|
1
|
|
69
|
use Method::Signatures; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
9
|
1
|
|
|
1
|
|
368
|
use Data::Printer alias => 'pdump'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
10
|
1
|
|
|
1
|
|
1476
|
use MySQL::Util::Lite::Table; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
69
|
|
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
|
|
2599
|
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
|
|
803
|
method get_tables { |
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
return @{ $self->tables }; |
|
0
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
1
|
0
|
|
1
|
|
582
|
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; |