r25713 - in /branches/upstream/librose-db-perl/current: Changes META.yml lib/Rose/DB.pm lib/Rose/DB/Cache.pm lib/Rose/DB/Informix.pm lib/Rose/DB/MySQL.pm lib/Rose/DB/Oracle.pm lib/Rose/DB/SQLite.pm t/db_cache.t

eloy at users.alioth.debian.org eloy at users.alioth.debian.org
Wed Oct 1 12:54:02 UTC 2008


Author: eloy
Date: Wed Oct  1 12:53:53 2008
New Revision: 25713

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=25713
Log:
[svn-upgrade] Integrating new upstream version, librose-db-perl (0.745)

Modified:
    branches/upstream/librose-db-perl/current/Changes
    branches/upstream/librose-db-perl/current/META.yml
    branches/upstream/librose-db-perl/current/lib/Rose/DB.pm
    branches/upstream/librose-db-perl/current/lib/Rose/DB/Cache.pm
    branches/upstream/librose-db-perl/current/lib/Rose/DB/Informix.pm
    branches/upstream/librose-db-perl/current/lib/Rose/DB/MySQL.pm
    branches/upstream/librose-db-perl/current/lib/Rose/DB/Oracle.pm
    branches/upstream/librose-db-perl/current/lib/Rose/DB/SQLite.pm
    branches/upstream/librose-db-perl/current/t/db_cache.t

Modified: branches/upstream/librose-db-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/librose-db-perl/current/Changes?rev=25713&op=diff
==============================================================================
--- branches/upstream/librose-db-perl/current/Changes (original)
+++ branches/upstream/librose-db-perl/current/Changes Wed Oct  1 12:53:53 2008
@@ -1,3 +1,8 @@
+0.745 (09.12.2008) - John Siracusa <siracusa at gmail.com>
+
+    * Added support for Oracle date/time column keywords.
+    * Added methods to list cached db entries and keys.
+
 0.744 (05.28.2008) - John Siracusa <siracusa at gmail.com>
 
     * Added fixup() class method call to auto_load_fixups().

Modified: branches/upstream/librose-db-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/librose-db-perl/current/META.yml?rev=25713&op=diff
==============================================================================
--- branches/upstream/librose-db-perl/current/META.yml (original)
+++ branches/upstream/librose-db-perl/current/META.yml Wed Oct  1 12:53:53 2008
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:                Rose-DB
-version:             0.744
+version:             0.745
 abstract:            ~
 license:             ~
 author:              ~

Modified: branches/upstream/librose-db-perl/current/lib/Rose/DB.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/librose-db-perl/current/lib/Rose/DB.pm?rev=25713&op=diff
==============================================================================
--- branches/upstream/librose-db-perl/current/lib/Rose/DB.pm (original)
+++ branches/upstream/librose-db-perl/current/lib/Rose/DB.pm Wed Oct  1 12:53:53 2008
@@ -20,7 +20,7 @@
 
 our $Error;
 
-our $VERSION = '0.744';
+our $VERSION = '0.745';
 
 our $Debug = 0;
 
@@ -1055,7 +1055,8 @@
 
     if($@)
     {
-      $self->error('commit() - ' . $dbh->errstr);
+      no warnings 'uninitialized';
+      $self->error("commit() $@ - " . $dbh->errstr);
       return undef;
     }
 
@@ -1587,8 +1588,6 @@
 }
 
 sub select_bitfield_column_sql { shift->auto_quote_column_with_table(@_) }
