Commit | Line | Data |
ea2e61bf |
1 | package DBIx::Class; |
2 | |
5d283305 |
3 | use strict; |
4 | use warnings; |
5 | |
5d283305 |
6 | use vars qw($VERSION); |
3c0068c1 |
7 | use base qw/DBIx::Class::Componentised Class::Data::Accessor/; |
8 | |
9 | sub mk_classdata { shift->mk_classaccessor(@_); } |
7411204b |
10 | sub component_base_class { 'DBIx::Class' } |
227d4dee |
11 | |
95da6f35 |
12 | # Always remember to do all digits for the version even if they're 0 |
13 | # i.e. first release of 0.XX *must* be 0.XX000. This avoids fBSD ports |
14 | # brain damage and presumably various other packaging systems too |
15 | |
1346e22d |
16 | $VERSION = '0.05999_04'; |
b8777a0d |
17 | |
f0750722 |
18 | sub MODIFY_CODE_ATTRIBUTES { |
19 | my ($class,$code,@attrs) = @_; |
a58cd74b |
20 | $class->mk_classdata('__attr_cache' => {}) unless $class->can('__attr_cache'); |
da95b45f |
21 | $class->__attr_cache->{$code} = [@attrs]; |
f0750722 |
22 | return (); |
23 | } |
24 | |
da95b45f |
25 | sub _attr_cache { |
26 | my $self = shift; |
27 | my $cache = $self->can('__attr_cache') ? $self->__attr_cache : {}; |
28 | my $rest = eval { $self->next::method }; |
29 | return $@ ? $cache : { %$cache, %$rest }; |
30 | } |
31 | |
ea2e61bf |
32 | 1; |
34d52be2 |
33 | |
34 | =head1 NAME |
35 | |
7e4b2f59 |
36 | DBIx::Class - Extensible and flexible object <-> relational mapper. |
34d52be2 |
37 | |
38 | =head1 SYNOPSIS |
39 | |
40 | =head1 DESCRIPTION |
41 | |
8091aa91 |
42 | This is an SQL to OO mapper, inspired by the L<Class::DBI> framework, |
34d52be2 |
43 | and meant to support compability with it, while restructuring the |
8091aa91 |
44 | internals and making it possible to support some new features like |
34d52be2 |
45 | self-joins, distinct, group bys and more. |
46 | |
8091aa91 |
47 | This project is still at an early stage, so the maintainers don't make |
96ce20f5 |
48 | any absolute promise that full backwards-compatibility will be supported; |
8091aa91 |
49 | however, if we can without compromising the improvements we're trying to |
96ce20f5 |
50 | make, we will, and any non-compatible changes will merit a full justification |
51 | on the mailing list and a CPAN developer release for people to test against. |
daec44b8 |
52 | |
53 | The community can be found via - |
54 | |
55 | Mailing list: http://lists.rawmode.org/mailman/listinfo/dbix-class/ |
56 | |
57 | SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/ |
58 | |
59 | Wiki: http://dbix-class.shadowcatsystems.co.uk/ |
60 | |
61 | IRC: irc.perl.org#dbix-class |
62 | |
39fe0e65 |
63 | =head1 QUICKSTART |
64 | |
8091aa91 |
65 | If you're using L<Class::DBI>, and want an easy and fast way of migrating to |
66 | DBIx::Class, take a look at L<DBIx::Class::CDBICompat>. |
39fe0e65 |
67 | |
8091aa91 |
68 | There are two ways of using DBIx::Class, the "simple" way and the "schema" way. |
69 | The "simple" way of using DBIx::Class needs less classes than the "schema" |
70 | way but doesn't give you the ability to easily use different database connections. |
39fe0e65 |
71 | |
448c8424 |
72 | Some examples where different database connections are useful are: |
39fe0e65 |
73 | |
448c8424 |
74 | different users with different rights |
75 | different databases with the same schema. |
39fe0e65 |
76 | |
00787068 |
77 | =head2 Simple |
126042ee |
78 | |
8091aa91 |
79 | First you need to create a base class which all other classes will inherit from. |
80 | See L<DBIx::Class::DB> for information on how to do this. |
39fe0e65 |
81 | |
8091aa91 |
82 | Then you need to create a class for every table you want to use with DBIx::Class. |
83 | See L<DBIx::Class::Table> for information on how to do this. |
448c8424 |
84 | |
85 | =head2 Schema |
86 | |
8091aa91 |
87 | With this approach, the table classes inherit directly from DBIx::Class::Core, |
88 | although it might be a good idea to create a "parent" class for all table |
89 | classes that inherits from DBIx::Class::Core and adds additional methods |
90 | needed by all table classes, e.g. reading a config file or loading auto primary |
448c8424 |
91 | key support. |
92 | |
8091aa91 |
93 | Look at L<DBIx::Class::Schema> for information on how to do this. |
448c8424 |
94 | |
8091aa91 |
95 | If you need more help, check out the introduction in the |
448c8424 |
96 | manual below. |
39fe0e65 |
97 | |
076652e8 |
98 | =head1 SEE ALSO |
99 | |
a39e84a3 |
100 | =over 4 |
8091aa91 |
101 | |
a39e84a3 |
102 | =item L<DBIx::Class::Core> - DBIC Core Classes |
8091aa91 |
103 | |
a39e84a3 |
104 | =item L<DBIx::Class::Manual> - User's manual |
8091aa91 |
105 | |
a39e84a3 |
106 | =item L<DBIx::Class::CDBICompat> - L<Class::DBI> Compat layer |
076652e8 |
107 | |
a39e84a3 |
108 | =item L<DBIx::Class::Schema> |
076652e8 |
109 | |
a39e84a3 |
110 | =item L<DBIx::Class::ResultSet> |
076652e8 |
111 | |
a39e84a3 |
112 | =item L<DBIx::Class::ResultSource> |
076652e8 |
113 | |
a39e84a3 |
114 | =item L<DBIx::Class::Row> - row-level methods |
4db53147 |
115 | |
a39e84a3 |
116 | =item L<DBIx::Class::PK> - primary key methods |
117 | |
118 | =item L<DBIx::Class::Relationship> - relationships between tables |
119 | |
120 | =back |
076652e8 |
121 | |
3942ab4d |
122 | =head1 AUTHOR |
34d52be2 |
123 | |
daec44b8 |
124 | Matt S. Trout <mst@shadowcatsystems.co.uk> |
34d52be2 |
125 | |
3942ab4d |
126 | =head1 CONTRIBUTORS |
127 | |
84e3c114 |
128 | Alexander Hartmaier <alex_hartmaier@hotmail.com> |
129 | |
3942ab4d |
130 | Andy Grundman <andy@hybridized.org> |
131 | |
84e3c114 |
132 | Andres Kievsky |
3942ab4d |
133 | |
84e3c114 |
134 | Brandon Black |
3942ab4d |
135 | |
84e3c114 |
136 | Brian Cassidy <bricas@cpan.org> |
3942ab4d |
137 | |
84e3c114 |
138 | Christopher H. Laco |
ccb9c9b1 |
139 | |
84e3c114 |
140 | CL Kao |
3942ab4d |
141 | |
84e3c114 |
142 | Daisuke Murase <typester@cpan.org> |
3942ab4d |
143 | |
84e3c114 |
144 | Dan Kubb <dan.kubb-cpan@onautopilot.com> |
ccb9c9b1 |
145 | |
84e3c114 |
146 | Dan Sully <daniel@cpan.org> |
4685e006 |
147 | |
84e3c114 |
148 | Daniel Westermann-Clark <danieltwc@cpan.org> |
4685e006 |
149 | |
84e3c114 |
150 | David Kamholz <dkamholz@cpan.org> |
4685e006 |
151 | |
84e3c114 |
152 | Jesper Krogh |
8fe164b9 |
153 | |
84e3c114 |
154 | Jess Robinson |
ad3d2d7c |
155 | |
84e3c114 |
156 | Jules Bean |
5fb0c64c |
157 | |
84e3c114 |
158 | Justin Guenther <guentherj@agr.gc.ca> |
d7c4c15c |
159 | |
84e3c114 |
160 | Marcus Ramberg <mramberg@cpan.org> |
103e3e03 |
161 | |
6565b410 |
162 | Nigel Metheringham <nigelm@cpan.org> |
163 | |
84e3c114 |
164 | Paul Makepeace |
4763f4b7 |
165 | |
84e3c114 |
166 | Robert Sedlacek <phaylon@dunkelheit.at> |
a53b95f1 |
167 | |
84e3c114 |
168 | sc_ of irc.perl.org#dbix-class |
022e0893 |
169 | |
84e3c114 |
170 | Scott McWhirter (konobi) |
ba606e58 |
171 | |
84e3c114 |
172 | Scotty Allen <scotty@scottyallen.com> |
181a28f4 |
173 | |
84e3c114 |
174 | Todd Lipcon |
e063fe2c |
175 | |
84e3c114 |
176 | Will Hawes |
c0e7b4e5 |
177 | |
34d52be2 |
178 | =head1 LICENSE |
179 | |
180 | You may distribute this code under the same terms as Perl itself. |
181 | |
182 | =cut |
183 | |