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