From: Matt S Trout Date: Sun, 6 Oct 2013 22:19:05 +0000 (+0000) Subject: start of limit dialect map X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1a2f6adfec1f6075ae9e566391f95f29e47b7021;p=dbsrgits%2FDBIx-Class-Historic.git start of limit dialect map --- diff --git a/lib/DBIx/Class/SQLMaker.pm b/lib/DBIx/Class/SQLMaker.pm index 876d3eb..cb0439e 100644 --- a/lib/DBIx/Class/SQLMaker.pm +++ b/lib/DBIx/Class/SQLMaker.pm @@ -53,11 +53,21 @@ has limit_dialect => ( trigger => sub { shift->clear_renderer_class } ); +our %LIMIT_DIALECT_MAP = ( + 'GenericSubQ' => 'GenericSubquery' +); + +sub mapped_limit_dialect { + my ($self) = @_; + my $unmapped = $self->limit_dialect; + $LIMIT_DIALECT_MAP{$unmapped}||$unmapped; +} + around _build_renderer_roles => sub { my ($orig, $self) = (shift, shift); return ( $self->$orig(@_), - 'Data::Query::Renderer::SQL::Slice::'.$self->limit_dialect + 'Data::Query::Renderer::SQL::Slice::'.$self->mapped_limit_dialect ); };