[Bast-commits] r3741 - in DBIx-Class/0.08/branches/cdbicompat_integration: . lib/DBIx lib/DBIx/Class lib/DBIx/Class/Manual lib/DBIx/Class/ResultClass lib/DBIx/Class/ResultSourceProxy lib/DBIx/Class/Storage lib/DBIx/Class/Storage/DBI lib/DBIx/Class/Storage/DBI/ODBC t

matthewt at dev.catalyst.perl.org matthewt at dev.catalyst.perl.org
Fri Sep 14 21:42:30 GMT 2007


Author: matthewt
Date: 2007-09-14 21:42:29 +0100 (Fri, 14 Sep 2007)
New Revision: 3741

Modified:
   DBIx-Class/0.08/branches/cdbicompat_integration/
   DBIx-Class/0.08/branches/cdbicompat_integration/Changes
   DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class.pm
   DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/Manual/FAQ.pod
   DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/PK.pm
   DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/Relationship.pm
   DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/ResultClass/HashRefInflator.pm
   DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/ResultSet.pm
   DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/ResultSource.pm
   DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/ResultSourceProxy/Table.pm
   DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/Storage/DBI.pm
   DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/Storage/DBI/ODBC.pm
   DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/Storage/DBI/ODBC/DB2_400_SQL.pm
   DBIx-Class/0.08/branches/cdbicompat_integration/t/60core.t
   DBIx-Class/0.08/branches/cdbicompat_integration/t/92storage_on_connect_do.t
Log:
 r11217 at jules (orig r3705):  tomboh | 2007-08-22 11:28:58 +0100
 Fix the behaviour of code refs within array refs for on_(dis)?connect_do
 and enhance tests to spot the previous mistake.
 
 r11218 at jules (orig r3706):  tomboh | 2007-08-22 11:57:14 +0100
 Add myself to the list of contributors
 
 r11232 at jules (orig r3709):  gphat | 2007-08-24 18:11:46 +0100
 Fix typos.
 
 r14025 at jules (orig r3720):  ilmari | 2007-09-04 17:44:41 +0100
 Fix return value for DBIC::ResultSource::Table->table($table)
 r14026 at jules (orig r3721):  ash | 2007-09-04 20:14:02 +0100
 Bump for New relase
 r14027 at jules (orig r3722):  semifor | 2007-09-05 04:49:46 +0100
  r1185 at titanic:  mjm | 2007-09-04 20:11:07 -0700
  Updated email address
 
 r14029 at jules (orig r3723):  castaway | 2007-09-06 21:07:52 +0100
 Doc patch from wreis
 
 r14030 at jules (orig r3724):  castaway | 2007-09-06 22:35:49 +0100
 Add more about accessors to doc
 
 r14031 at jules (orig r3725):  tomboh | 2007-09-07 17:54:00 +0100
 Small POD fix
 
 r14032 at jules (orig r3726):  semifor | 2007-09-08 17:58:56 +0100
  r1191 at titanic:  mjm | 2007-09-08 09:20:32 -0700
  discard_changes is also "refresh from storage"
 
 r14035 at jules (orig r3729):  castaway | 2007-09-12 00:23:20 +0100
 Much doch shuffling and more argument explanations (due to initself ;)
 



Property changes on: DBIx-Class/0.08/branches/cdbicompat_integration
___________________________________________________________________
Name: svk:merge
   - 168d5346-440b-0410-b799-f706be625ff1:/DBIx-Class-current:2207
462d4d0c-b505-0410-bf8e-ce8f877b3390:/local/bast/DBIx-Class:3159
9c88509d-e914-0410-b01c-b9530614cbfe:/local/DBIx-Class:32260
9c88509d-e914-0410-b01c-b9530614cbfe:/local/DBIx-Class-CDBICompat:32850
9c88509d-e914-0410-b01c-b9530614cbfe:/vendor/DBIx-Class:31122
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/on_disconnect_do:3694
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/trunk:3703
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-C3:318
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-current:2222
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-joins:173
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-resultset:570
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/datetime:1716
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/find_compat:1855
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/find_unique_query_fixes:2142
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/inflate:1988
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/many_to_many:2025
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/re_refactor_bugfix:1944
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/reorganize_tests:1827
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset-new-refactor:1766
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset_2_electric_boogaloo:2175
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset_cleanup:2102
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/sqlt_tests_refactor:2043
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/trunk/DBIx-Class:3606
   + 168d5346-440b-0410-b799-f706be625ff1:/DBIx-Class-current:2207
