From: Alexander Hartmaier Date: Tue, 16 Apr 2013 18:02:39 +0000 (+0200) Subject: Clarify how to use SQL functions as part of a larger search X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d05ca4691cacad276c21edc1e40f1375aefe2568;p=dbsrgits%2FDBIx-Class-Historic.git Clarify how to use SQL functions as part of a larger search --- diff --git a/lib/DBIx/Class/Manual/Cookbook.pod b/lib/DBIx/Class/Manual/Cookbook.pod index 8648b7c..588c315 100644 --- a/lib/DBIx/Class/Manual/Cookbook.pod +++ b/lib/DBIx/Class/Manual/Cookbook.pod @@ -428,6 +428,9 @@ literal SQL: # Equivalent SQL: # SELECT * FROM employee WHERE YEAR(date_of_birth) = ? +To include the function as part of a larger search, use the '-and' keyword +to collect the search conditions: + $rs->search({ -and => [ name => 'Bob', \[ 'YEAR(date_of_birth) = ?', 1979 ]