7 use base qw/DBIx::Class::Componentised Class::Data::Accessor/;
9 sub mk_classdata { shift->mk_classaccessor(@_); }
10 sub component_base_class { 'DBIx::Class' }
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
16 $VERSION = '0.05999_04';
18 sub MODIFY_CODE_ATTRIBUTES {
19 my ($class,$code,@attrs) = @_;
20 $class->mk_classdata('__attr_cache' => {}) unless $class->can('__attr_cache');
21 $class->__attr_cache->{$code} = [@attrs];
27 my $cache = $self->can('__attr_cache') ? $self->__attr_cache : {};
28 my $rest = eval { $self->next::method };
29 return $@ ? $cache : { %$cache, %$rest };
36 DBIx::Class - Extensible and flexible object <-> relational mapper.
42 This is an SQL to OO mapper, inspired by the L<Class::DBI> framework,
43 and meant to support compability with it, while restructuring the
44 internals and making it possible to support some new features like
45 self-joins, distinct, group bys and more.
47 This project is still at an early stage, so the maintainers don't make
48 any absolute promise that full backwards-compatibility will be supported;
49 however, if we can without compromising the improvements we're trying to
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.
53 The community can be found via -
55 Mailing list: http://lists.rawmode.org/mailman/listinfo/dbix-class/
57 SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
59 Wiki: http://dbix-class.shadowcatsystems.co.uk/
61 IRC: irc.perl.org#dbix-class
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>.
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.
72 Some examples where different database connections are useful are:
74 different users with different rights
75 different databases with the same schema.
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.
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.
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
93 Look at L<DBIx::Class::Schema> for information on how to do this.
95 If you need more help, check out the introduction in the
102 =item L<DBIx::Class::Core> - DBIC Core Classes
104 =item L<DBIx::Class::Manual> - User's manual
106 =item L<DBIx::Class::CDBICompat> - L<Class::DBI> Compat layer
108 =item L<DBIx::Class::Schema>
110 =item L<DBIx::Class::ResultSet>
112 =item L<DBIx::Class::ResultSource>
114 =item L<DBIx::Class::Row> - row-level methods
116 =item L<DBIx::Class::PK> - primary key methods
118 =item L<DBIx::Class::Relationship> - relationships between tables
124 Matt S. Trout <mst@shadowcatsystems.co.uk>
128 Alexander Hartmaier <alex_hartmaier@hotmail.com>
130 Andy Grundman <andy@hybridized.org>
136 Brian Cassidy <bricas@cpan.org>
142 Daisuke Murase <typester@cpan.org>
144 Dan Kubb <dan.kubb-cpan@onautopilot.com>
146 Dan Sully <daniel@cpan.org>
148 Daniel Westermann-Clark <danieltwc@cpan.org>
150 David Kamholz <dkamholz@cpan.org>
158 Justin Guenther <guentherj@agr.gc.ca>
160 Marcus Ramberg <mramberg@cpan.org>
162 Nigel Metheringham <nigelm@cpan.org>
166 Robert Sedlacek <phaylon@dunkelheit.at>
168 sc_ of irc.perl.org#dbix-class
170 Scott McWhirter (konobi)
172 Scotty Allen <scotty@scottyallen.com>
180 You may distribute this code under the same terms as Perl itself.