462d4d0c-b505-0410-bf8e-ce8f877b3390:/local/bast/DBIx-Class:3159
9c88509d-e914-0410-b01c-b9530614cbfe:/local/DBIx-Class:32260
9c88509d-e914-0410-b01c-b9530614cbfe:/local/DBIx-Class-CDBICompat:32850
9c88509d-e914-0410-b01c-b9530614cbfe:/vendor/DBIx-Class:31122
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/on_disconnect_do:3694
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/trunk:3729
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-C3:318
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-current:2222
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-joins:173
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-resultset:570
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/datetime:1716
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/find_compat:1855
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/find_unique_query_fixes:2142
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/inflate:1988
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/many_to_many:2025
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/re_refactor_bugfix:1944
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/reorganize_tests:1827
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset-new-refactor:1766
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset_2_electric_boogaloo:2175
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset_cleanup:2102
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/sqlt_tests_refactor:2043
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/trunk/DBIx-Class:3606

Modified: DBIx-Class/0.08/branches/cdbicompat_integration/Changes
===================================================================
--- DBIx-Class/0.08/branches/cdbicompat_integration/Changes	2007-09-14 14:29:25 UTC (rev 3740)
+++ DBIx-Class/0.08/branches/cdbicompat_integration/Changes	2007-09-14 20:42:29 UTC (rev 3741)
@@ -1,5 +1,6 @@
 Revision history for DBIx::Class
 
+0.08007 2007-09-04 19:36:00
         - patch for Oracle datetime inflation (abram at arin.net)
         - added on_disconnect_do
         - on_connect_do and on_disconnect_do take coderefs and arrayrefs

Modified: DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/Manual/FAQ.pod
===================================================================
--- DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/Manual/FAQ.pod	2007-09-14 14:29:25 UTC (rev 3740)
+++ DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/Manual/FAQ.pod	2007-09-14 20:42:29 UTC (rev 3741)
@@ -285,6 +285,18 @@
 If supported by the database, slice will use LIMIT/OFFSET to hint to the database that we
 really only need one row. This can result in a significant speed improvement.
 
+=item .. refresh a row from storage?
+
+Use L<DBIx::Class::PK/discard_changes>.
+
+  $row->discard_changes
+
+Discarding changes and refreshing from storage are two sides fo the same coin.  When you
+want to discard your local changes, just re-fetch the row from storage.  When you want
+to get a new, fresh copy of the row, just re-fetch the row from storage.
+L<DBIx::Class::PK/discard_changes> does just that by re-fetching the row from storage
+using the row's primary key.
+
 =back
 
 =head2 Inserting and updating data
@@ -398,6 +410,6 @@
 particular column or group of columns (a-la cdbi Stringfy column
 group, or stringify_self method) ?
 
-See L<Cookbook/Stringification>
+See L<DBIx::Class::Manual::Cookbook/Stringification>
 
 =back

Modified: DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/PK.pm
===================================================================
--- DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/PK.pm	2007-09-14 14:29:25 UTC (rev 3740)
+++ DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/PK.pm	2007-09-14 20:42:29 UTC (rev 3741)
@@ -30,6 +30,9 @@
 Re-selects the row from the database, losing any changes that had
 been made.
 
