| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# ========================================================================== # |
|
2
|
|
|
|
|
|
|
# lib/JPList::DB::Config.pm - JPList DB Config |
|
3
|
|
|
|
|
|
|
# Copyright (C) 2017 Exceleron Software, LLC |
|
4
|
|
|
|
|
|
|
# ========================================================================== # |
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package JPList::DB::Config; |
|
7
|
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
1096
|
use Moose::Role; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
18
|
|
|
9
|
2
|
|
|
2
|
|
10310
|
use strict; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
57
|
|
|
10
|
2
|
|
|
2
|
|
13
|
use warnings; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
69
|
|
|
11
|
2
|
|
|
2
|
|
13
|
use namespace::autoclean; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
17
|
|
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# ========================================================================== # |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 NAME |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
JPList::DB::Config - JPList DB Config |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 VERSION |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
Version 0.04 |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=cut |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
with 'JPList::DB::Config'; |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
The JPList::DB::Config module allows you store the DB Config |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head2 ATTRIBUTES |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=over 4 |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=cut |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# ========================================================================== # |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=item C<dbh> |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Params : $dbh |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Desc : Database Handle |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=item C<db_table_name> |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Params : $table_name |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Desc : Table name to query the result |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=item C<fields> |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Params : String |
|
58
|
|
|
|
|
|
|
'"Column1", "Column2"' |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Desc : Fields can be column list |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=item C<where_fields> |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Params : HASHREF |
|
65
|
|
|
|
|
|
|
{ |
|
66
|
|
|
|
|
|
|
Column1 => '' |
|
67
|
|
|
|
|
|
|
} |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Desc : Table name to query the result |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=cut |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
has 'dbh' => ( |
|
74
|
|
|
|
|
|
|
is => 'rw', |
|
75
|
|
|
|
|
|
|
required => 1, |
|
76
|
|
|
|
|
|
|
); |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
has 'db_table_name' => ( |
|
80
|
|
|
|
|
|
|
is => 'rw', |
|
81
|
|
|
|
|
|
|
isa => 'Str', |
|
82
|
|
|
|
|
|
|
required => 1, |
|
83
|
|
|
|
|
|
|
); |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
has 'fields' => ( |
|
86
|
|
|
|
|
|
|
is => 'rw', |
|
87
|
|
|
|
|
|
|
documentation => |
|
88
|
|
|
|
|
|
|
'fields as per SQL::Abstract it can be array of fields (which will be joined and quoted) or plain scalar (literal SQL, not quoted)' |
|
89
|
|
|
|
|
|
|
); |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
has 'where_fields' => ( |
|
92
|
|
|
|
|
|
|
is => 'rw', |
|
93
|
|
|
|
|
|
|
default => sub { |
|
94
|
|
|
|
|
|
|
return {}; |
|
95
|
|
|
|
|
|
|
}, |
|
96
|
|
|
|
|
|
|
documentation => 'Custom Where fields like UtilityId etc..' |
|
97
|
|
|
|
|
|
|
); |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
has 'group_fields' => ( |
|
100
|
|
|
|
|
|
|
is => 'rw', |
|
101
|
|
|
|
|
|
|
documentation => 'Custom group by fields like UtilityId, AccountId etc..' |
|
102
|
|
|
|
|
|
|
); |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
has 'order_index' => ( |
|
105
|
|
|
|
|
|
|
is => 'rw', |
|
106
|
|
|
|
|
|
|
documentation => |
|
107
|
|
|
|
|
|
|
'Custom order index to sort by order index instad of column name to support quries with custom fields' |
|
108
|
|
|
|
|
|
|
); |
|
109
|
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
# ========================================================================== # |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
1; |
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
__END__ |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=back |
|
117
|
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head1 AUTHORS |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
Sheeju Alex, <sheeju@exceleron.com> |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=head1 BUGS |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
https://github.com/sheeju/JPList/issues |
|
125
|
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=head1 SUPPORT |
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
|
129
|
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
perldoc JPList |
|
131
|
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
You can also look for information at: |
|
134
|
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=over 4 |
|
136
|
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker (report bugs here) |
|
138
|
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=JPList> |
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
|
142
|
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
L<http://annocpan.org/dist/JPList> |
|
144
|
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=item * CPAN Ratings |
|
146
|
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
L<http://cpanratings.perl.org/d/JPList> |
|
148
|
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=item * Search CPAN |
|
150
|
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
L<http://search.cpan.org/dist/JPList/> |
|
152
|
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=back |
|
154
|
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
|
156
|
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
Development time supported by Exceleron L<www.exceleron.com|http://www.exceleron.com>. |
|
158
|
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
|
160
|
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
Copyright (C) 2017 Exceleron Software, LLC |
|
162
|
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
|
164
|
|
|
|
|
|
|
under the terms of the the Artistic License (2.0). You may obtain a |
|
165
|
|
|
|
|
|
|
copy of the full license at: |
|
166
|
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
L<http://www.perlfoundation.org/artistic_license_2_0> |
|
168
|
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
Any use, modification, and distribution of the Standard or Modified |
|
170
|
|
|
|
|
|
|
Versions is governed by this Artistic License. By using, modifying or |
|
171
|
|
|
|
|
|
|
distributing the Package, you accept this license. Do not use, modify, |
|
172
|
|
|
|
|
|
|
or distribute the Package, if you do not accept this license. |
|
173
|
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
If your Modified Version has been derived from a Modified Version made |
|
175
|
|
|
|
|
|
|
by someone other than you, you are nevertheless required to ensure that |
|
176
|
|
|
|
|
|
|
your Modified Version complies with the requirements of this license. |
|
177
|
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
This license does not grant you the right to use any trademark, service |
|
179
|
|
|
|
|
|
|
mark, tradename, or logo of the Copyright Holder. |
|
180
|
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
This license includes the non-exclusive, worldwide, free-of-charge |
|
182
|
|
|
|
|
|
|
patent license to make, have made, use, offer to sell, sell, import and |
|
183
|
|
|
|
|
|
|
otherwise transfer the Package with respect to any patent claims |
|
184
|
|
|
|
|
|
|
licensable by the Copyright Holder that are necessarily infringed by the |
|
185
|
|
|
|
|
|
|
Package. If you institute patent litigation (including a cross-claim or |
|
186
|
|
|
|
|
|
|
counterclaim) against any party alleging that the Package constitutes |
|
187
|
|
|
|
|
|
|
direct or contributory patent infringement, then this Artistic License |
|
188
|
|
|
|
|
|
|
to you shall terminate on the date that such litigation is filed. |
|
189
|
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER |
|
191
|
|
|
|
|
|
|
AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. |
|
192
|
|
|
|
|
|
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR |
|
193
|
|
|
|
|
|
|
PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY |
|
194
|
|
|
|
|
|
|
YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR |
|
195
|
|
|
|
|
|
|
CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR |
|
196
|
|
|
|
|
|
|
CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, |
|
197
|
|
|
|
|
|
|
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
198
|
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
=cut |
|
200
|
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
# vim: ts=4 |
|
202
|
|
|
|
|
|
|
# vim600: fdm=marker fdl=0 fdc=3 |