Commit | Line | Data |
3d4c5a84 |
1 | |
2 | =head1 NAME |
3 | |
4 | DBIx::Class::Manual::ResultClass - Representing a single result (row) from |
5 | a DB query |
6 | |
7 | =head1 SYNOPSIS |
8 | |
9 | package My::Schema::Result::Track; |
10 | |
11 | use parent 'DBIx::Class::Core'; |
12 | |
13 | __PACKAGE__->table('tracks'); |
14 | |
15 | __PACKAGE__->add_columns({ |
16 | id => { |
17 | data_type => 'int', |
18 | is_auto_increment => 1, |
19 | }, |
20 | cd_id => { |
21 | data_type => 'int', |
22 | }, |
23 | title => { |
24 | data_type => 'varchar', |
25 | size => 50, |
26 | }, |
27 | rank => { |
28 | data_type => 'int', |
29 | is_nullable => 1, |
30 | }, |
31 | }); |
32 | |
33 | __PACKAGE__->set_primary_key('id'); |
34 | __PACKAGE__->add_unique_constraint(u_title => ['cd_id', 'title']); |
35 | |
36 | =head1 DESCRIPTION |
37 | |
38 | In L<DBIx::Class>, a user normally receives query results as instances of a |
39 | certain C<Result Class>, depending on the main query source. Besides being |
40 | the primary "toolset" for interaction with your data, a C<Result Class> also |
41 | serves to establish source metadata, which is then used during initialization |
42 | of your L<DBIx::Class::Schema> instance. |
43 | |
44 | Because of these multiple seemingly conflicting purposes, it is hard to |
45 | aggregate the documentation of various methods available on a typical |
46 | C<Result Class>. This document serves as a general overview of C<Result Class> |
47 | declaration best practices, and offers an index of the available methods |
48 | (and the Components/Roles which provide them). |
49 | |
50 | =head1 AUTHOR AND CONTRIBUTORS |
51 | |
52 | See L<AUTHOR|DBIx::Class/AUTHOR> and L<CONTRIBUTORS|DBIx::Class/CONTRIBUTORS> in DBIx::Class |
53 | |
54 | =head1 LICENSE |
55 | |
56 | You may distribute this code under the same terms as Perl itself. |