[Bast-commits] r3224 - in trunk/DBIx-Class/lib/DBIx/Class: . Manual Storage/DBI

nigel at dev.catalyst.perl.org nigel at dev.catalyst.perl.org
Wed May 2 15:58:46 GMT 2007


Author: nigel
Date: 2007-05-02 15:58:45 +0100 (Wed, 02 May 2007)
New Revision: 3224

Modified:
   trunk/DBIx-Class/lib/DBIx/Class/Cursor.pm
   trunk/DBIx-Class/lib/DBIx/Class/Manual/Cookbook.pod
   trunk/DBIx-Class/lib/DBIx/Class/Storage/DBI/Cursor.pm
Log:
Documented use of cursor->next for fast but uncomfortable data fetches

Modified: trunk/DBIx-Class/lib/DBIx/Class/Cursor.pm
===================================================================
--- trunk/DBIx-Class/lib/DBIx/Class/Cursor.pm	2007-05-02 13:33:47 UTC (rev 3223)
+++ trunk/DBIx-Class/lib/DBIx/Class/Cursor.pm	2007-05-02 14:58:45 UTC (rev 3224)
@@ -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: trunk/DBIx-Class/lib/DBIx/Class/Manual/Cookbook.pod
===================================================================
--- trunk/DBIx-Class/lib/DBIx/Class/Manual/Cookbook.pod	2007-05-02 13:33:47 UTC (rev 3223)
+++ trunk/DBIx-Class/lib/DBIx/Class/Manual/Cookbook.pod	2007-05-02 14:58:45 UTC (rev 3224)
@@ -1145,6 +1145,22 @@
      }
   }
 
+=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: trunk/DBIx-Class/lib/DBIx/Class/Storage/DBI/Cursor.pm
===================================================================
--- trunk/DBIx-Class/lib/DBIx/Class/Storage/DBI/Cursor.pm	2007-05-02 13:33:47 UTC (rev 3223)
+++ trunk/DBIx-Class/lib/DBIx/Class/Storage/DBI/Cursor.pm	2007-05-02 14:58:45 UTC (rev 3224)
@@ -61,7 +61,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