-
-sub should_inline_bitfield_values { 0 }
 
 sub parse_array
 {
@@ -1936,17 +1935,42 @@
 
 sub build_dsn { 'override in subclass' }
 
+sub validate_integer_keyword          { 0 }
+sub validate_float_keyword            { 0 }
+sub validate_numeric_keyword          { 0 }
+sub validate_decimal_keyword          { 0 }
+sub validate_double_precision_keyword { 0 }
+sub validate_bigint_keyword           { 0 }
+sub validate_date_keyword             { 0 }
+sub validate_datetime_keyword         { 0 }
+sub validate_time_keyword             { 0 }
+sub validate_timestamp_keyword        { 0 }
+sub validate_interval_keyword         { 0 }
+sub validate_set_keyword              { 0 }
+sub validate_array_keyword            { 0 }
+sub validate_bitfield_keyword         { 0 }
+
 sub validate_boolean_keyword
 {
   no warnings;
   $_[1] =~ /^(?:TRUE|FALSE)$/;
 }
 
-sub validate_date_keyword      { 0 }
-sub validate_datetime_keyword  { 0 }
-sub validate_time_keyword      { 0 }
-sub validate_timestamp_keyword { 0 }
-sub validate_interval_keyword  { 0 }
+sub should_inline_integer_keywords          { 0 }
+sub should_inline_float_keywords            { 0 }
+sub should_inline_decimal_keywords          { 0 }
+sub should_inline_numeric_keywords          { 0 }
+sub should_inline_double_precision_keywords { 0 }
+sub should_inline_bigint_keywords           { 0 }
+sub should_inline_date_keywords             { 0 }
+sub should_inline_datetime_keywords         { 0 }
+sub should_inline_time_keywords             { 0 }
+sub should_inline_timestamp_keywords        { 0 }
+sub should_inline_interval_keywords         { 0 }
+sub should_inline_set_keywords              { 0 }
+sub should_inline_array_keywords            { 0 }
+sub should_inline_boolean_keywords          { 0 }
+sub should_inline_bitfield_values           { 0 }
 
 sub next_value_in_sequence
 {

Modified: branches/upstream/librose-db-perl/current/lib/Rose/DB/Cache.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/librose-db-perl/current/lib/Rose/DB/Cache.pm?rev=25713&op=diff
==============================================================================
--- branches/upstream/librose-db-perl/current/lib/Rose/DB/Cache.pm (original)
+++ branches/upstream/librose-db-perl/current/lib/Rose/DB/Cache.pm Wed Oct  1 12:53:53 2008
@@ -7,7 +7,7 @@
 use Scalar::Util qw(refaddr);
 use Rose::DB::Cache::Entry;
 
-our $VERSION = '0.739';
+our $VERSION = '0.745';
 
 our $Debug = 0;
 
@@ -87,6 +87,13 @@
   my($self) = shift;
   return wantarray ? values %{$self->{'cache'} || {}} : 
                      [ values %{$self->{'cache'} || {}} ];
+}
+
+sub db_cache_keys
+{
+  my($self) = shift;
+  return wantarray ? keys %{$self->{'cache'} || {}} : 
+                     [ keys %{$self->{'cache'} || {}} ];
 }
 
 sub get_db
@@ -314,6 +321,14 @@
 
 Clear the cache entirely.
 
+=item B<db_cache_entries>
+
+Returns a list (in list context) or reference to an array (in scalar context) of L<cache entries|Rose::DB::Cache::Entry> for each cached db object.
+
+=item B<db_cache_keys>
+
+Returns a list (in list context) or reference to an array (in scalar context) of L<keys|Rose::DB::Cache::Entry/key> for each L <cache entries|Rose::DB::Cache::Entry>.
+
 =item B<get_db [PARAMS]>
 
 Return the cached L<Rose::DB>-derived object corresponding to the name/value pairs passed in PARAMS.  PARAMS are passed to the L<build_cache_key|/build_cache_key> method, and the key returned is used to look up the cached object.

Modified: branches/upstream/librose-db-perl/current/lib/Rose/DB/Informix.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/librose-db-perl/current/lib/Rose/DB/Informix.pm?rev=25713&op=diff
==============================================================================
--- branches/upstream/librose-db-perl/current/lib/Rose/DB/Informix.pm (original)
+++ branches/upstream/librose-db-perl/current/lib/Rose/DB/Informix.pm Wed Oct  1 12:53:53 2008
@@ -370,6 +370,11 @@
   no warnings;
   $_[1] =~ /^(?:current(?: +year +to +(?:second|minute|hour|day|month))?|today|\w+\(.*\))$/i;
 }
+
+sub should_inline_date_keywords      { 1 }
+sub should_inline_datetime_keywords  { 1 }
+sub should_inline_time_keywords      { 1 }
+sub should_inline_timestamp_keywords { 1 }
 
 sub parse_set
 {

Modified: branches/upstream/librose-db-perl/current/lib/Rose/DB/MySQL.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/librose-db-perl/current/lib/Rose/DB/MySQL.pm?rev=25713&op=diff
==============================================================================
--- branches/upstream/librose-db-perl/current/lib/Rose/DB/MySQL.pm (original)
+++ branches/upstream/librose-db-perl/current/lib/Rose/DB/MySQL.pm Wed Oct  1 12:53:53 2008
@@ -11,7 +11,7 @@
 
 use Rose::DB;
 
-our $VERSION = '0.743';
+our $VERSION = '0.745';
 
 our $Debug = 0;
 
@@ -236,6 +236,7 @@
     return $val;
   }
 
+  no warnings 'uninitialized';
   if($from_db && $val =~ /^\d+$/)
   {
     return Bit::Vector->new_Dec($size || (length($val) * 4), $val);
@@ -277,6 +278,8 @@
 
   return hex($vec->to_Hex);
 }