+This method can also be used to refresh from storage, retrieving any
+changes made since the row was last read from storage.
+
 =cut
 
 sub discard_changes {

Modified: DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/Relationship.pm
===================================================================
--- DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/Relationship.pm	2007-09-14 14:29:25 UTC (rev 3740)
+++ DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/Relationship.pm	2007-09-14 20:42:29 UTC (rev 3741)
@@ -115,6 +115,44 @@
 
 =back
 
+Creates a relationship where the calling class stores the foreign class's
+primary key in one (or more) of its columns. This relationship defaults to
+using C<$accessor_name> as the foreign key in C<$related_class> to resolve the
+join, unless C<$foreign_key_column> specifies the foreign key column in
+C<$related_class> or C<$cond> specifies a reference to a join condition hash.
+
+=over
+
+=item accessor_name
+
+This argument is the name of the method you can call on a
+L<DBIx::Class::Row> object to retrieve the instance of the foreign
+class matching this relationship.
+
+Use this accessor_name (relation name) in L<DBIx::Class::ResultSet/join>
+or L<DBIx::Class::ResultSet/prefetch> to join to the foreign table
+indicated by this relationship.
+
+=item related_class
+
+This is the class name of the table referenced by the foreign key in
+this class.
+
+=item foreign_key_column
+
+The column name on this class that contains the foreign key.
+
+OR
+
+=item cond
+
+A hashref where the keys are C<foreign.$column_on_related_table> and
+the values are C<self.$foreign_key_column>. This is useful for
+relations that are across multiple columns.
+
+=back
+
+
   # in a Book class (where Author has many Books)
   My::DBIC::Schema::Book->belongs_to( author => 'My::DBIC::Schema::Author' );
 
@@ -127,12 +165,6 @@
                                       'My::DBIC::Schema::Author',
                                       { 'foreign.author' => 'self.author' } );
 
-Creates a relationship where the calling class stores the foreign class's
-primary key in one (or more) of its columns. This relationship defaults to
-using C<$accessor_name> as the foreign key in C<$related_class> to resolve the
-join, unless C<$foreign_key_column> specifies the foreign key column in
-C<$related_class> or C<$cond> specifies a reference to a join condition hash.
-
 If the relationship is optional -- i.e. the column containing the foreign key
 can be NULL -- then the belongs_to relationship does the right thing. Thus, in
 the example above C<$obj-E<gt>author> would return C<undef>.  However in this
@@ -163,6 +195,45 @@
 
 =back
 
+Creates a one-to-many relationship, where the corresponding elements of the
+foreign class store the calling class's primary key in one (or more) of its
+columns. This relationship defaults to using C<$accessor_name> as the foreign
+key in C<$related_class> to resolve the join, unless C<$foreign_key_column>
+specifies the foreign key column in C<$related_class> or C<$cond> specifies a
+reference to a join condition hash.
+
+=over
+
+=item accessor_name
+
+This argument is the name of the method you can call on a
+L<DBIx::Class::Row> object to retrieve a resultset of the related
+class restricted to the ones related to the row object. In list
+context it returns the row objects.
+
+Use this accessor_name (relation name) in L<DBIx::Class::ResultSet/join>
+or L<DBIx::Class::ResultSet/prefetch> to join to the foreign table
+indicated by this relationship.
+
+=item related_class
+
+This is the class name of the table which contains a foreign key
+column containing PK values of this class.
+
+=item foreign_key_column
+
+The column name on the related class that contains the foreign key.
+
+OR
+
+=item cond
+
+A hashref where the keys are C<foreign.$column_on_related_table> and
+the values are C<self.$foreign_key_column>. This is useful for
+relations that are across multiple columns.
+
+=back
+
   # in an Author class (where Author has_many Books)
   My::DBIC::Schema::Author->has_many(books => 'My::DBIC::Schema::Book', 'author');
 
@@ -184,13 +255,6 @@
     'foreign.author' => 'self.author',
   });
 
-Creates a one-to-many relationship, where the corresponding elements of the
-foreign class store the calling class's primary key in one (or more) of its
-columns. This relationship defaults to using C<$accessor_name> as the foreign
-key in C<$related_class> to resolve the join, unless C<$foreign_key_column>
-specifies the foreign key column in C<$related_class> or C<$cond> specifies a
-reference to a join condition hash.
-
 Three methods are created when you create a has_many relationship.  The first
 method is the expected accessor method, C<$accessor_name()>.  The second is
 almost exactly the same as the accessor method but "_rs" is added to the end of
@@ -217,6 +281,43 @@
 
 =back
 
