SQL/Abstract/Plugin/ExtraClauses.pm

filter: Statementstmt 98.0% 150 / 153 Branchbran 88.7% 71 / 80 Conditioncond 79.4% 27 / 34 MC/DCmcdc 59.0% 13 / 22 Subroutinesub 100% 28 / 28 Podpod 100% 1 / 1 totaltotal 91.1% 290 / 318 CC 55 SCAR 17.2
CC
55
Cov
93%
_expand_from_list
12.0
_expand_join
9.0
_render_join
8.5
CRAP 5.6
« DBIx/Class/Storage/Debug/PrettyPrint.pm ↑ Summary SQL/Abstract/Role/Plugin.pm »
1 package SQL::Abstract::Plugin::ExtraClauses;
2  
3 2 our $VERSION = '2.000003';
4 2 ▶$VERSION = eval $VERSION if $VERSION =~ /_/; # numify for warning-free dev releases
Branch: 1 branch
BranchTrueFalseTotal
if $VERSION =~ /_/ 0 2 2
5  
6 2 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 with 'SQL::Abstract::Role::Plugin';
9  
10 2 ▶sub register_extensions {
Subroutine register_extensions: called CC=5 SCAR=16.1
Pod documented
11 2 my ($self, $sqla) = @_;
12  
13 2 my @clauses = $sqla->clauses_of('select');
14 2 my @before_setop;
15 2 CLAUSE: foreach my $idx (0..$#clauses) {
16 8 ▶ if ($clauses[$idx] eq 'order_by') {
Branch: 1 branch
BranchTrueFalseTotal
if ($clauses[$idx] eq "order_by") 2 6 8
17 2 @before_setop = @clauses[0..$idx-1];
18 2 splice(@clauses, $idx, 0, qw(setop group_by having));
19 2 last CLAUSE;
20 }
21 }
22  
23 2 ▶ die "Huh?" unless @before_setop;
Branch: 1 branch
BranchTrueFalseTotal
unless @before_setop 0 2 2
24 2 $sqla->clauses_of(select => @clauses);
25  
26 2 ▶ $sqla->clauses_of(update => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
27 2 my ($self, @clauses) = @_;
28 2 splice(@clauses, 2, 0, 'from');
29 2 @clauses;
30 2 });
31  
32 2 ▶ $sqla->clauses_of(delete => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
33 2 my ($self, @clauses) = @_;
34 2 splice(@clauses, 1, 0, 'using');
35 2 @clauses;
36 2 });
37  
38 $self->register(
39 (map +(
40 "${_}er" => [
41 do {
42 4 my $x = $_;
43 4 (map +($_ => "_${x}_${_}"), qw(join from_list alias))
44 }
45 ]
46 ), qw(expand render)),
47 binop_expander => [ as => '_expand_op_as' ],
48 renderer => [ as => '_render_as' ],
49 expander => [ cast => '_expand_cast' ],
50 clause_expanders => [
51 'select.group_by'
52 4 ▶ => sub { $_[0]->expand_expr({ -list => $_[2] }, -ident) },
Subroutine __ANON__: called CC=1 SCAR=0.0
53 'select.having'
54 3 ▶ => sub { $_[0]->expand_expr($_[2]) },
Subroutine __ANON__: called CC=1 SCAR=0.0
55 'update.from' => '_expand_from_list',
56 "update.target", '_expand_update_clause_target',
57 "update.update", '_expand_update_clause_target',
58 'delete.using' => '_expand_from_list',
59 2 ▶ 'insert.rowvalues' => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
60 2 +(from => $_[0]->expand_expr({ -values => $_[2] }));
61 },
62 3 ▶ 'insert.select' => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
63 3 +(from => $_[0]->expand_expr({ -select => $_[2] }));
64 },
65 2 ],
66 );
67  
68 2 $sqla->expander(old_from => $sqla->clause_expander('select.from'));
69 2 ▶ $sqla->wrap_clause_expander('select.from', sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
70 2 my ($orig) = @_;
71 46 ▶ sub {
Subroutine __ANON__: called CC=5 SCAR=16.1
72 46 my ($sqla, undef, $args) = @_;
73 46 ▶ if (ref($args) eq 'HASH') {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $args eq "HASH") 7 39 46
74 7 return $self->_expand_from_list(undef, $args);
75 }
76 39 ▶ if (
Branch: 1 branch
BranchTrueFalseTotal
if (ref $args eq "ARRAY" and grep {not ref $_ and $_ =~ /^-/;} @$args) 15 24 39
Condition100%3/3
ref $args eq "ARRAY" and grep {not ref $_ and $_ =~ /^-/;} @$args
!ll&&!rl&&r
23115
MC/DC100%2/2
ref $args eq "ARRAY" and grep {not ref $_ and $_ =~ /^-/;} @$args
ref $args eq "ARRAY" grep {not ref $_ and $_ =~ /^-/;} @$args
Truth table100%3/3
A and B
A= ref $args eq "ARRAY"B= grep {not ref $_ and $_ =~ /^-/;} @$args
ABresult
0X0
100
111
77 ref($args) eq 'ARRAY'
78 60 ▶ and grep { !ref($_) and $_ =~ /^-/ } @$args
Condition100%3/3
!ref($_) && $_ =~ /^-/
!ll&&!rl&&r
211722
MC/DC100%2/2
!ref($_) && $_ =~ /^-/
!ref($_) $_ =~ /^-/
Truth table100%3/3
not(A) && B
A= !ref($_)B= $_ =~ /^-/
ABresult
0X0
100
111
79 ) {
80 15 return $self->_expand_from_list(undef, $args);
81 }
82 24 return $sqla->$orig(undef, $args);
83 }
84 2 });
85  
86 # set ops
87 2 ▶ $sqla->wrap_expander(select => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
88 2 $self->cb('_expand_select', $_[0], \@before_setop);
89 2 });
90  
91 $self->register(
92 clause_renderer => [
93 3 ▶ 'select.setop' => sub { $_[0]->render_aqt($_[2]) }
Subroutine __ANON__: called CC=1 SCAR=0.0
94 2 ],
95 expander => [
96 map +($_ => '_expand_setop', "${_}_all" => '_expand_setop'), qw(union intersect except) ],
97 renderer => [ map +($_ => '_render_setop'), qw(union intersect except) ],
98 );
99  
100 2 my $setop_expander = $self->cb('_expand_clause_setop');
101  
102 2 $sqla->clause_expanders(
103 map +($_ => $setop_expander),
104 map "select.${_}",
105 map +($_, "${_}_all", "${_}_distinct"),
106 qw(union intersect except)
107 );
108  
109 2 foreach my $stmt (qw(select insert update delete)) {
110 8 $sqla->clauses_of($stmt => 'with', $sqla->clauses_of($stmt));
111 8 $self->register(
112 clause_expanders => [
113 "${stmt}.with" => '_expand_with',
114 "${stmt}.with_recursive" => '_expand_with',
115 ],
116 clause_renderer => [ "${stmt}.with" => '_render_with' ],
117 );
118 }
119  
120 2 return $sqla;
121 }
122  
123 50 ▶sub _expand_select {
Subroutine _expand_select: called CC=3 SCAR=11.0
124 50 my ($self, $orig, $before_setop, @args) = @_;
125 50 my $exp = $self->sqla->$orig(@args);
126 49 ▶ return $exp unless my $setop = (my $sel = $exp->{-select})->{setop};
Branch: 1 branch
BranchTrueFalseTotal
unless my $setop = +(my $sel = $exp->{"-select"})->{"setop"} 45 4 49
127 4 ▶ if (my @keys = grep $sel->{$_}, @$before_setop) {
Branch: 1 branch
BranchTrueFalseTotal
if (my(@keys) = grep($sel->{$_}, @$before_setop)) 3 1 4
128 3 my %inner; @inner{@keys} = delete @{$sel}{@keys};
129 3 unshift @{(values(%$setop))[0]->{queries}},
130 { -select => \%inner };
131 }
132 4 return $exp;
133 }
134  
135 60 ▶sub _expand_from_list {
Subroutine _expand_from_list: called CC=12 SCAR=24.9
136 60 my ($self, undef, $args) = @_;
137 60 ▶ if (ref($args) eq 'HASH') {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $args eq "HASH") 24 36 60
138 24 ▶ return $args if $args->{-from_list};
Branch: 1 branch
BranchTrueFalseTotal
if $args->{"-from_list"} 3 21 24
139 21 return { -from_list => [ $self->expand_expr($args) ] };
140 }
141 36 my @list;
142 36 ▶ my @args = ref($args) eq 'ARRAY' ? @$args : ($args);
Branch: 1 branch
BranchTrueFalseTotal
ref $args eq 'ARRAY' ? : 21 15 36
143 36 ▶ while (my $entry = shift @args) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $entry = shift @args) 61 35 96
144 61 ▶ if (!ref($entry) and $entry =~ /^-(.*)/) {
Branch: 1 branch
BranchTrueFalseTotal
if (not ref $entry and $entry =~ /^-(.*)/) 25 36 61
Condition100%3/3
not ref $entry and $entry =~ /^-(.*)/
!ll&&!rl&&r
92725
MC/DC100%2/2
not ref $entry and $entry =~ /^-(.*)/
not ref $entry $entry =~ /^-(.*)/
Truth table100%3/3
not(A) and B
A= not ref $entryB= $entry =~ /^-(.*)/
ABresult
0X0
100
111
145 25 ▶ if ($1 eq 'as') {
Branch: 1 branch
BranchTrueFalseTotal
if ($1 eq "as") 10 15 25
146 10 ▶ $list[-1] = $self->expand_expr({ -as => [
Branch: 1 branch
BranchTrueFalseTotal
ref $_ eq 'ARRAY' ? : 1 9 10
147 $list[-1], map +(ref($_) eq 'ARRAY' ? @$_ : $_), shift(@args)
148 ]});
149 10 next;
150 }
151 15 $entry = { $entry => shift @args };
152 }
153 51 my $aqt = $self->expand_expr($entry, -ident);
154 50 ▶ if ($aqt->{-join} and not $aqt->{-join}{from}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($aqt->{"-join"} and not $aqt->{"-join"}{"from"}) 13 37 50
Condition66%2/3
$aqt->{"-join"} and not $aqt->{"-join"}{"from"}
!ll&&!rl&&r
37013
MC/DC50%1/2
$aqt->{"-join"} and not $aqt->{"-join"}{"from"}
$aqt->{"-join"} not $aqt->{"-join"}{"from"}
Truth table66%2/3
A and not(B)
A= $aqt->{"-join"}B= not $aqt->{"-join"}{"from"}
ABresult
0X0
100
111
155 13 $aqt->{-join}{from} = pop @list;
156 }
157 50 push @list, $aqt;
158 }
159 35 ▶ return $list[0] if @list == 1;
Branch: 1 branch
BranchTrueFalseTotal
if @list == 1 34 1 35
160 1 return { -from_list => \@list };
161 }
162  
163 2 my %known_join_keys = map +($_ => 1), qw(from type to as on using);
164  
165 17 ▶sub _expand_join {
Subroutine _expand_join: called CC=9 SCAR=22.0
166 17 my ($self, undef, $args) = @_;
167 17 ▶ my %proto = (
Branch: 1 branch
BranchTrueFalseTotal
ref $args eq 'HASH' ? : 12 5 17
168 ref($args) eq 'HASH'
169 ? %$args
170 : (to => @$args)
171 );
172 # accept the dashed spellings (-as, -on, ...) as well, since a from_list
173 # is written with -as and -join; and refuse anything unknown instead of
174 # silently dropping it on render (RT#148271)
175 17 for my $k (keys %proto) {
176 52 (my $bare = $k) =~ s/^-//;
177 $self->sqla->puke("Unknown key '$k' in -join (known: from, type, to, as, on, using)")
178 52 ▶ unless $known_join_keys{$bare};
Branch: 1 branch
BranchTrueFalseTotal
unless $known_join_keys{$bare} 1 51 52
179 51 ▶ $proto{$bare} = delete $proto{$k} if $bare ne $k;
Branch: 1 branch
BranchTrueFalseTotal
if $bare ne $k 2 49 51
180 }
181 16 ▶ if (my $as = delete $proto{as}) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $as = delete $proto{"as"}) 12 4 16
182 $proto{to} = $self->expand_expr(
183 12 { -as => [ { -from_list => $proto{to} }, $as ] }
184 );
185 }
186 16 ▶ if (defined($proto{using}) and ref(my $using = $proto{using}) ne 'HASH') {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $proto{"using"} and ref(my $using = $proto{"using"}) ne "HASH") 1 15 16
Condition66%2/3
defined $proto{"using"} and ref(my $using = $proto{"using"}) ne "HASH"
!ll&&!rl&&r
1501
MC/DC50%1/2
defined $proto{"using"} and ref(my $using = $proto{"using"}) ne "HASH"
defined $proto{"using"} ref(my $using = $proto{"using"}) ne "HASH"
Truth table66%2/3
A and B
A= defined $proto{"using"}B= ref(my $using = $proto{"using"}) ne "HASH"
ABresult
0X0
100
111
187 $proto{using} = [
188 1 ▶ map [ $self->expand_expr($_, -ident) ],
Branch: 1 branch
BranchTrueFalseTotal
ref $using eq 'ARRAY' ? : 0 1 1
189 ref($using) eq 'ARRAY' ? @$using: $using
190 ];
191 }
192 my %ret = (
193 type => delete $proto{type},
194 16 to => $self->expand_expr({ -from_list => delete $proto{to} }, -ident)
195 );
196 %ret = (%ret,
197 16 map +($_ => $self->expand_expr($proto{$_}, -ident)),
198 sort keys %proto
199 );
200 16 return +{ -join => \%ret };
201 }
202  
203 8 ▶sub _render_from_list {
Subroutine _render_from_list: called CC=1 SCAR=0.0
204 8 my ($self, undef, $list) = @_;
205 8 return $self->join_query_parts(', ', @$list);
206 }
207  
208 13 ▶sub _render_join {
Subroutine _render_join: called CC=8 SCAR=21.4
209 13 my ($self, undef, $args) = @_;
210  
211 my @parts = (
212 $args->{from},
213 { -keyword => join '_', ($args->{type}||()), 'join' },
214 (map +($_->{-ident} || $_->{-as}
215 ? $_
216 : ('(', $self->render_aqt($_, 1), ')')),
217 13 ▶ map +(@{$_->{-from_list}||[]} == 1 ? $_->{-from_list}[0] : $_),
Branch: 2 branches
BranchTrueFalseTotal
$args->{'on'} ? : 12 1 13
$args->{'using'} ? : 1 12 13
Condition100%2/2
$_->{'-from_list'} || []
l!l
121
MC/DC100%1/1
$_->{'-from_list'} || []
$_->{'-from_list'}
Truth table100%2/2
A
A= $_->{'-from_list'}
Aresult
11
00
218 $args->{to}
219 ),
220 ($args->{on} ? (
221 { -keyword => 'on' },
222 $args->{on},
223 ) : ()),
224 ($args->{using} ? (
225 { -keyword => 'using' },
226 13 ▶ '(', $args->{using}, ')',
Branch: 2 branches
BranchTrueFalseTotal
$_->{'-ident'} || $_->{'-as'} ? : 13 0 13
@{$_->{'-from_list'} or [];} == 1 ? : 12 1 13
Condition50%3/6
$args->{'type'} || ()
l!l&&r!l&&!r
0130
$_->{"-ident"} or $_->{"-as"}
l!l&&r!l&&!r
1120
MC/DC0%0/2
$args->{'type'} || ()
$args->{'type'} ()
MC/DC0%0/2
$_->{"-ident"} or $_->{"-as"}
$_->{"-ident"} $_->{"-as"}
Truth table33%1/3
A || B
A= $args->{'type'}B= ()
ABresult
1X1
011
000
Truth table66%2/3
A or B
A= $_->{"-ident"}B= $_->{"-as"}
ABresult
1X1
011
000
227 ) : ()),
228 );
229 13 return $self->join_query_parts(' ', @parts);
230 }
231  
232 46 ▶sub _expand_op_as {
Subroutine _expand_op_as: called CC=4 SCAR=13.9
233 46 my ($self, undef, $vv, $k) = @_;
234 46 ▶ my @vv = (ref($vv) eq 'ARRAY' ? @$vv : $vv);
Branch: 1 branch
BranchTrueFalseTotal
ref $vv eq 'ARRAY' ? : 43 3 46
235 46 my $ik = $self->expand_expr($k, -ident);
236 46 ▶ return +{ -as => [ $ik, $self->expand_expr($vv[0], -ident) ] }
Branch: 1 branch
BranchTrueFalseTotal
if @vv == 1 and ref $vv[0] eq "HASH" 16 30 46
Condition100%3/3
@vv == 1 and ref $vv[0] eq "HASH"
!ll&&!rl&&r
22816
MC/DC100%2/2
@vv == 1 and ref $vv[0] eq "HASH"
@vv == 1 ref $vv[0] eq "HASH"
Truth table100%3/3
A and B
A= @vv == 1B= ref $vv[0] eq "HASH"
ABresult
0X0
100
111
237 if @vv == 1 and ref($vv[0]) eq 'HASH';
238  
239 30 my @as = map $self->expand_expr($_, -ident), @vv;
240 30 return { -as => [ $ik, $self->expand_expr({ -alias => \@as }) ] };
241 }
242  
243 30 ▶sub _render_as {
Subroutine _render_as: called CC=1 SCAR=0.0
244 30 my ($self, undef, $args) = @_;
245 30 my ($thing, $alias) = @$args;
246 30 return $self->join_query_parts(
247 ' ',
248 $thing,
249 { -keyword => 'as' },
250 $alias,
251 );
252 }
253  
254 3 ▶sub _render_alias {
Subroutine _render_alias: called CC=2 SCAR=7.1
255 3 my ($self, undef, $args) = @_;
256 3 my ($as, @cols) = @$args;
257 return (@cols
258 3 ▶ ? $self->join_query_parts('',
Branch: 1 branch
BranchTrueFalseTotal
@cols ? : 3 0 3
259 $as,
260 '(',
261 $self->join_query_parts(
262 ', ',
263 @cols
264 ),
265 ')',
266 )
267 : $self->render_aqt($as)
268 );
269 }
270  
271 5 ▶sub _expand_update_clause_target {
Subroutine _expand_update_clause_target: called CC=1 SCAR=0.0
272 5 my ($self, undef, $target) = @_;
273 5 +(target => $self->_expand_from_list(undef, $target));
274 }
275  
276 1 ▶sub _expand_cast {
Subroutine _expand_cast: called CC=2 SCAR=10.1
277 1 my ($self, undef, $thing) = @_;
278 1 ▶ return { -func => [ cast => $thing ] } if ref($thing) eq 'HASH';
Branch: 1 branch
BranchTrueFalseTotal
if ref $thing eq "HASH" 1 0 1
279 0 my ($cast, $to) = @{$thing};
280 0 +{ -func => [ cast => { -as => [
281 $self->expand_expr($cast),
282 $self->expand_expr($to, -ident),
283 ] } ] };
284 }
285  
286 37 ▶sub _expand_alias {
Subroutine _expand_alias: called CC=5 SCAR=16.1
287 37 my ($self, undef, $args) = @_;
288 37 ▶ if (ref($args) eq 'HASH' and my $alias = $args->{-alias}) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $args eq "HASH" and my $alias = $args->{"-alias"}) 1 36 37
Condition66%2/3
ref $args eq "HASH" and my $alias = $args->{"-alias"}
!ll&&!rl&&r
3601
MC/DC50%1/2
ref $args eq "HASH" and my $alias = $args->{"-alias"}
ref $args eq "HASH" my $alias = $args->{"-alias"}
Truth table66%2/3
A and B
A= ref $args eq "HASH"B= my $alias = $args->{"-alias"}
ABresult
0X0
100
111
289 1 $args = $alias;
290 }
291 my @parts = map $self->expand_expr($_, -ident),
292 37 ▶ ref($args) eq 'ARRAY' ? @{$args} : $args;
Branch: 1 branch
BranchTrueFalseTotal
ref $args eq 'ARRAY' ? : 32 5 37
293 37 ▶ return $parts[0] if @parts == 1;
Branch: 1 branch
BranchTrueFalseTotal
if @parts == 1 33 4 37
294 4 return { -alias => \@parts };
295 }
296  
297 5 ▶sub _expand_with {
Subroutine _expand_with: called CC=4 SCAR=13.9
298 5 my ($self, $name, $with) = @_;
299 5 my (undef, $type) = split '_', $name;
300 5 ▶ if (ref($with) eq 'HASH') {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $with eq "HASH") 1 4 5
301 return +{
302 %$with,
303 queries => [
304 map +[
305 $self->expand_expr({ -alias => $_->[0] }, -ident),
306 $self->expand_expr($_->[1]),
307 1 ], @{$with->{queries}}
308 ]
309 }
310 }
311 4 my @with = @$with;
312 4 my @exp;
313 4 ▶ while (my ($alias, $query) = splice @with, 0, 2) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = splice(@with, 0, 2)) 6 4 10
314 6 push @exp, [
315 $self->expand_expr({ -alias => $alias }, -ident),
316 $self->expand_expr($query)
317 ];
318 }
319 4 ▶ return +(with => { ($type ? (type => $type) : ()), queries => \@exp });
Branch: 1 branch
BranchTrueFalseTotal
$type ? : 1 3 4
320 }
321  
322 4 ▶sub _render_with {
Subroutine _render_with: called CC=2 SCAR=6.9
323 4 my ($self, undef, $with) = @_;
324 my $q_part = $self->join_query_parts(', ',
325 map {
326 6 my ($alias, $query) = @$_;
327 6 $self->join_query_parts(' ',
328 $alias,
329 { -keyword => 'as' },
330 $query,
331 )
332 4 } @{$with->{queries}}
333 );
334 return $self->join_query_parts(' ',
335 4 ▶ { -keyword => join '_', 'with', ($with->{type}||'') },
Condition100%2/2
$with->{'type'} || ''
l!l
13
MC/DC100%1/1
$with->{'type'} || ''
$with->{'type'}
Truth table100%2/2
A
A= $with->{'type'}
Aresult
11
00
336 $q_part,
337 );
338 }
339  
340 4 ▶sub _expand_setop {
Subroutine _expand_setop: called CC=3 SCAR=11.4
341 4 my ($self, $setop, $args) = @_;
342 4 my $is_all = $setop =~ s/_all$//;
343 +{ "-${setop}" => {
344 ($is_all ? (type => 'all') : ()),
345 (ref($args) eq 'ARRAY'
346 ? (queries => [ map $self->expand_expr($_), @$args ])
347 : (
348 %$args,
349 4 ▶ queries => [ map $self->expand_expr($_), @{$args->{queries}} ]
Branch: 2 branches
BranchTrueFalseTotal
$is_all ? : 0 4 4
ref $args eq 'ARRAY' ? : 0 4 4
350 )
351 ),
352 } };
353 }
354  
355 3 ▶sub _render_setop {
Subroutine _render_setop: called CC=2 SCAR=7.0
356 3 my ($self, $setop, $args) = @_;
357 $self->join_query_parts(
358 { -keyword => ' '.join('_', $setop, ($args->{type}||())).' ' },
359 3 ▶ @{$args->{queries}}
Condition66%2/3
$args->{'type'} || ()
l!l&&r!l&&!r
120
MC/DC0%0/2
$args->{'type'} || ()
$args->{'type'} ()
Truth table66%2/3
A || B
A= $args->{'type'}B= ()
ABresult
1X1
011
000
360 );
361 }
362  
363 3 ▶sub _expand_clause_setop {
Subroutine _expand_clause_setop: called CC=3 SCAR=11.1
364 3 my ($self, $setop, $args) = @_;
365 3 my ($op, $type) = split '_', $setop;
366 3 ▶ +(setop => $self->expand_expr({
Branch: 2 branches
BranchTrueFalseTotal
$type ? : 1 2 3
ref $args eq 'ARRAY' ? : 0 3 3
367 "-${op}" => {
368 ($type ? (type => $type) : ()),
369 queries => (ref($args) eq 'ARRAY' ? $args : [ $args ])
370 }
371 }));
372 }
373  
374 2 1;
375  
376 __END__
« DBIx/Class/Storage/Debug/PrettyPrint.pm ↑ Summary SQL/Abstract/Role/Plugin.pm »