File Coverage

blib/lib/DBIx/Class/SQLMaker/ACCESS.pm
Criterion Covered Total %
statement 18 18 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 24 24 100.0


line stmt bran cond sub pod time code
1             package # Hide from PAUSE
2             DBIx::Class::SQLMaker::ACCESS;
3              
4 3     3   2431 use strict;
  3         5  
  3         104  
5 3     3   17 use warnings;
  3         5  
  3         113  
6 3     3   15 use base 'DBIx::Class::SQLMaker';
  3         4  
  3         907  
7              
8             # inner joins must be prefixed with 'INNER '
9             sub new {
10 1     1 1 2 my $class = shift;
11 1         8 my $self = $class->next::method(@_);
12              
13 1         87 $self->{_default_jointype} = 'INNER';
14              
15 1         6 return $self;
16             }
17              
18             # MSAccess is retarded wrt multiple joins in FROM - it requires a certain
19             # way of parenthesizing each left part before each next right part
20             sub _recurse_from {
21 6     6   22 my @j = shift->_gen_from_blocks(@_);
22              
23             # first 2 steps need no parenthesis
24 6         19 my $fin_join = join (' ', splice @j, 0, 2);
25              
26 6         18 while (@j) {
27 5         23 $fin_join = sprintf '( %s ) %s', $fin_join, (shift @j);
28             }
29              
30             # the entire FROM is *ALSO* expected parenthesized
31 6         28 "( $fin_join )";
32             }
33              
34             1;