X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass.pm;h=8966c98247dbfbbdcee54dce7fbb7c39d9c25c9b;hb=7fcaa6a76764758db15e4bcc5c59433e555999d2;hp=bcba15f182dc59195acf97750cf486b76affeaff;hpb=a02675cd9a11e1f354220319da9f5d573a2e484a;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class.pm b/lib/DBIx/Class.pm index bcba15f..8966c98 100644 --- a/lib/DBIx/Class.pm +++ b/lib/DBIx/Class.pm @@ -4,26 +4,16 @@ use strict; use warnings; use vars qw($VERSION); -use base; +use base qw/DBIx::Class::Componentised Class::Data::Inheritable/; -$VERSION = '0.01'; +$VERSION = '0.04'; -sub load_components { - my $class = shift; - my @comp = map { "DBIx::Class::$_" } grep { $_ !~ /^#/ } @_; - foreach my $comp (@comp) { - eval "use $comp"; - die $@ if $@; - } - no strict 'refs'; - unshift(@{"${class}::ISA"}, @comp); -} 1; =head1 NAME -DBIx::Class - Because the brain is a terrible thing to waste. +DBIx::Class - Extensible and flexible object <-> relational mapper. =head1 SYNOPSIS @@ -34,38 +24,91 @@ and meant to support compability with it, while restructuring the insides, and making it possible to support some new features like self-joins, distinct, group bys and more. +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 - + + Mailing list: http://lists.rawmode.org/mailman/listinfo/dbix-class/ + + SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/ + + Wiki: http://dbix-class.shadowcatsystems.co.uk/ + + IRC: irc.perl.org#dbix-class + =head1 QUICKSTART -If you're using Class::DBI, replacing +If you're using Class::DBI, and want an easy and fast way of migrating to +DBIx::Class look at L. + +There are two ways of using DBIx::Class, the 'simple' and the 'schema' one. + +The 'simple' way of using DBIx::Class needs less classes than the 'schema' +way but doesn't give you the ability to use different database connections. + +Some examples where different database connections are useful are: + +different users with different rights +different databases with the same schema. + +=head1 Simple + +First you need to create a base class all other classes inherit from. + +Look at L how to do this + +Next you need to create a class for every table you want to use with +DBIx::Class. + +Look at L how to do this. + + +=head2 Schema + +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 which inherits from DBIx::Class::Core and adds additional methods +needed by all table classes, e.g. reading a config file, loading auto primary +key support. + +Look at L how to do this. + +If you need more hand-holding, check out the introduction in the +manual below. + +=head1 SEE ALSO + +=over 4 + +=item L - DBIC Core Classes -use base qw/Class::DBI/; +=item L - L Compat layer. -with +=item L - User's manual. -use base qw/DBIx::Class/; -__PACKAGE__->load_components(qw/CDBICompat Core DB/); +=back -will probably get you started. +=head1 AUTHOR -If you're using AUTO_INCREMENT for your primary columns, you'll also want -yo load the approriate PK::Auto subclass - e.g. +Matt S. Trout -__PACKAGE__->load_components(qw/CDBICompat PK::Auto::SQLite Core DB/); +=head1 CONTRIBUTORS -(with is what ::Test::SQLite does to present the Class::DBI::Test::SQLite -interface) +Andy Grundman -If you fancy playing around with DBIx::Class from scratch, then read the docs -for ::Table and ::Relationship, +Brian Cassidy -use base qw/DBIx::Class/; -__PACKAGE__->load_components(qw/Core DB/); +Dan Kubb -and have a look at t/lib/DBICTest.pm for a brief example. +Dan Sully -=head1 AUTHORS +davekam -Matt S. Trout +Marcus Ramberg =head1 LICENSE