File: sqlacexpr

package info (click to toggle)
libsql-abstract-perl 2.000001-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 744 kB
  • sloc: perl: 3,443; makefile: 8
file content (22 lines) | stat: -rwxr-xr-x 438 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env perl

use lib 'lib';
use strictures 2;
use SQL::Abstract;
use Devel::DDCWarn;

warn $ARGV[1]."\n";

my $sqlac = SQL::Abstract->new(
  unknown_unop_always_func => 1,
  lazy_join_sql_parts => 1,
)->plugin('+ExtraClauses');

my @args = ($ARGV[1] =~ /^\.\// ? do $ARGV[1] : eval '+('.$ARGV[1].')');

die $@ if $@;

my ($q, @bind) = $sqlac->${\$ARGV[0]}(@args);

print STDERR +(ref($q) ? $q->format : $q)."\n";
Dwarn [ @bind ];