+Creates an optional one-to-one relationship with a class. This relationship
+defaults to using C<$accessor_name> as the foreign key in C<$related_class> to
+resolve the join, unless C<$foreign_key_column> specifies the foreign key
+column in C<$related_class> or C<$cond> specifies a reference to a join
+condition hash.
+
+=over
+
+=item accessor_name
+
+This argument is the name of the method you can call on a
+L<DBIx::Class::Row> object to retrieve the instance of the foreign
+class matching this relationship.
+
+Use this accessor_name (relation name) in L<DBIx::Class::ResultSet/join>
+or L<DBIx::Class::ResultSet/prefetch> to join to the foreign table
+indicated by this relationship.
+
+=item related_class
+
+This is the class name of the table which contains a foreign key
+column containing PK values of this class.
+
+=item foreign_key_column
+
+The column name on the related class that contains the foreign key.
+
+OR
+
+=item cond
+
+A hashref where the keys are C<foreign.$column_on_related_table> and
+the values are C<self.$foreign_key_column>. This is useful for
+relations that are across multiple columns.
+
+=back
+
   My::DBIC::Schema::Author->might_have( pseudonym =>
                                         'My::DBIC::Schema::Pseudonym' );
 
@@ -234,14 +335,6 @@
                                         'My::DBIC::Schema::Pseudonym',
                                         { 'foreign.author' => 'self.author' } );
 
-Assuming the Pseudonym table has
-
-Creates an optional one-to-one relationship with a class. This relationship
-defaults to using C<$accessor_name> as the foreign key in C<$related_class> to
-resolve the join, unless C<$foreign_key_column> specifies the foreign key
-column in C<$related_class> or C<$cond> specifies a reference to a join
-condition hash.
-
 If you update or delete an object in a class with a C<might_have>
 relationship, the related object will be updated or deleted as well. To
 turn off this behavior, add C<< cascade_delete => 0 >> to the C<$attr>
@@ -287,6 +380,37 @@
 
 =back
 
+C<many_to_many> is not strictly a relationship in its own right. Instead, it is
+a bridge between two resultsets which provide the same kind of convenience
+accessors as true relationships provide. Although the accessor will return a 
+resultset or collection of objects just like has_many does, you cannot call 
+C<related_resultset> and similar methods which operate on true relationships.
+
+=over
+
+=item accessor_name
+
+This argument is the name of the method you can call on a
+L<DBIx::Class::Row> object to retrieve the rows matching this
+relationship.
+
+On a many_to_many, unlike other relationships, this cannot be used in
+L<DBIx::Class::ResultSet/search> to join tables. Use the relations
+bridged across instead.
+
+=item link_rel_name
+
+This is the accessor_name from the has_many relationship we are
+bridging from.
+
+=item foreign_rel_name
+
+This is the accessor_name of the belongs_to relationship in the link
+table that we are bridging across (which gives us the table we are
+bridging to).
+
+=back
+
 To create a many_to_many relationship from Actor to Role:
 
   My::DBIC::Schema::Actor->has_many( actor_roles =>
@@ -313,12 +437,6 @@
 
   $actor->add_to_roles($role, { year => 1995 });
 
-Many_to_many is not strictly a relationship in its own right. Instead, it is
-a bridge between two resultsets which provide the same kind of convenience
-accessors as true relationships provide. Although the accessor will return a 
-resultset or collection of objects just like has_many does, you cannot call 
-C<$related_resultset> and similar methods which operate on true relationships.
-
 In the above example, ActorRoles is the link table class, and Role is the
 foreign class. The C<$link_rel_name> parameter is the name of the accessor for
 the has_many relationship from this table to the link table, and the

Modified: DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/ResultClass/HashRefInflator.pm
===================================================================
--- DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/ResultClass/HashRefInflator.pm	2007-09-14 14:29:25 UTC (rev 3740)
+++ DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/ResultClass/HashRefInflator.pm	2007-09-14 20:42:29 UTC (rev 3741)
@@ -23,13 +23,13 @@
 =item *
 
 Specify C<< $rs->result_class >> on a specific resultset to affect only that
-resultser (and any chained off of it); or
+resultset (and any chained off of it); or
 
 =item *
 
 Specify C<< __PACKAGE__->result_class >> on your source object to force all
 uses of that result source to be inflated to hash-refs - this approach is not
-recomended
+recommended.
 
 =back
 

Modified: DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/ResultSet.pm
===================================================================
--- DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/ResultSet.pm	2007-09-14 14:29:25 UTC (rev 3740)
+++ DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/ResultSet.pm	2007-09-14 20:42:29 UTC (rev 3741)
@@ -2217,11 +2217,10 @@
 
 =back
 
-Indicates column names for object inflation. That is, c< as >
+Indicates column names for object inflation. That is, C<as>
 indicates the name that the column can be accessed as via the
 C<get_column> method (or via the object accessor, B<if one already
-exists>).  It has nothing to do with the SQL code C< SELECT foo AS bar
->.
+exists>).  It has nothing to do with the SQL code C<SELECT foo AS bar>.
 
 The C<as> attribute is used in conjunction with C<select>,
 usually when C<select> contains one or more function or stored

