From: Laurent Dami Date: Wed, 1 Apr 2009 09:06:17 +0000 (+0000) Subject: corrections/additions in POD, after remarks from ribasushi X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6e0c655267da36dc4db61dde8788a8b65a671631;p=scpubgit%2FQ-Branch.git corrections/additions in POD, after remarks from ribasushi --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 93e0393..e0f1cad 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -1320,7 +1320,9 @@ the huge section on L at the bottom. =item sqltrue, sqlfalse Expressions for inserting boolean values within SQL statements. -By default these are C<1=1> and C<1=0>. +By default these are C<1=1> and C<1=0>. They are used +by the special operators C<-in> and C<-not_in> for generating +correct SQL even when the argument is an empty array (see below). =item logic @@ -1639,7 +1641,7 @@ This simple code will create the following: A field associated to an empty arrayref will be considered a logical false and will generate 0=1. -=head2 Key-value pairs +=head2 Specific comparison operators If you want to specify a different type of operator for your comparison, you can use a hashref for a given column: @@ -1766,6 +1768,12 @@ Which would generate: The reverse operator C<-not_in> generates SQL C and is used in the same way. +If the argument to C<-in> is an empty array, 'sqlfalse' is generated +(by default : C<1=0>). Similarly, C<< -not_in => [] >> generates +'sqltrue' (by default : C<1=1>). + + + Another pair of operators is C<-between> and C<-not_between>, used with an arrayref of two values: