Commit | Line | Data |
---|---|---|
cd979d19 | 1 | #!/usr/bin/env perl |
2 | ||
514d92f1 | 3 | use lib 'lib'; |
c95da5ee | 4 | use strictures 2; |
e2fe5d95 | 5 | use SQL::Abstract; |
3be8bc78 | 6 | use SQL::Abstract::ExtraClauses; |
e2fe5d95 | 7 | use Devel::DDCWarn; |
3be8bc78 | 8 | |
e2fe5d95 | 9 | warn $ARGV[1]."\n"; |
3be8bc78 | 10 | |
e2fe5d95 | 11 | my $sqlac = SQL::Abstract->new( |
b3b54441 | 12 | unknown_unop_always_func => 1, |
13 | lazy_join_sql_parts => 1, | |
14 | ); | |
3be8bc78 | 15 | |
e2fe5d95 | 16 | SQL::Abstract::ExtraClauses->apply_to($sqlac); |
17 | ||
c95da5ee | 18 | my @args = ($ARGV[1] =~ /^\.\// ? do $ARGV[1] : eval '+('.$ARGV[1].')'); |
3be8bc78 | 19 | |
c95da5ee | 20 | die $@ if $@; |
3be8bc78 | 21 | |
b3b54441 | 22 | my ($q, @bind) = $sqlac->${\$ARGV[0]}(@args); |
23 | ||
e2fe5d95 | 24 | print STDERR +(ref($q) ? $q->format : $q)."\n"; |
07070f1a | 25 | Dwarn [ @bind ]; |