Commit | Line | Data |
a0c96f24 |
1 | # |
2 | # This is what eventually becomes lib/DBIx/Class/Manual/ResultClass.pod |
3 | # Courtesy of maint/gen_pod_inherit and Pod::Inherit |
4 | # |
3d4c5a84 |
5 | |
6 | =head1 NAME |
7 | |
8 | DBIx::Class::Manual::ResultClass - Representing a single result (row) from |
9 | a DB query |
10 | |
11 | =head1 SYNOPSIS |
12 | |
13 | package My::Schema::Result::Track; |
14 | |
15 | use parent 'DBIx::Class::Core'; |
16 | |
17 | __PACKAGE__->table('tracks'); |
18 | |
19 | __PACKAGE__->add_columns({ |
20 | id => { |
21 | data_type => 'int', |
22 | is_auto_increment => 1, |
23 | }, |
24 | cd_id => { |
25 | data_type => 'int', |
26 | }, |
27 | title => { |
28 | data_type => 'varchar', |
29 | size => 50, |
30 | }, |
31 | rank => { |
32 | data_type => 'int', |
33 | is_nullable => 1, |
34 | }, |
35 | }); |
36 | |
37 | __PACKAGE__->set_primary_key('id'); |
38 | __PACKAGE__->add_unique_constraint(u_title => ['cd_id', 'title']); |
39 | |
40 | =head1 DESCRIPTION |
41 | |
42 | In L<DBIx::Class>, a user normally receives query results as instances of a |
43 | certain C<Result Class>, depending on the main query source. Besides being |
44 | the primary "toolset" for interaction with your data, a C<Result Class> also |
45 | serves to establish source metadata, which is then used during initialization |
46 | of your L<DBIx::Class::Schema> instance. |
47 | |
48 | Because of these multiple seemingly conflicting purposes, it is hard to |
49 | aggregate the documentation of various methods available on a typical |
50 | C<Result Class>. This document serves as a general overview of C<Result Class> |
51 | declaration best practices, and offers an index of the available methods |
52 | (and the Components/Roles which provide them). |
53 | |
a2bd3796 |
54 | =head1 FURTHER QUESTIONS? |
3d4c5a84 |
55 | |
a2bd3796 |
56 | Check the list of L<additional DBIC resources|DBIx::Class/GETTING HELP/SUPPORT>. |
3d4c5a84 |
57 | |
a2bd3796 |
58 | =head1 COPYRIGHT AND LICENSE |
3d4c5a84 |
59 | |
a2bd3796 |
60 | This module is free software L<copyright|DBIx::Class/COPYRIGHT AND LICENSE> |
61 | by the L<DBIx::Class (DBIC) authors|DBIx::Class/AUTHORS>. You can |
62 | redistribute it and/or modify it under the same terms as the |
63 | L<DBIx::Class library|DBIx::Class/COPYRIGHT AND LICENSE>. |