[Bast-commits] r5204 - in SQL-Abstract/1.x/branches/1.50_RC: . lib/SQL

norbi at dev.catalyst.perl.org norbi at dev.catalyst.perl.org
Wed Nov 26 19:18:57 GMT 2008


Author: norbi
Date: 2008-11-26 19:18:57 +0000 (Wed, 26 Nov 2008)
New Revision: 5204

Modified:
   SQL-Abstract/1.x/branches/1.50_RC/
   SQL-Abstract/1.x/branches/1.50_RC/lib/SQL/Abstract.pm
Log:
 r5257 at vger:  mendel | 2008-11-26 20:18:56 +0100
  * Documented { op => \'...' } and { op => \['...', @bind] } syntaxes.



Property changes on: SQL-Abstract/1.x/branches/1.50_RC
___________________________________________________________________
Name: svk:merge
   - 4d5fae46-8e6a-4e08-abee-817e9fb894a2:/local/bast/SQL-Abstract/1.x/branches/1.50_RC:5255
   + 4d5fae46-8e6a-4e08-abee-817e9fb894a2:/local/bast/SQL-Abstract/1.x/branches/1.50_RC:5257

Modified: SQL-Abstract/1.x/branches/1.50_RC/lib/SQL/Abstract.pm
===================================================================
--- SQL-Abstract/1.x/branches/1.50_RC/lib/SQL/Abstract.pm	2008-11-26 18:58:34 UTC (rev 5203)
+++ SQL-Abstract/1.x/branches/1.50_RC/lib/SQL/Abstract.pm	2008-11-26 19:18:57 UTC (rev 5204)
@@ -1615,7 +1615,20 @@
     $stmt = "WHERE user = ? AND priority = ? OR priority != ?";
     @bind = ('nwiger', '2', '1');
 
+If you want to include literal SQL (with or without bind values), just use a
+scalar reference or array reference as the value:
 
+    my %where  = (
+        date_entered => { '>' => \["to_date(?, 'MM/DD/YYYY')", "11/26/2008"] },
+        date_expires => { '<' => \"now()" }
+    );
+
+Which would generate:
+
+    $stmt = "WHERE date_entered > "to_date(?, 'MM/DD/YYYY') AND date_expires < now()";
+    @bind = ('11/26/2008');
+
+
 =head2 Logic and nesting operators
 
 In the example above,




More information about the Bast-commits mailing list