[Bast-commits] r3227 - in branches/DBIx-Class/bulk_create: . lib/DBIx/Class lib/DBIx/Class/Manual lib/DBIx/Class/Storage/DBI

castaway at dev.catalyst.perl.org castaway at dev.catalyst.perl.org
Thu May 3 15:18:43 GMT 2007


Author: castaway
Date: 2007-05-03 15:18:39 +0100 (Thu, 03 May 2007)
New Revision: 3227

Modified:
   branches/DBIx-Class/bulk_create/
   branches/DBIx-Class/bulk_create/lib/DBIx/Class/Cursor.pm
   branches/DBIx-Class/bulk_create/lib/DBIx/Class/Manual/Cookbook.pod
   branches/DBIx-Class/bulk_create/lib/DBIx/Class/Schema.pm
   branches/DBIx-Class/bulk_create/lib/DBIx/Class/Storage/DBI/Cursor.pm
Log:
 r3228 at lilith (orig r3226):  blblack | 2007-05-03 04:03:06 +0100
  r30777 at brandon-blacks-computer (orig r3224):  nigel | 2007-05-02 09:58:45 -0500
  Documented use of cursor->next for fast but uncomfortable data fetches
  r30778 at brandon-blacks-computer (orig r3225):  blblack | 2007-05-02 22:02:14 -0500
  revert part of 3220, apparently it is breaking cloning behavior in subtle ways that we have no tests for
 



Property changes on: branches/DBIx-Class/bulk_create
___________________________________________________________________
Name: svk:merge
   - 168d5346-440b-0410-b799-f706be625ff1:/DBIx-Class-current:2207
462d4d0c-b505-0410-bf8e-ce8f877b3390:/local/bast/DBIx-Class:3159
78d5d833-3a7e-474d-aed6-cfba645156b5:/local/DBIx-Class.current:29201
78d5d833-3a7e-474d-aed6-cfba645156b5:/local/DBIx-Class.oracle8:29250
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-C3:318
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-current:3221
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/column_info_from_storage:2596
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/load_namespaces:2725
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/many_to_many:2025
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/param_bind:3015
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/source-handle:2975
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/sqlt_tests_refactor:2043
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/storage_exceptions:2617
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/versioning:2930
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/trunk/DBIx-Class:3220
   + 168d5346-440b-0410-b799-f706be625ff1:/DBIx-Class-current:2207
462d4d0c-b505-0410-bf8e-ce8f877b3390:/local/bast/DBIx-Class:3159
78d5d833-3a7e-474d-aed6-cfba645156b5:/local/DBIx-Class.current:29201
78d5d833-3a7e-474d-aed6-cfba645156b5:/local/DBIx-Class.oracle8:29250
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-C3:318
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-current:3226
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/column_info_from_storage:2596
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/load_namespaces:2725
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/many_to_many:2025
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/param_bind:3015
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/source-handle:2975
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/sqlt_tests_refactor:2043
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/storage_exceptions:2617
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/versioning:2930
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/trunk/DBIx-Class:3225

Modified: branches/DBIx-Class/bulk_create/lib/DBIx/Class/Cursor.pm
===================================================================
--- branches/DBIx-Class/bulk_create/lib/DBIx/Class/Cursor.pm	2007-05-03 03:03:06 UTC (rev 3226)
+++ branches/DBIx-Class/bulk_create/lib/DBIx/Class/Cursor.pm	2007-05-03 14:18:39 UTC (rev 3227)
@@ -38,7 +38,8 @@
 
 =head2 next
 
-Virtual method. Advances the cursor to the next row.
+Virtual method. Advances the cursor to the next row. Returns an array of
+column values (the result of L<DBI/fetchrow_array> method).
 
 =cut
 

Modified: branches/DBIx-Class/bulk_create/lib/DBIx/Class/Manual/Cookbook.pod
===================================================================
--- branches/DBIx-Class/bulk_create/lib/DBIx/Class/Manual/Cookbook.pod	2007-05-03 03:03:06 UTC (rev 3226)
+++ branches/DBIx-Class/bulk_create/lib/DBIx/Class/Manual/Cookbook.pod	2007-05-03 14:18:39 UTC (rev 3227)
@@ -1121,6 +1121,22 @@
   
 Wasn't that easy?
   
+=head2 Get raw data for blindingly fast results
+
+If the C<inflate_result> solution above is not fast enough for you, you
+can use a DBIx::Class to return values exactly as they come out of the
+data base with none of the convenience methods wrapped round them.
+
+This is used like so:-
+
+  my $cursor = $rs->cursor
+  while (my @vals = $cursor->next) {
+      # use $val[0..n] here
+  }
+
+You will need to map the array offsets to particular columns (you can
+use the I<select> attribute of C<search()> to force ordering).
+
 =head2 Want to know if find_or_create found or created a row?
 
 Just use C<find_or_new> instead, then check C<in_storage>:

Modified: branches/DBIx-Class/bulk_create/lib/DBIx/Class/Schema.pm
===================================================================
--- branches/DBIx-Class/bulk_create/lib/DBIx/Class/Schema.pm	2007-05-03 03:03:06 UTC (rev 3226)
+++ branches/DBIx-Class/bulk_create/lib/DBIx/Class/Schema.pm	2007-05-03 14:18:39 UTC (rev 3227)
@@ -97,13 +97,17 @@
 
   %$source = %{ $source->new( { %$source, source_name => $moniker }) };
 
-  $self->source_registrations->{$moniker} = $source;
+  my %reg = %{$self->source_registrations};
+  $reg{$moniker} = $source;
+  $self->source_registrations(\%reg);
 
   $source->schema($self);
 
   weaken($source->{schema}) if ref($self);
   if ($source->result_class) {
-    $self->class_mappings->{$source->result_class} = $moniker;
+    my %map = %{$self->class_mappings};
+    $map{$source->result_class} = $moniker;
+    $self->class_mappings(\%map);
   }
 }
 

Modified: branches/DBIx-Class/bulk_create/lib/DBIx/Class/Storage/DBI/Cursor.pm
===================================================================
--- branches/DBIx-Class/bulk_create/lib/DBIx/Class/Storage/DBI/Cursor.pm	2007-05-03 03:03:06 UTC (rev 3226)
+++ branches/DBIx-Class/bulk_create/lib/DBIx/Class/Storage/DBI/Cursor.pm	2007-05-03 14:18:39 UTC (rev 3227)
@@ -59,7 +59,8 @@
 
 =back
 
-Advances the cursor to the next row and returns an arrayref of column values.
+Advances the cursor to the next row and returns an array of column
+values (the result of L<DBI/fetchrow_array> method).
 
 =cut
 




More information about the Bast-commits mailing list