line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MySQL::Util::Lite::AlternateKey; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
7
|
use Modern::Perl; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
6
|
1
|
|
|
1
|
|
159
|
use Moose; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
7
|
|
7
|
1
|
|
|
1
|
|
6975
|
use namespace::autoclean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
8
|
1
|
|
|
1
|
|
71
|
use Method::Signatures; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
7
|
|
9
|
1
|
|
|
1
|
|
419
|
use Data::Printer alias => 'pdump'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
with 'MySQL::Util::Lite::Roles::NewColumn'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has name => ( |
14
|
|
|
|
|
|
|
is => 'ro', |
15
|
|
|
|
|
|
|
isa => 'Str', |
16
|
|
|
|
|
|
|
required => 1, |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
has columns => ( |
20
|
|
|
|
|
|
|
is => 'rw', |
21
|
|
|
|
|
|
|
isa => 'ArrayRef[MySQL::Util::Lite::Column]', |
22
|
|
|
|
|
|
|
lazy => 1, |
23
|
|
|
|
|
|
|
builder => '_build_columns', |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
has _util => ( |
27
|
|
|
|
|
|
|
is => 'ro', |
28
|
|
|
|
|
|
|
isa => 'MySQL::Util', |
29
|
|
|
|
|
|
|
required => 1, |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
|
32
|
1
|
0
|
|
1
|
|
2281
|
method get_columns { |
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
return @{ $self->columns }; |
|
0
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
1
|
0
|
|
1
|
|
777
|
method _build_columns { |
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
my $aref = $self->_util->get_constraint( name => $self->name ); |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
my @cols; |
42
|
0
|
|
|
|
|
|
foreach my $col (@$aref) { |
43
|
|
|
|
|
|
|
my $href = $self->_util->describe_column( |
44
|
|
|
|
|
|
|
table => $col->{TABLE_NAME}, |
45
|
|
|
|
|
|
|
column => $col->{COLUMN_NAME} |
46
|
0
|
|
|
|
|
|
); |
47
|
0
|
|
|
|
|
|
push @cols, $self->new_column($href); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
return \@cols; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |