| DBIx::Class::Manual::ResultClass(3) | User Contributed Perl Documentation | DBIx::Class::Manual::ResultClass(3) |
DBIx::Class::Manual::ResultClass - Representing a single result (row) from a DB query
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']);
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).
Check the list of additional DBIC resources.
This module is free software copyright by the DBIx::Class (DBIC) authors. You can redistribute it and/or modify it under the same terms as the DBIx::Class library.
| 2018-01-29 | perl v5.34.0 |