- new ( params )
- item_class ( )
- consistent ( )
- set ( )
- where ( )
- order_by ( )
- limit ( )
- simpledb ( )
- result ( )
- has_result ()
- iterator ( )
- limit_counter ( )
- fetch_result ( [ next ] )
- count ( [ options ] )
- search ( options )
- update ( attributes )
- delete ( )
- paginate ( items_per_page, page_number )
- next ()
- to_array_ref ()
SimpleDB::Class::ResultSet - An iterator of items from a domain.
This class is an iterator to walk to the items passed back from a query.
Warning: Once you have a result set and you start calling methods on it, it will begin iterating over the result set. Therefore you can't call both
search, or any other combinations of methods on an existing result set.
Warning: If you call a method like
search on a result set which causes another query to be run, know that the original result set must be very small. This is because there is a limit of 20 comparisons per request as a limitation of SimpleDB.
The following methods are available from this class.
Required. A SimpleDB::Class object.
Required. A SimpleDB::Class::Item subclass name.
A result as returned from the send_request() method from SimpleDB::Client. Either this or a where is required.
A where clause as defined in SimpleDB::Class::SQL. Either this or a result is required.
An order_by clause as defined in SimpleDB::Class::SQL. Optional.
A limit clause as defined in SimpleDB::Class::SQL. Optional. NOTE:SimpleDB defines a limit as the number of results to limit to each Next Token, but SimpleDB::Class::ResultSet enforces the limit to be more like a traditional relational database, so calling
next() after the limit will return
undef just as if there were no more results left to display.
A boolean that if set true will get around Eventual Consistency, but at a reduced performance. Optional.
A hash reference of attribute names and values, which will be set on the item as
next is called. Doing so helps to prevent stale object references.
Returns the item_class passed into the constructor.
Returns the consistent value passed into the constructor.
Returns the set value passed into the constructor.
Returns the where passed into the constructor.
Returns the order_by passed into the constructor.
Returns the limit passed into the constructor.
Returns the simpledb passed into the constructor.
Returns the result passed into the constructor, or the one generated by fetch_result() if a where is passed into the constructor.
A boolean indicating whether a result was passed into the constructor, or generated by fetch_result().
Returns an integer which represents the current position in the result set as traversed by
Returns an integer representing how many items have been traversed so far by
next(). When this reaches the value of
limit then no more results will be returned by
Fetches a result, based on a where clause passed into a constructor, and then makes it accessible via the
A next token, in order to fetch the next part of a result set.
Counts the items in the result set. Returns an integer.
A hash of extra options you can pass to modify the count.
A where clause as defined by SimpleDB::Class::SQL. If this is specified, then an additional query is executed before counting the items in the result set.
Just like "search" in SimpleDB::Class::Domain, but searches within the confines of the current result set, and then returns a new result set.
A hash of extra options to modify the search.
A where clause as defined by SimpleDB::Class::SQL.
update and then
put on all the items in the result set.
A hash reference containing name/value pairs to update in each item.
delete on all the items in the result set.
Use on a new result set to fast forward to the desired data. After you've paginated, you can call
next to start fetching your data. Returns a reference to the result set for easy method chaining.
NOTE: Unless you've already set a limit, the limit for this result set will be set to
items_per_page as a convenience.
An integer representing how many items you're fetching/displaying per page.
An integer representing what page number you'd like to skip ahead to.
Returns the next result in the result set. Also fetches th next partial result set if there's a next token in the first result set and you've iterated through the first partial set.
Returns an array reference containing all the objects in the result set. If the result set has already been partially walked, then only the remaining objects will be returned.
SimpleDB::Class is Copyright 2009-2010 Plain Black Corporation (http://www.plainblack.com/) and is licensed under the same terms as Perl itself.