X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSQL%2FAbstract%2FReference.pm;h=b030f39b9d387811c4f0cb26c5d6830997c84501;hb=3c700ca3444b64dccee80083cb0970d63eb7d338;hp=67567ccf178971f5eab3c9b4da20ca20930f0ade;hpb=cc230faadb608351c7b6149b2b906687f8c23687;p=scpubgit%2FQ-Branch.git diff --git a/lib/SQL/Abstract/Reference.pm b/lib/SQL/Abstract/Reference.pm index 67567cc..b030f39 100644 --- a/lib/SQL/Abstract/Reference.pm +++ b/lib/SQL/Abstract/Reference.pm @@ -670,4 +670,46 @@ Expands the elements of the value arrayref: (?, foo, ?, ?) [ 1, 2, 3 ] +=head2 op + +If an expander is registered for the op name, delegates to the expander; if +not, expands the argument values: + + # expr + { -op => [ 'ident', 'foo.bar' ] } + + # aqt + { -ident => [ 'foo', 'bar' ] } + + # query + foo.bar + [] + + # expr + { -op => [ '=', { -ident => 'foo' }, 3 ] } + + # aqt + { -op => [ '=', { -ident => [ 'foo' ] }, { -bind => [ undef, 3 ] } ] } + + # query + foo = ? + [ 3 ] + +=head2 func + +Expands the argument values: + + # expr + { -func => [ 'coalesce', { -ident => 'thing' }, 'fallback' ] } + + # aqt + { -func => [ + 'coalesce', { -ident => [ 'thing' ] }, + { -bind => [ undef, 'fallback' ] }, + ] } + + # query + COALESCE(thing, ?) + [ 'fallback' ] + =cut