Subject: | Remove deprecated literal SQL usage from examples |
the usage
requestor => \'= submitter'
is listed as deprecated: https://metacpan.org/pod/SQL::Abstract#Deprecated-usage-of-Literal-SQL
But this syntax is used in the example:
$sql->select("t1", "*", {c1 => 1, c2 => \"> t0.c0"});
As this usage is deprecated I suggest to rewrite the example as next:
$sql->select("t1", "*", {c1 => 1, c2 => { '>' => { -ident => 't0.c0' } }});
II. Another example which suggest to use deprecated syntax:
date_column => \[ "= date '2008-09-30' - ?::integer", 10 ]
Is it deprecated or not? Would it be more correct to write it as:
date_column => { '=' => \[ "date '2008-09-30' - ?::integer", 10 ] }
III. Also, to my mind, next example will be more clean if wrote:
my %where = (
foo => 1234,
bar => \["IN ($sub_stmt)" => @sub_bind],
);
as next:
my %where = (
foo => 1234,
bar => { -in => \[ $sub_stmt, @sub_bind ] },
);
[prof](https://metacpan.org/pod/SQL::Abstract#Special-operators:-IN,-BETWEEN,-etc.)
IV. Proposition to simplify -ident/-value
Instead of:
requestor => { -ident => 'submitter' }
we can write:
requestor => \\'submitter'
Instead of:
array => { -value => [1, 2, 3] }
we can write:
array => \\[1, 2, 3]
Both seems intuitive and meaningful.
First slash in SQL::Abstract means: dude, this is a something special
Second slash disables special meaning (just like \ in strings: "\\n" mean '\n' )