Modified: DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/ResultSource.pm
===================================================================
--- DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/ResultSource.pm	2007-09-14 14:29:25 UTC (rev 3740)
+++ DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/ResultSource.pm	2007-09-14 20:42:29 UTC (rev 3741)
@@ -81,6 +81,10 @@
 the hashref as the column_info for that column. Repeated calls of this
 method will add more columns, not replace them.
 
+The column names given will be created as accessor methods on your
+L<DBIx::Class::Row> objects, you can change the name of the accessor
+by supplying an L</accessor> in the column_info hash.
+
 The contents of the column_info are not set in stone. The following
 keys are currently recognised/used by DBIx::Class:
 
@@ -88,7 +92,7 @@
 
 =item accessor
 
-Use this to set the name of the accessor for this column. If unset,
+Use this to set the name of the accessor method for this column. If unset,
 the name of the column will be used.
 
 =item data_type

Modified: DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/ResultSourceProxy/Table.pm
===================================================================
--- DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/ResultSourceProxy/Table.pm	2007-09-14 14:29:25 UTC (rev 3740)
+++ DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/ResultSourceProxy/Table.pm	2007-09-14 20:42:29 UTC (rev 3741)
@@ -99,6 +99,7 @@
     $class =~ m/([^:]+)$/;
     $class->schema_instance->register_class($class, $class);
   }
+  return $class->result_source_instance->name;
 }
 
 =head2 has_column

Modified: DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/Storage/DBI/ODBC/DB2_400_SQL.pm
===================================================================
--- DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/Storage/DBI/ODBC/DB2_400_SQL.pm	2007-09-14 14:29:25 UTC (rev 3740)
+++ DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/Storage/DBI/ODBC/DB2_400_SQL.pm	2007-09-14 20:42:29 UTC (rev 3741)
@@ -56,7 +56,7 @@
 
 =head1 AUTHORS
 
-Marc Mims C<< <marc at sssonline.com> >>
+Marc Mims C<< <marc at questright.com> >>
 
 Based on DBIx::Class::Storage::DBI::DB2 by Jess Robinson.
 

Modified: DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/Storage/DBI/ODBC.pm
===================================================================
--- DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/Storage/DBI/ODBC.pm	2007-09-14 14:29:25 UTC (rev 3740)
+++ DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/Storage/DBI/ODBC.pm	2007-09-14 20:42:29 UTC (rev 3741)
@@ -39,7 +39,7 @@
 
 =head1 AUTHORS
 
-Marc Mims C<< <marc at sssonline.com> >>
+Marc Mims C<< <marc at questright.com> >>
 
 =head1 LICENSE
 

Modified: DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/Storage/DBI.pm
===================================================================
--- DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/Storage/DBI.pm	2007-09-14 14:29:25 UTC (rev 3740)
+++ DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class/Storage/DBI.pm	2007-09-14 20:42:29 UTC (rev 3741)
@@ -366,7 +366,7 @@
 
 =item on_disconnect_do
 
-Takes arguments in the same for as L<on_connect_do> and executes them
+Takes arguments in the same form as L<on_connect_do> and executes them
 immediately before disconnecting from the database.
 
 Note, this only runs if you explicitly call L<disconnect> on the
