The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Alzabo::Runtime::JoinCursor - Cursor that returns Alzabo::Runtime::Row arrays of objects

SYNOPSIS

  use Alzabo::Runtime::JoinCursor;

  my $cursor = $schema->join( tables => [ $foo, $bar ],
                              where => [ $foo->column('foo_id') => 1 ] );

  while ( my @rows = $cursor->next_rows )
  {
      print $row[0]->select('foo'), "\n";
      print $row[1]->select('bar'), "\n";
  }

DESCRIPTION

Objects in this class are used to return arrays Alzabo::Runtime::Row objects when requested. The cursor does not preload objects but rather creates them on demand, which is much more efficient. For more details on the rational please see the RATIONALE FOR CURSORS section.

NOTE: This class is considered experimental.

METHODS

  • new

    Takes the following parameters:

  • -- statement => Alzabo::Driver::Statement object

  • -- tables => [ Alzabo::Table objects ]

  • next_rows

    Returns the next array Alzabo::Runtime::Row objects or and empty list if no more are available. This behavior can mask errors in your database's referntial integrity. For more information on how to deal with this see the HANDLING ERRORS section.

  • all_rows

    Returns all the rows available from the current point onwards. This means that if there are five rows that will be returned when the object is created and you call next_row twice, calling all_rows after it will only return three. Calling the errors method after this will return all errors trapped during the fetching of these rows. The return value is an array of array references. Each of these references represents a single set of rows as they would be returned from the next_rows method.

  • errors

    Alzabo::Runtime::Cursor.

  • reset

    Resets the cursor so that the next next_rows call will return the first row of the set.

HANDLING ERRORS

See Alzabo::Runtime::Cursor.

RATIONALE FOR CURSORS

See Alzabo::Runtime::Cursor.

AUTHOR

Dave Rolsky, <autarch@urth.org>

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 125:

Expected '=item *'

Around line 127:

Expected '=item *'