line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package SQL::Admin::Driver::Base; |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
3036
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
63
|
|
5
|
1
|
|
|
1
|
|
9
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
70
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = v0.5.0; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
###################################################################### |
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
8
|
use SQL::Admin; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
218
|
|
12
|
1
|
|
|
1
|
|
9
|
use Module::Load qw(); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
889
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
###################################################################### |
15
|
|
|
|
|
|
|
###################################################################### |
16
|
|
|
|
|
|
|
sub new { # ; |
17
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
18
|
0
|
0
|
|
|
|
|
$class = ref $class if ref $class; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
################################################################## |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
bless { |
23
|
|
|
|
|
|
|
@_, |
24
|
|
|
|
|
|
|
-sql_admin_search => [ $class, __PACKAGE__ ], |
25
|
|
|
|
|
|
|
}, $class; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
###################################################################### |
30
|
|
|
|
|
|
|
###################################################################### |
31
|
|
|
|
|
|
|
sub _load_and_new { # ; |
32
|
0
|
|
|
0
|
|
|
my ($self, $what) = (shift, shift); |
33
|
0
|
|
|
|
|
|
my $retval; |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
for (@{ $self->{-sql_admin_search} }) { |
|
0
|
|
|
|
|
|
|
36
|
0
|
|
0
|
|
|
|
$retval ||= eval { SQL::Admin->_load_and_new ($_ . '::' . $what, @_) }; |
|
0
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
################################################################## |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
$retval; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
###################################################################### |
46
|
|
|
|
|
|
|
###################################################################### |
47
|
|
|
|
|
|
|
sub options { |
48
|
|
|
|
|
|
|
( |
49
|
0
|
|
|
0
|
0
|
|
'file|f=s@' |
50
|
|
|
|
|
|
|
) |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
###################################################################### |
55
|
|
|
|
|
|
|
###################################################################### |
56
|
|
|
|
|
|
|
sub evaluate { # ; |
57
|
0
|
|
|
0
|
0
|
|
shift->evaluator->evaluate (@_); |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
###################################################################### |
62
|
|
|
|
|
|
|
###################################################################### |
63
|
|
|
|
|
|
|
sub decompose { # ; |
64
|
0
|
|
|
0
|
0
|
|
shift->decomposer ->decompose (@_); |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
###################################################################### |
69
|
|
|
|
|
|
|
###################################################################### |
70
|
|
|
|
|
|
|
sub decomposer { # ; |
71
|
0
|
|
|
0
|
0
|
|
shift->_load_and_new ('Decompose', @_); |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
###################################################################### |
76
|
|
|
|
|
|
|
###################################################################### |
77
|
|
|
|
|
|
|
sub evaluator { # ; |
78
|
0
|
|
|
0
|
0
|
|
shift->_load_and_new ('Evaluate', @_); |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
###################################################################### |
83
|
|
|
|
|
|
|
###################################################################### |
84
|
|
|
|
|
|
|
sub producer { # ; |
85
|
0
|
|
|
0
|
0
|
|
shift->_load_and_new ('Producer', @_); |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
###################################################################### |
90
|
|
|
|
|
|
|
###################################################################### |
91
|
|
|
|
|
|
|
sub parser { # ; |
92
|
0
|
|
|
0
|
0
|
|
shift->_load_and_new ('Parser', @_); |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
###################################################################### |
97
|
|
|
|
|
|
|
###################################################################### |
98
|
|
|
|
|
|
|
sub load { # ; |
99
|
0
|
|
|
0
|
0
|
|
my ($self, $catalog, @params) = @_; |
100
|
|
|
|
|
|
|
|
101
|
0
|
|
|
|
|
|
$self->evaluate ( |
102
|
|
|
|
|
|
|
$catalog, |
103
|
|
|
|
|
|
|
$self->parser (%$self )->load (@params) |
104
|
|
|
|
|
|
|
); |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
###################################################################### |
109
|
|
|
|
|
|
|
###################################################################### |
110
|
|
|
|
|
|
|
sub save { # ; |
111
|
0
|
|
|
0
|
0
|
|
my ($self, $catalog, @params) = @_; |
112
|
0
|
|
|
|
|
|
my $fh = \*STDOUT; |
113
|
|
|
|
|
|
|
|
114
|
0
|
0
|
|
|
|
|
if ($self->{file}) { |
115
|
0
|
|
|
|
|
|
my $file = $self->{file}[0]; |
116
|
0
|
0
|
|
|
|
|
open $fh, '>', $file |
117
|
|
|
|
|
|
|
or die "Unable write to $file: $!\n"; |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
################################################################## |
121
|
|
|
|
|
|
|
|
122
|
0
|
|
|
|
|
|
print $fh $self->producer (@params)->produce ( |
123
|
0
|
|
|
|
|
|
@{ $self->decompose ($catalog) } |
124
|
|
|
|
|
|
|
); |
125
|
|
|
|
|
|
|
} |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
###################################################################### |
129
|
|
|
|
|
|
|
###################################################################### |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
package SQL::Admin::Driver::Base; |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
1; |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
__END__ |