DBIx::StORM::RecordSet |
DBIx:: | |
Variables | |
$recommended_columns (private static) | A cache of recommended columns for a given RecordSet. |
Functions | |
_do_parse (private instance) | Inspect a filter target (may be a string for code reference) and decide how best to handle it. |
_parse (private instance) | Actually parse a perl code reference and turn it into a glob of SQL |
filter (public instance) | Create a DBIx::StORM::FilteredRecordSet to represent a filtered set of results from the database. |
grep | |
sort (public instance) | Create a DBIx::StORM::OrderedRecordSet to represent the same records as in this object, but sorted into a particular order. |
lookup (instance) | Fetch the first row from this RecordSet, and optionally fetch a particular field from it. |
_filter_id (private instance) | Fetch a string uniquely identifying this filter |
_recommended_columns (private_instance) | Fetch a list of recommended columns for this filter |
_recommend_column (private instance) | Recommend a new column for this filter to pre-fetch in future |
_table (private instance) | Fetch the table object underlying this RecordSet |
_as_array (private instance) | Actually do the query, and return a tied array that can be used to access the DBIx::StORM::Record objects. |
array (instance) | Actually do the query, and return an array of DBIx::StORM::Record objects. |
_get_sth (private instance) | Execute the query and set up a DBI statement handle |
_storm (private instance) | Get the DBIx::StORM object this result set was created using |
_as_string | |
update | |
delete | |
_do_binding | |
TIEARRAY | |
EXTEND | |
FETCH (private instance) | Fetch a DBIx::StORM::Record object for the next result in the RecordSet. |
FETCHSIZE |
sub _do_parse
Inspect a filter target (may be a string for code reference) and decide how best to handle it. If it’s a SQL string, it’ll be fine as-is (it’s up to you to make sure it works!) whilst if it’s a perl CV it’ll need parsing into SQL and caching for next time.
Scalar $filter | The code reference or the string to parse |
String $mode | The type of parse required for perl (eg. select, order) |
String | The result of the parse |
=end NaturalDocs
Create a DBIx::StORM::FilteredRecordSet to represent a filtered set of results from the database. The filter is usually a perl subroutine reference with the filtering logic in it, but could be a SQL WHERE component where use of perl isn’t appropriate.
CodeRef $filter | The filter code as a code reference or string |
Object | An object of type DBIx::StORM::FilteredRecordSet |
=end NaturalDocs
sub sort
Create a DBIx::StORM::OrderedRecordSet to represent the same records as in this object, but sorted into a particular order. The filter is usually a perl subroutine reference with the filtering logic in it, but could be a SQL ORDER BY component where use of perl isn’t appropriate.
$filter | The filter code as a code reference or string |
Object | An object of type DBIx::StORM::OrderedRecordSet |
=end NaturalDocs
sub lookup
Fetch the first row from this RecordSet, and optionally fetch a particular field from it.
$field | Optionally, the field to return from the first row |
An object of type DBIx::StORM::Record if no field is supplied or the field is a foreign key, otherwise a simple scalar
=end NaturalDocs
sub _table
Fetch the table object underlying this RecordSet
None
Object | An object of type DBIx::StORM::Table |
=end NaturalDocs
sub _as_array
Actually do the query, and return a tied array that can be used to access the DBIx::StORM::Record objects. A tied array is used as it means a maximum of two result objects are kept in memory at once, but does mean you can’t randomly access or otherwise tweak the array
None
ArrayRef | An array reference tied to this class. |
=end NaturalDocs
sub array
Actually do the query, and return an array of DBIx::StORM::Record objects. Unlike the array dereference, this returns a proper perl array rather than a tied array. This means you can randomly access the results, but it also takes a lot of memory
It also means you can’t push() onto it to add more rows.
This method is likely to go away when the fake array gets real enough to fool.
None
ArrayRef | An array of DBIx::StORM::Record Objects |
=end NaturalDocs
sub _storm
Get the DBIx::StORM object this result set was created using
None
Object | A DBIx::StORM object |
=end NaturalDocs
A cache of recommended columns for a given RecordSet.
our $recommended_columns
Inspect a filter target (may be a string for code reference) and decide how best to handle it.
sub _do_parse
Actually parse a perl code reference and turn it into a glob of SQL
sub _parse
sub grep
Create a DBIx::StORM::OrderedRecordSet to represent the same records as in this object, but sorted into a particular order.
sub sort
Fetch the first row from this RecordSet, and optionally fetch a particular field from it.
sub lookup
Fetch a string uniquely identifying this filter
sub _filter_id
Fetch a list of recommended columns for this filter
sub _recommended_columns
Recommend a new column for this filter to pre-fetch in future
sub _recommend_column
Fetch the table object underlying this RecordSet
sub _table
Actually do the query, and return a tied array that can be used to access the DBIx::StORM::Record objects.
sub _as_array
Actually do the query, and return an array of DBIx::StORM::Record objects.
sub array
Execute the query and set up a DBI statement handle
sub _get_sth
Get the DBIx::StORM object this result set was created using
sub _storm
sub _as_string
sub update
sub delete
sub _do_binding
sub TIEARRAY
sub EXTEND
Fetch a DBIx::StORM::Record object for the next result in the RecordSet.
sub FETCH
sub FETCHSIZE