Changes and version bump for release plus a missing add
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class.pm
index 4dba9d1..1359766 100644 (file)
@@ -4,51 +4,37 @@ use strict;
 use warnings;
 
 use vars qw($VERSION);
-use base;
-
-$VERSION = '0.01';
-
-sub load_components {
-  my $class = shift;
-  my @comp = map { "DBIx::Class::$_" } grep { $_ !~ /^#/ } @_;
-  $class->_load_components(@comp);
-}
-
-sub load_own_components {
-  my $class = shift;
-  my @comp = map { "${class}::$_" } grep { $_ !~ /^#/ } @_;
-  $class->_load_components(@comp);
-}
-
-sub _load_components {
-  my ($class, @comp) = @_;
-  foreach my $comp (@comp) {
-    eval "use $comp";
-    die $@ if $@;
-  }
-  no strict 'refs';
-  unshift(@{"${class}::ISA"}, @comp);
-}
+use base qw/DBIx::Class::Componentised Class::Data::Accessor/;
+
+sub mk_classdata { shift->mk_classaccessor(@_); }
+sub component_base_class { 'DBIx::Class' }
+
+# Always remember to do all digits for the version even if they're 0
+# i.e. first release of 0.XX *must* be 0.XX000. This avoids fBSD ports
+# brain damage and presumably various other packaging systems too
+
+$VERSION = '0.04999_04';
 
 1;
 
 =head1 NAME 
 
-DBIx::Class - Because the brain is a terrible thing to waste.
+DBIx::Class - Extensible and flexible object <-> relational mapper.
 
 =head1 SYNOPSIS
 
 =head1 DESCRIPTION
 
-This is a sql to oop mapper, inspired by the L<Class::DBI> framework, 
+This is an SQL to OO mapper, inspired by the L<Class::DBI> framework, 
 and meant to support compability with it, while restructuring the 
-insides, and making it possible to support some new features like 
+internals and making it possible to support some new features like 
 self-joins, distinct, group bys and more.
 
-It's currently considered EXPERIMENTAL - bring this near a production
-database at your own risk! The API is *not* fixed yet, although most of
-the primitives should be good for the future and any API changes will be
-posted to the mailing list before they're committed.
+This project is still at an early stage, so the maintainers don't make
+any absolute promise that full backwards-compatibility will be supported;
+however, if we can without compromising the improvements we're trying to
+make, we will, and any non-compatible changes will merit a full justification
+on the mailing list and a CPAN developer release for people to test against.
 
 The community can be found via -
 
@@ -62,37 +48,91 @@ The community can be found via -
 
 =head1 QUICKSTART
 
-If you're using Class::DBI, replacing
+If you're using L<Class::DBI>, and want an easy and fast way of migrating to
+DBIx::Class, take a look at L<DBIx::Class::CDBICompat>.
+
+There are two ways of using DBIx::Class, the "simple" way and the "schema" way.
+The "simple" way of using DBIx::Class needs less classes than the "schema"
+way but doesn't give you the ability to easily use different database connections.
+
+Some examples where different database connections are useful are:
+
+different users with different rights
+different databases with the same schema.
+
+=head2 Simple
 
-  use base qw/Class::DBI/;
+First you need to create a base class which all other classes will inherit from.
+See L<DBIx::Class::DB> for information on how to do this.
 
-with
+Then you need to create a class for every table you want to use with DBIx::Class.
+See L<DBIx::Class::Table> for information on how to do this.
 
-  use base qw/DBIx::Class/;
-  __PACKAGE__->load_components(qw/CDBICompat Core DB/);
+=head2 Schema
 
-will probably get you started.
+With this approach, the table classes inherit directly from DBIx::Class::Core,
+although it might be a good idea to create a "parent" class for all table
+classes that inherits from DBIx::Class::Core and adds additional methods
+needed by all table classes, e.g. reading a config file or loading auto primary
+key support.
 
-If you're using AUTO_INCREMENT for your primary columns, you'll also want
-yo load the approriate PK::Auto subclass - e.g.
+Look at L<DBIx::Class::Schema> for information on how to do this.
 
-  __PACKAGE__->load_components(qw/CDBICompat PK::Auto::SQLite Core DB/);
+If you need more help, check out the introduction in the 
+manual below.
 
-(with is what ::Test::SQLite does to present the Class::DBI::Test::SQLite
-interface)
+=head1 SEE ALSO
 
-If you fancy playing around with DBIx::Class from scratch, then read the docs
-for ::Table and ::Relationship,
+=head2 L<DBIx::Class::Core> - DBIC Core Classes
 
-  use base qw/DBIx::Class/;
-  __PACKAGE__->load_components(qw/Core DB/);
+=head2 L<DBIx::Class::Manual> - User's manual
 
-and have a look at t/lib/DBICTest.pm for a brief example.
+=head2 L<DBIx::Class::CDBICompat> - L<Class::DBI> Compat layer
 
-=head1 AUTHORS
+=head2 L<DBIx::Class::DB> - database-level methods
+
+=head2 L<DBIx::Class::Table> - table-level methods
+
+=head2 L<DBIx::Class::Row> - row-level methods
+
+=head2 L<DBIx::Class::PK> - primary key methods
+
+=head2 L<DBIx::Class::ResultSet> - search result-set methods
+
+=head2 L<DBIx::Class::Relationship> - relationships between tables
+
+=head1 AUTHOR
 
 Matt S. Trout <mst@shadowcatsystems.co.uk>
 
+=head1 CONTRIBUTORS
+
+Andy Grundman <andy@hybridized.org>
+
+Brian Cassidy <bricas@cpan.org>
+
+Dan Kubb <dan.kubb-cpan@onautopilot.com>
+
+Dan Sully <daniel@cpan.org>
+
+David Kamholz <dkamholz@cpan.org>
+
+Jules Bean
+
+Marcus Ramberg <mramberg@cpan.org>
+
+Paul Makepeace
+
+CL Kao
+
+Jess Robinson
+
+Marcus Ramberg
+
+Will Hawes
+
+Todd Lipcon
+
 =head1 LICENSE
 
 You may distribute this code under the same terms as Perl itself.