Commit | Line | Data |
87aa29e2 |
1 | package # Hide from PAUSE |
d5dedbd6 |
2 | DBIx::Class::SQLMaker::MySQL; |
87aa29e2 |
3 | |
d5dedbd6 |
4 | use base qw( DBIx::Class::SQLMaker ); |
87aa29e2 |
5 | |
10cef607 |
6 | sub _build_base_renderer_class { |
7 | Module::Runtime::use_module('Data::Query::Renderer::SQL::MySQL'); |
87aa29e2 |
8 | } |
9 | |
b8391c87 |
10 | # Allow STRAIGHT_JOIN's |
11 | sub _generate_join_clause { |
12 | my ($self, $join_type) = @_; |
13 | |
14 | if( $join_type && $join_type =~ /^STRAIGHT\z/i ) { |
15 | return ' STRAIGHT_JOIN ' |
16 | } |
17 | |
70551c3d |
18 | return $self->next::method($join_type); |
b8391c87 |
19 | } |
4e0a89e4 |
20 | |
21 | # LOCK IN SHARE MODE |
22 | my $for_syntax = { |
23 | update => 'FOR UPDATE', |
24 | shared => 'LOCK IN SHARE MODE' |
25 | }; |
26 | |
27 | sub _lock_select { |
28 | my ($self, $type) = @_; |
29 | |
70c28808 |
30 | my $sql = $for_syntax->{$type} |
31 | || $self->throw_exception("Unknown SELECT .. FOR type '$type' requested"); |
4e0a89e4 |
32 | |
33 | return " $sql"; |
34 | } |
35 | |
87aa29e2 |
36 | 1; |