X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSQL%2FAbstract%2FReference.pm;fp=lib%2FSQL%2FAbstract%2FReference.pm;h=343f60a93824b4db4f9f33a6e9dd0d5007fac778;hb=9b49ddc3237d4efe1948503b1a90b869a0c51d4a;hp=e1ed68a696791737d700d2a757ca629c1b720c8b;hpb=28605008bc0a369d4da57ef504679e52a50953a9;p=scpubgit%2FQ-Branch.git diff --git a/lib/SQL/Abstract/Reference.pm b/lib/SQL/Abstract/Reference.pm index e1ed68a..343f60a 100644 --- a/lib/SQL/Abstract/Reference.pm +++ b/lib/SQL/Abstract/Reference.pm @@ -854,4 +854,33 @@ A non-trivial LHS is expanded with ident as the default rather than value: (x, y) IN ( (?, ?), (?, ?) ) [ 1, 2, 3, 4 ] +=head2 and/or ops + +expands the same way as a plain arrayref/hashref expression but with the +logic type set to the op name. + +=head2 is op + +Expands is and is_not to null checks, RHS value must be undef: + + # expr + { -is => [ 'foo', undef ] } + + # aqt + { -op => [ 'is_null', { -ident => [ 'foo' ] } ] } + + # query + foo IS NULL + [] + + # expr + { bar => { -is_not => undef } } + + # aqt + { -op => [ 'is_not_null', { -ident => [ 'bar' ] } ] } + + # query + bar IS NOT NULL + [] + =cut