Commit | Line | Data |
726c8f65 |
1 | package # Hide from PAUSE |
2 | DBIx::Class::SQLMaker::ACCESS; |
3 | |
4 | use strict; |
5 | use warnings; |
6 | use base 'DBIx::Class::SQLMaker'; |
7 | |
696ba760 |
8 | # inner joins must be prefixed with 'INNER ' |
9 | sub new { |
10 | my $class = shift; |
11 | my $self = $class->next::method(@_); |
12 | |
13 | $self->{_default_jointype} = 'INNER'; |
14 | |
15 | return $self; |
16 | } |
17 | |
726c8f65 |
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 | my @j = shift->_gen_from_blocks(@_); |
22 | |
23 | # first 2 steps need no parenthesis |
24 | my $fin_join = join (' ', splice @j, 0, 2); |
25 | |
26 | while (@j) { |
27 | $fin_join = sprintf '( %s ) %s', $fin_join, (shift @j); |
28 | } |
29 | |
4a0eed52 |
30 | # the entire FROM is *ALSO* expected parenthesized |
726c8f65 |
31 | "( $fin_join )"; |
32 | } |
33 | |
34 | 1; |