Author: spadkins
Date: Mon Jul  7 11:50:10 2008
New Revision: 11498

Modified:
   p5ee/trunk/App-Repository/bin/dbget

Log:
add distinct option

Modified: p5ee/trunk/App-Repository/bin/dbget
==============================================================================
--- p5ee/trunk/App-Repository/bin/dbget (original)
+++ p5ee/trunk/App-Repository/bin/dbget Mon Jul  7 11:50:10 2008
@@ -4,7 +4,7 @@
 
 use App::Options (
     options => [ qw(dbhost dbname dbuser dbpass repository table params 
columns headings compact decimals subtotal_columns totals
-                    cache_skip cache_refresh verbose) ],
+                    distinct cache_skip cache_refresh verbose) ],
     option => {
         repository => {
             default => "default",
@@ -42,6 +42,9 @@
         cache_refresh => {
             description => "Skip any cached values for the table but save the 
results in the cache",
         },
+        distinct => {
+            description => "Select only distinct rows",
+        },
         hashkey => {
             description => "hash key to get params from the cache",
         },
@@ -104,6 +107,7 @@
         $headings = $App::options{headings} ? [ split(/,/, 
$App::options{headings}) ] : [];
         $get_options = { extend_columns => 1 };
     }
+    $get_options->{distinct} = 1 if ($App::options{distinct});
     $get_options->{cache_skip} = 1 if ($App::options{cache_skip});
     $get_options->{cache_refresh} = 1 if ($App::options{cache_refresh});
     my $rows     = $db->get_rows($table, $params, $columns, $get_options);

Reply via email to