Skip Menu |

This queue is for tickets about the SQL-Abstract CPAN distribution.

Report information
The Basics
Id: 127116
Status: new
Priority: 0/
Queue: SQL-Abstract

People
Owner: Nobody in particular
Requestors: KES [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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' )
Second slash **will** disable special meaning (just like \ in strings: "\\n" mean '\n'
V. Provide the example how to use implemented operator https://metacpan.org/pod/SQL::Abstract#SPECIAL-OPERATORS Would more clean if after operator implementation exists the example how to use it: field => { match => [ 'word1', 'word2', 'word3' ] } For unary operator same.