[Rt-commit] r2873 - DBIx-SearchBuilder/trunk
jesse at bestpractical.com
jesse at bestpractical.com
Wed May 11 20:10:02 EDT 2005
Author: jesse
Date: Wed May 11 20:10:02 2005
New Revision: 2873
Modified:
DBIx-SearchBuilder/trunk/ (props changed)
DBIx-SearchBuilder/trunk/Changes
DBIx-SearchBuilder/trunk/META.yml
DBIx-SearchBuilder/trunk/SearchBuilder.pm
Log:
r16153 at hualien: jesse | 2005-05-09 03:24:30 +0100
* group by functions improvements
Modified: DBIx-SearchBuilder/trunk/Changes
==============================================================================
--- DBIx-SearchBuilder/trunk/Changes (original)
+++ DBIx-SearchBuilder/trunk/Changes Wed May 11 20:10:02 2005
@@ -1,5 +1,11 @@
Revision history for Perl extension DBIx::SearchBuilder.
+1.27
+
+ - Added supoprt for functions containing "?" to represent the parameter in ->Column()
+ - Added better support for functional columns in search listings and
+ group by clauses
+
1.26 Sun Apr 17 19:22:23 EDT 2005
- Added support for expression based left joins
Modified: DBIx-SearchBuilder/trunk/META.yml
==============================================================================
--- DBIx-SearchBuilder/trunk/META.yml (original)
+++ DBIx-SearchBuilder/trunk/META.yml Wed May 11 20:10:02 2005
@@ -1,5 +1,5 @@
name: DBIx-SearchBuilder
-version: 1.25
+version: 1.26
license: perl
distribution_type: module
build_requires:
Modified: DBIx-SearchBuilder/trunk/SearchBuilder.pm
==============================================================================
--- DBIx-SearchBuilder/trunk/SearchBuilder.pm (original)
+++ DBIx-SearchBuilder/trunk/SearchBuilder.pm Wed May 11 20:10:02 2005
@@ -1084,8 +1084,12 @@
FIELD => undef,
%$row
);
+ if ($rowhash{'FUNCTION'} ) {
+ $clause .= ($clause ? ", " : " ");
+ $clause .= $rowhash{'FUNCTION'};
- if ( ($rowhash{'ALIAS'}) and
+ }
+ elsif ( ($rowhash{'ALIAS'}) and
($rowhash{'FIELD'}) ) {
$clause .= ($clause ? ", " : " ");
@@ -1498,9 +1502,17 @@
if ( $func =~ /^DISTINCT\s*COUNT$/i ) {
$name = "COUNT(DISTINCT $name)";
}
- else {
+ # If we want to substitute
+ elsif ($func =~ /\?/) {
+ $name = join($name,split(/\?/,$func));
+ }
+ # If we want to call a simple function on the column
+ elsif ($func !~ /\(/) {
$name = "\U$func\E($name)";
+ } else {
+ $name = $func;
}
+
}
my $column = "col" . @{ $self->{columns} ||= [] };
More information about the Rt-commit
mailing list