From: Matt S Trout Date: Mon, 16 Apr 2012 13:46:10 +0000 (+0000) Subject: more tweaks X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=62d1776437a2f4e2145589b442514b6a4ec24f1f;p=dbsrgits%2FSQL-Abstract.git more tweaks --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index a8e4a57..b941f3c 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -75,6 +75,11 @@ has quote_char => ( }, ); +has collapse_aliases => ( + is => 'ro', + default => sub { 0 } +); + has always_quote => ( is => 'rw', default => sub { 1 }, trigger => sub { @@ -135,6 +140,7 @@ sub _renderer_args { +{ quote_chars => $chars, always_quote => $self->always_quote, identifier_sep => $self->name_sep, + collapse_aliases => $self->collapse_aliases, ($self->case ? (lc_keywords => 1) : ()), # always 'lower' if it exists }; } diff --git a/lib/SQL/Abstract/Converter.pm b/lib/SQL/Abstract/Converter.pm index b7380dd..1cac53a 100644 --- a/lib/SQL/Abstract/Converter.pm +++ b/lib/SQL/Abstract/Converter.pm @@ -295,6 +295,8 @@ sub _expr_to_dq { or (ref($where) eq 'REF' and ref($$where) eq 'ARRAY') ) { return $self->_literal_to_dq($$where); + } elsif (ref($where) eq 'REF' and ref($$where) eq 'HASH') { + return $$where; } elsif (!ref($where) or Scalar::Util::blessed($where)) { return $self->_value_to_dq($where); }