X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FManual%2FCookbook.pod;h=52bb889691b9a7b8675dc75ff1d59855182f3d28;hb=8b50216ef0fb096f61405a93a96b68a1d1b62bf4;hp=10ea02359c56fbf6dc93618fa88be5daf2a7dd13;hpb=181a28f4e04c13a37fe4a5b6357d85e1da63dbc4;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Manual/Cookbook.pod b/lib/DBIx/Class/Manual/Cookbook.pod index 10ea023..52bb889 100644 --- a/lib/DBIx/Class/Manual/Cookbook.pod +++ b/lib/DBIx/Class/Manual/Cookbook.pod @@ -12,7 +12,7 @@ When you expect a large number of results, you can ask L for a paged resultset, which will fetch only a small number of records at a time: my $rs = $schema->resultset('Artist')->search( - {}, + undef, { page => 1, # page to return (defaults to 1) rows => 10, # number of results per page @@ -24,7 +24,7 @@ paged resultset, which will fetch only a small number of records at a time: The C attribute does not have to be specified in your search: my $rs = $schema->resultset('Artist')->search( - {}, + undef, { rows => 10, } @@ -72,19 +72,24 @@ L. =head3 Using specific columns -When you only want selected columns from a table, you can use C to -specify which ones you need: +When you only want specific columns from a table, you can use +C to specify which ones you need. This is useful to avoid +loading columns with large amounts of data that you aren't about to +use anyway: my $rs = $schema->resultset('Artist')->search( - {}, + undef, { - cols => [qw/ name /] + columns => [qw/ name /] } ); # Equivalent SQL: # SELECT artist.name FROM artist +This is a shortcut for C and C. + =head3 Using database functions or stored procedures The combination of C