From: Matt S Trout Date: Sun, 31 Jul 2011 01:20:46 +0000 (+0000) Subject: add multipart literal support X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5edb4362494344d3e1d592aa7cc6f654d1cf7d1f;p=dbsrgits%2FData-Query.git add multipart literal support --- diff --git a/lib/Data/Query/Renderer/SQL/Naive.pm b/lib/Data/Query/Renderer/SQL/Naive.pm index 9f18068..ee13cc4 100644 --- a/lib/Data/Query/Renderer/SQL/Naive.pm +++ b/lib/Data/Query/Renderer/SQL/Naive.pm @@ -302,9 +302,15 @@ sub _render_literal { unless ($dq->{subtype} eq 'SQL') { die "Can't render non-SQL literal"; } - return [ - $dq->{literal}, @{$dq->{values}||[]} - ]; + if ($dq->{literal}) { + return [ + $dq->{literal}, @{$dq->{values}||[]} + ]; + } elsif ($dq->{parts}) { + return [ map $self->_render($_), @{$dq->{parts}} ]; + } else { + die "Invalid SQL literal - neither 'literal' nor 'parts' found"; + } } sub _render_join {