+
+sub validate_bitfield_keyword { defined $_[1] ? 1 : 0 }
 
 sub should_inline_bitfield_values
 {

Modified: branches/upstream/librose-db-perl/current/lib/Rose/DB/Oracle.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/librose-db-perl/current/lib/Rose/DB/Oracle.pm?rev=25713&op=diff
==============================================================================
--- branches/upstream/librose-db-perl/current/lib/Rose/DB/Oracle.pm (original)
+++ branches/upstream/librose-db-perl/current/lib/Rose/DB/Oracle.pm Wed Oct  1 12:53:53 2008
@@ -8,7 +8,7 @@
 
 our $Debug = 0;
 
-our $VERSION  = '0.732'; 
+our $VERSION  = '0.745'; 
 
 use Rose::Class::MakeMethods::Generic
 (
@@ -269,6 +269,27 @@
 }
 
 sub format_boolean { $_[1] ? 't' : 'f' }
+
+#
+# Date/time keywords and inlining
+#
+
+# XXX: Guesswork!  Oracle users, patches welcome!
+
+sub validate_date_keyword
+{
+  no warnings;
+  $_[1] =~ /^(?:(?:CURRENT_|SYS)(?:TIMESTAMP|DATE)|\w+\(.*\))$/i;
+}
+
+*validate_time_keyword      = \&validate_date_keyword;
+*validate_timestamp_keyword = \&validate_date_keyword;
+*validate_datetime_keyword  = \&validate_date_keyword;
+
+sub should_inline_date_keywords      { 1 }
+sub should_inline_datetime_keywords  { 1 }
+sub should_inline_time_keywords      { 1 }
+sub should_inline_timestamp_keywords { 1 }
 
 1;
 

Modified: branches/upstream/librose-db-perl/current/lib/Rose/DB/SQLite.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/librose-db-perl/current/lib/Rose/DB/SQLite.pm?rev=25713&op=diff
==============================================================================
--- branches/upstream/librose-db-perl/current/lib/Rose/DB/SQLite.pm (original)
+++ branches/upstream/librose-db-perl/current/lib/Rose/DB/SQLite.pm Wed Oct  1 12:53:53 2008
@@ -7,7 +7,7 @@
 use Rose::DB;
 use SQL::ReservedWords::SQLite();
 
-our $VERSION = '0.737';
+our $VERSION = '0.745';
 
 #our $Debug = 0;
 
@@ -73,6 +73,11 @@
   no warnings;
   !ref $_[1] && $_[1] =~ /^(?:current_timestamp|\w+\(.*\))$/i;
 }
+
+sub should_inline_date_keywords      { 1 }
+sub should_inline_datetime_keywords  { 1 }
+sub should_inline_time_keywords      { 1 }
+sub should_inline_timestamp_keywords { 1 }
 
 sub parse_date
 {

Modified: branches/upstream/librose-db-perl/current/t/db_cache.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/librose-db-perl/current/t/db_cache.t?rev=25713&op=diff
==============================================================================
--- branches/upstream/librose-db-perl/current/t/db_cache.t (original)
+++ branches/upstream/librose-db-perl/current/t/db_cache.t Wed Oct  1 12:53:53 2008
@@ -4,7 +4,7 @@
 
 use FindBin qw($Bin);
 
-use Test::More tests => 3 + (4 * 5) + (4 * 5);
+use Test::More tests => 3 + (5 * 5) + (5 * 5);
 
 BEGIN
 {
@@ -21,7 +21,7 @@
   {
     unless(have_db($db_type))
     {
-      skip("$db_type tests", 4);
+      skip("$db_type tests", 5);
     }
   }
 
@@ -37,7 +37,11 @@
 
   ok($db2 = Rose::DB->new_or_cached(), "new_or_cached 3 - $db_type");
 
-  is($db->dbh, $db2->dbh, "new_or_cached dbh check - $db_type");   
+  is($db->dbh, $db2->dbh, "new_or_cached dbh check - $db_type");
+  
+  is_deeply([ sort Rose::DB->db_cache->db_cache_keys ],
+            [ sort map { $_->key } Rose::DB->db_cache->db_cache_entries ],
+            "db_cache_entries, db_cache_keys - $db_type");
 }
 
 no warnings 'redefine';
@@ -49,7 +53,7 @@
   {
     unless(have_db($db_type))
     {
-      skip("$db_type tests", 4);
+      skip("$db_type tests", 5);
     }
   }
 
@@ -66,4 +70,8 @@
   ok($db2 = Rose::DB->new(), "dbi_connect override 3 - $db_type");
 
   is($db->dbh, $db2->dbh, "dbi_connect override dbh check - $db_type");   
+
+  is_deeply([ sort Rose::DB->db_cache->db_cache_keys ],
+            [ sort map { $_->key } Rose::DB->db_cache->db_cache_entries ],
+            "dbi_connect override db_cache_entries, db_cache_keys - $db_type");
 }




More information about the Pkg-perl-cvs-commits mailing list