Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

dbix::class::resultclass::hashrefinflator(3) [mojave man page]

DBIx::Class::ResultClass::HashRefInflator(3)		User Contributed Perl Documentation	      DBIx::Class::ResultClass::HashRefInflator(3)

NAME
DBIx::Class::ResultClass::HashRefInflator - Get raw hashrefs from a resultset SYNOPSIS
use DBIx::Class::ResultClass::HashRefInflator; my $rs = $schema->resultset('CD'); $rs->result_class('DBIx::Class::ResultClass::HashRefInflator'); while (my $hashref = $rs->next) { ... } OR as an attribute: my $rs = $schema->resultset('CD')->search({}, { result_class => 'DBIx::Class::ResultClass::HashRefInflator', }); while (my $hashref = $rs->next) { ... } DESCRIPTION
DBIx::Class is faster than older ORMs like Class::DBI but it still isn't designed primarily for speed. Sometimes you need to quickly retrieve the data from a massive resultset, while skipping the creation of fancy result objects. Specifying this class as a "result_class" for a resultset will change "$rs->next" to return a plain data hash-ref (or a list of such hash-refs if "$rs->all" is used). There are two ways of applying this class to a resultset: o Specify "$rs->result_class" on a specific resultset to affect only that resultset (and any chained off of it); or o Specify "__PACKAGE__->result_class" on your source object to force all uses of that result source to be inflated to hash-refs - this approach is not recommended. METHODS
inflate_result Inflates the result and prefetched data into a hash-ref (invoked by DBIx::Class::ResultSet) CAVEATS
o This will not work for relationships that have been prefetched. Consider the following: my $artist = $artitsts_rs->search({}, {prefetch => 'cds' })->first; my $cds = $artist->cds; $cds->result_class('DBIx::Class::ResultClass::HashRefInflator'); my $first = $cds->first; $first will not be a hashref, it will be a normal CD row since HashRefInflator only affects resultsets at inflation time, and prefetch causes relations to be inflated when the master $artist row is inflated. o Column value inflation, e.g., using modules like DBIx::Class::InflateColumn::DateTime, is not performed. The returned hash contains the raw database values. perl v5.18.2 2013-12-16 DBIx::Class::ResultClass::HashRefInflator(3)

Check Out this Related Man Page

DBIx::Class::Manual::ResultClass(3)			User Contributed Perl Documentation		       DBIx::Class::Manual::ResultClass(3)

NAME
DBIx::Class::Manual::ResultClass - Representing a single result (row) from a DB query SYNOPSIS
package My::Schema::Result::Track; use parent 'DBIx::Class::Core'; __PACKAGE__->table('tracks'); __PACKAGE__->add_columns({ id => { data_type => 'int', is_auto_increment => 1, }, cd_id => { data_type => 'int', }, title => { data_type => 'varchar', size => 50, }, rank => { data_type => 'int', is_nullable => 1, }, }); __PACKAGE__->set_primary_key('id'); __PACKAGE__->add_unique_constraint(u_title => ['cd_id', 'title']); DESCRIPTION
In DBIx::Class, a user normally receives query results as instances of a certain "Result Class", depending on the main query source. Besides being the primary "toolset" for interaction with your data, a "Result Class" also serves to establish source metadata, which is then used during initialization of your DBIx::Class::Schema instance. Because of these multiple seemingly conflicting purposes, it is hard to aggregate the documentation of various methods available on a typical "Result Class". This document serves as a general overview of "Result Class" declaration best practices, and offers an index of the available methods (and the Components/Roles which provide them). INHERITED METHODS
DBIx::Class::Relationship has_many, has_one, might_have, belongs_to, many_to_many DBIx::Class::Relationship::Base register_relationship, count_related, create_related, delete_related, find_or_create_related, find_or_new_related, find_related, new_related, related_resultset, search_related, search_related_rs, set_from_related, update_from_related, update_or_create_related DBIx::Class::InflateColumn get_inflated_column, inflate_column, set_inflated_column, store_inflated_column DBIx::Class::PK ID, id, ident_condition DBIx::Class::Row delete, update, copy, discard_changes, get_column, get_columns, get_dirty_columns, get_from_storage, get_inflated_columns, has_column_loaded, in_storage, inflate_result, insert, insert_or_update, is_changed, is_column_changed, make_column_dirty, new, register_column, result_source, set_column, set_columns, set_inflated_columns, store_column, throw_exception, update_or_insert DBIx::Class::ResultSourceProxy::Table table, table_class DBIx::Class::ResultSource add_column, add_columns, add_relationship, add_unique_constraint, add_unique_constraints, column_info, column_info_from_storage, columns, columns_info, has_column, has_relationship, primary_columns, relationship_info, relationships, remove_column, remove_columns, result_class, resultset_attributes, resultset_class, sequence, set_primary_key, source_info, source_name, unique_constraint_columns, unique_constraint_names, unique_constraints AUTHOR AND CONTRIBUTORS
See AUTHOR and CONTRIBUTORS in DBIx::Class LICENSE
You may distribute this code under the same terms as Perl itself. perl v5.18.2 2014-01-30 DBIx::Class::Manual::ResultClass(3)
Man Page