line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MySQL::Util::Lite; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
96057
|
use Modern::Perl; |
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
7
|
|
6
|
1
|
|
|
1
|
|
592
|
use Moose; |
|
1
|
|
|
|
|
375009
|
|
|
1
|
|
|
|
|
5
|
|
7
|
1
|
|
|
1
|
|
7825
|
use namespace::autoclean; |
|
1
|
|
|
|
|
6553
|
|
|
1
|
|
|
|
|
3
|
|
8
|
1
|
|
|
1
|
|
594
|
use Method::Signatures; |
|
1
|
|
|
|
|
48202
|
|
|
1
|
|
|
|
|
7
|
|
9
|
1
|
|
|
1
|
|
972
|
use Data::Printer alias => 'pdump'; |
|
1
|
|
|
|
|
24507
|
|
|
1
|
|
|
|
|
7
|
|
10
|
1
|
|
|
1
|
|
1516
|
use MySQL::Util::Lite::Schema; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
117
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
extends 'MySQL::Util'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
############################### |
15
|
|
|
|
|
|
|
###### PUBLIC ATTRIBUTES ###### |
16
|
|
|
|
|
|
|
############################### |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
has 'dsn' => ( |
19
|
|
|
|
|
|
|
is => 'ro', |
20
|
|
|
|
|
|
|
isa => 'Str', |
21
|
|
|
|
|
|
|
required => 0 |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
has 'user' => ( |
25
|
|
|
|
|
|
|
is => 'ro', |
26
|
|
|
|
|
|
|
isa => 'Str', |
27
|
|
|
|
|
|
|
required => 0 |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
has 'pass' => ( |
31
|
|
|
|
|
|
|
is => 'ro', |
32
|
|
|
|
|
|
|
required => 0, |
33
|
|
|
|
|
|
|
default => undef |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
has 'span' => ( |
37
|
|
|
|
|
|
|
is => 'ro', |
38
|
|
|
|
|
|
|
isa => 'Int', |
39
|
|
|
|
|
|
|
required => 0, |
40
|
|
|
|
|
|
|
default => 0 |
41
|
|
|
|
|
|
|
); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
has 'dbh' => ( |
44
|
|
|
|
|
|
|
is => 'rw', |
45
|
|
|
|
|
|
|
isa => 'Object', |
46
|
|
|
|
|
|
|
); |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
################################ |
49
|
|
|
|
|
|
|
###### PRIVATE_ATTRIBUTES ###### |
50
|
|
|
|
|
|
|
################################ |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
has _util => ( |
53
|
|
|
|
|
|
|
is => 'ro', |
54
|
|
|
|
|
|
|
isa => 'MySQL::Util', |
55
|
|
|
|
|
|
|
lazy => 1, |
56
|
|
|
|
|
|
|
builder => '_build_util', |
57
|
|
|
|
|
|
|
); |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
############################ |
60
|
|
|
|
|
|
|
###### PUBLIC METHODS ###### |
61
|
|
|
|
|
|
|
############################ |
62
|
|
|
|
|
|
|
|
63
|
1
|
0
|
|
1
|
|
570
|
method get_schema { |
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
0
|
|
|
|
|
|
return my $schema = MySQL::Util::Lite::Schema->new( |
66
|
|
|
|
|
|
|
name => $self->_util->get_dbname, |
67
|
|
|
|
|
|
|
_util => $self->_util |
68
|
|
|
|
|
|
|
); |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
############################# |
72
|
|
|
|
|
|
|
###### PRIVATE METHODS ###### |
73
|
|
|
|
|
|
|
############################# |
74
|
|
|
|
|
|
|
|
75
|
1
|
0
|
|
1
|
|
628
|
method _build_util { |
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
0
|
|
|
|
|
|
my %new; |
78
|
0
|
0
|
|
|
|
|
$new{dsn} = $self->dsn if defined $self->dsn; |
79
|
0
|
0
|
|
|
|
|
$new{user} = $self->user if defined $self->user; |
80
|
0
|
0
|
|
|
|
|
$new{pass} = $self->pass if defined $self->pass; |
81
|
0
|
0
|
|
|
|
|
$new{span} = $self->span if defined $self->span; |
82
|
0
|
0
|
|
|
|
|
$new{dbh} = $self->dbh if defined $self->dbh; |
83
|
|
|
|
|
|
|
|
84
|
0
|
|
|
|
|
|
return MySQL::Util->new(%new); |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
1; |