From: Matt S Trout Date: Sat, 28 Sep 2019 17:10:27 +0000 (+0000) Subject: fixup sqlacexpr X-Git-Tag: v2.000000~3^2~102 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=681d9d7741c4d91e168ce3f5dffa64a6d84d1008;p=dbsrgits%2FSQL-Abstract.git fixup sqlacexpr --- diff --git a/maint/sqlacexpr b/maint/sqlacexpr index e9d9550..e10d98d 100755 --- a/maint/sqlacexpr +++ b/maint/sqlacexpr @@ -2,21 +2,24 @@ use lib 'lib'; use strictures 2; +use SQL::Abstract; use SQL::Abstract::ExtraClauses; -#use Devel::DDCWarn; +use Devel::DDCWarn; -warn $ARGV[1]; +warn $ARGV[1]."\n"; -my $sqlac = SQL::Abstract::ExtraClauses->new( +my $sqlac = SQL::Abstract->new( unknown_unop_always_func => 1, lazy_join_sql_parts => 1, ); +SQL::Abstract::ExtraClauses->apply_to($sqlac); + my @args = ($ARGV[1] =~ /^\.\// ? do $ARGV[1] : eval '+('.$ARGV[1].')'); die $@ if $@; my ($q, @bind) = $sqlac->${\$ARGV[0]}(@args); -print STDERR $q->format."\n"; +print STDERR +(ref($q) ? $q->format : $q)."\n"; Dwarn [ @bind ];