GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  DBIX::CLASS::CUSTOMPREFETCH (3)

.ds Aq ’

NAME

DBIx::Class::CustomPrefetch - Custom prefetches for DBIx::Class

CONTENTS

DESCRIPTION

DBIx::Class onle allows joins for prefetches. But sometimes you can’t use JOIN for prefetch. E.g. for prefetching many related objects to resultset with paging.

Also you can use this module to create cross-database prefetches.

This module provides other logic for prefetching data to resultsets.

VERSION

Version 0.09

SYNOPSIS



    package MyApp::Schema::Foo;

    __PACKAGE__->load_components( qw(Core CustomPrefetch) );
    __PACKAGE__->add_column( qw(id artist_id) );
    __PACKAGE__->resultset_class( DBIx::Class::ResultSet::CustomPrefetch );
    __PACKAGE__->custom_relation( artist => sub { MyOtherResultSetClass->new } => {
        foreign.id => self.artist_id
    });



And your code:



    my $resultset = $schema->resultset(Foo)->search( undef, { rows => 10 } );
    foreach ($resultset->all) {
        say $_->artist->name;
    }



will make only two SQL requests:



    SELECT id, artist_id FROM foo LIMIT 10;
    SELECT * FROM artists WHERE id IN (1, 2, 3, 5, 8, 13, 21, 34, 55, 89);



METHODS

    custom_relation

Makes IN relation. In can be has_one, might_have or many_to_many

Args: $relation_name, $resultset_callback, $condition

AUTHOR

Andrey Kostenko, <andrey at kostenko.name>

BUGS

Please report any bugs or feature requests to bug-dbix-class-customprefetch at rt.cpan.org, or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=DBIx-Class-CustomPrefetch>. I will be notified, and then you’ll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.



    perldoc DBIx::Class::CustomPrefetch



You can also look for information at:
o RT: CPAN’s request tracker

<http://rt.cpan.org/NoAuth/Bugs.html?Dist=DBIx-Class-CustomPrefetch>

o AnnoCPAN: Annotated CPAN documentation

<http://annocpan.org/dist/DBIx-Class-CustomPrefetch>

o CPAN Ratings

<http://cpanratings.perl.org/d/DBIx-Class-CustomPrefetch>

o Search CPAN

<http://search.cpan.org/dist/DBIx-Class-CustomPrefetch/>

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

Copyright 2009 Andrey Kostenko, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 DBIX::CLASS::CUSTOMPREFETCH (3) 2009-11-24

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.