@@ -792,7 +792,8 @@
   my ($self, $action) = @_;
 
   if (ref $action eq 'CODE') {
-    $action->($self);
+    $action = $action->($self);
+    $self->_do_query($_) foreach @$action;
   }
   else {
     my @to_run = (ref $action eq 'ARRAY') ? (@$action) : ($action);

Modified: DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class.pm
===================================================================
--- DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class.pm	2007-09-14 14:29:25 UTC (rev 3740)
+++ DBIx-Class/0.08/branches/cdbicompat_integration/lib/DBIx/Class.pm	2007-09-14 20:42:29 UTC (rev 3741)
@@ -23,7 +23,7 @@
 # i.e. first release of 0.XX *must* be 0.XX000. This avoids fBSD ports
 # brain damage and presumably various other packaging systems too
 
-$VERSION = '0.08006';
+$VERSION = '0.08007';
 
 sub MODIFY_CODE_ATTRIBUTES {
   my ($class,$code, at attrs) = @_;
@@ -265,6 +265,8 @@
 
 Todd Lipcon
 
+Tom Hukins
+
 typester: Daisuke Murase <typester at cpan.org>
 
 victori: Victor Igumnov <victori at cpan.org>

Modified: DBIx-Class/0.08/branches/cdbicompat_integration/t/60core.t
===================================================================
--- DBIx-Class/0.08/branches/cdbicompat_integration/t/60core.t	2007-09-14 14:29:25 UTC (rev 3740)
+++ DBIx-Class/0.08/branches/cdbicompat_integration/t/60core.t	2007-09-14 20:42:29 UTC (rev 3741)
@@ -7,7 +7,7 @@
 
 my $schema = DBICTest->init_schema();
 
-plan tests => 77;
+plan tests => 78;
 
 eval { require DateTime::Format::MySQL };
 my $NO_DTFM = $@ ? 1 : 0;
@@ -337,3 +337,10 @@
     is($edata{'created_on'}, $event->created_on, 'got created date');
 }
 
+# test resultsource->table return value when setting
+{
+    my $class = $schema->class('Event');
+    diag $class;
+    my $table = $class->table($class->table);
+    is($table, $class->table, '->table($table) returns $table');
+}

Modified: DBIx-Class/0.08/branches/cdbicompat_integration/t/92storage_on_connect_do.t
===================================================================
--- DBIx-Class/0.08/branches/cdbicompat_integration/t/92storage_on_connect_do.t	2007-09-14 14:29:25 UTC (rev 3740)
+++ DBIx-Class/0.08/branches/cdbicompat_integration/t/92storage_on_connect_do.t	2007-09-14 20:42:29 UTC (rev 3741)
@@ -17,6 +17,7 @@
         on_connect_do       => [
             'CREATE TABLE TEST_empty (id INTEGER)',
             [ 'INSERT INTO TEST_empty VALUES (?)', {}, 2 ],
+            \&insert_from_subref,
         ],
         on_disconnect_do    =>
             [\&check_exists, 'DROP TABLE TEST_empty', \&check_dropped],
@@ -25,7 +26,7 @@
 
 is_deeply
   $schema->storage->dbh->selectall_arrayref('SELECT * FROM TEST_empty'),
-  [ [ 2 ] ],
+  [ [ 2 ], [ 3 ], [ 7 ] ],
   'on_connect_do() worked';
 eval { $schema->storage->dbh->do('SELECT 1 FROM TEST_nonexistent'); };
 ok $@, 'Searching for nonexistent table dies';
@@ -50,10 +51,20 @@
 sub check_exists {
     my $storage = shift;
     ok $storage->dbh->do('SELECT 1 FROM TEST_empty'), 'Table still exists';
+    return;
 }
 
 sub check_dropped {
     my $storage = shift;
     eval { $storage->dbh->do('SELECT 1 FROM TEST_empty'); };
     ok $@, 'Reading from dropped table fails';
+    return;
 }
+
+sub insert_from_subref {
+    my $storage = shift;
+    return [
+        [ 'INSERT INTO TEST_empty VALUES (?)', {}, 3 ],
+        'INSERT INTO TEST_empty VALUES (7)',
+    ];
+}




More information about the Bast-commits mailing list