[Bast-commits] r8051 - in DBIx-Class/0.08/trunk:
examples/Schema/MyDatabase/Main/Result lib/DBIx
lib/DBIx/Class lib/DBIx/Class/InflateColumn
lib/DBIx/Class/Manual lib/DBIx/Class/PK
lib/DBIx/Class/ResultSource lib/DBIx/Class/Schema
lib/DBIx/Class/Storage/DBI lib/DBIx/Class/Storage/DBI/ODBC
lib/DBIx/Class/Storage/DBI/Oracle t t/lib
t/lib/DBICNSTest/Bogus t/lib/DBICNSTest/OtherRslt
t/lib/DBICNSTest/Result t/lib/DBICNSTest/Rslt
t/lib/DBICNSTest/RtBug41083/Schema
t/lib/DBICNSTest/RtBug41083/Schema_A t/lib/DBICTest
t/lib/DBICTest/ResultSetManager
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Wed Dec 9 01:33:33 GMT 2009
Author: ribasushi
Date: 2009-12-09 01:33:30 +0000 (Wed, 09 Dec 2009)
New Revision: 8051
Modified:
DBIx-Class/0.08/trunk/examples/Schema/MyDatabase/Main/Result/Artist.pm
DBIx-Class/0.08/trunk/examples/Schema/MyDatabase/Main/Result/Cd.pm
DBIx-Class/0.08/trunk/examples/Schema/MyDatabase/Main/Result/Track.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/Core.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/InflateColumn.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/InflateColumn/DateTime.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/InflateColumn/File.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Component.pod
DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Cookbook.pod
DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Example.pod
DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Intro.pod
DBIx-Class/0.08/trunk/lib/DBIx/Class/PK/Auto.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSource.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSource/View.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema/Versioned.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/DB2.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/ODBC.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/ODBC/DB2_400_SQL.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Oracle.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Pg.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/SQLite.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/UTF8Columns.pm
DBIx-Class/0.08/trunk/t/20setuperrors.t
DBIx-Class/0.08/trunk/t/72pg.t
DBIx-Class/0.08/trunk/t/lib/DBICNSTest/Bogus/A.pm
DBIx-Class/0.08/trunk/t/lib/DBICNSTest/Bogus/B.pm
DBIx-Class/0.08/trunk/t/lib/DBICNSTest/OtherRslt/D.pm
DBIx-Class/0.08/trunk/t/lib/DBICNSTest/Result/A.pm
DBIx-Class/0.08/trunk/t/lib/DBICNSTest/Result/B.pm
DBIx-Class/0.08/trunk/t/lib/DBICNSTest/Rslt/A.pm
DBIx-Class/0.08/trunk/t/lib/DBICNSTest/Rslt/B.pm
DBIx-Class/0.08/trunk/t/lib/DBICNSTest/RtBug41083/Schema/Foo.pm
DBIx-Class/0.08/trunk/t/lib/DBICNSTest/RtBug41083/Schema_A/A.pm
DBIx-Class/0.08/trunk/t/lib/DBICTest/BaseResult.pm
DBIx-Class/0.08/trunk/t/lib/DBICTest/ResultSetManager/Foo.pm
DBIx-Class/0.08/trunk/t/lib/DBICVersionNew.pm
DBIx-Class/0.08/trunk/t/lib/DBICVersionOrig.pm
Log:
It's almost 2010 - load_components ('Core') is like ewwww
Modified: DBIx-Class/0.08/trunk/examples/Schema/MyDatabase/Main/Result/Artist.pm
===================================================================
--- DBIx-Class/0.08/trunk/examples/Schema/MyDatabase/Main/Result/Artist.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/examples/Schema/MyDatabase/Main/Result/Artist.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -1,9 +1,16 @@
package MyDatabase::Main::Result::Artist;
-use base qw/DBIx::Class/;
-__PACKAGE__->load_components(qw/PK::Auto Core/);
+
+use warnings;
+use strict;
+
+use base qw/DBIx::Class::Core/;
+
__PACKAGE__->table('artist');
+
__PACKAGE__->add_columns(qw/ artistid name /);
+
__PACKAGE__->set_primary_key('artistid');
+
__PACKAGE__->has_many('cds' => 'MyDatabase::Main::Result::Cd');
1;
Modified: DBIx-Class/0.08/trunk/examples/Schema/MyDatabase/Main/Result/Cd.pm
===================================================================
--- DBIx-Class/0.08/trunk/examples/Schema/MyDatabase/Main/Result/Cd.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/examples/Schema/MyDatabase/Main/Result/Cd.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -1,9 +1,16 @@
package MyDatabase::Main::Result::Cd;
-use base qw/DBIx::Class/;
-__PACKAGE__->load_components(qw/PK::Auto Core/);
+
+use warnings;
+use strict;
+
+use base qw/DBIx::Class::Core/;
+
__PACKAGE__->table('cd');
+
__PACKAGE__->add_columns(qw/ cdid artist title/);
+
__PACKAGE__->set_primary_key('cdid');
+
__PACKAGE__->belongs_to('artist' => 'MyDatabase::Main::Result::Artist');
__PACKAGE__->has_many('tracks' => 'MyDatabase::Main::Result::Track');
Modified: DBIx-Class/0.08/trunk/examples/Schema/MyDatabase/Main/Result/Track.pm
===================================================================
--- DBIx-Class/0.08/trunk/examples/Schema/MyDatabase/Main/Result/Track.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/examples/Schema/MyDatabase/Main/Result/Track.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -1,9 +1,16 @@
package MyDatabase::Main::Result::Track;
-use base qw/DBIx::Class/;
-__PACKAGE__->load_components(qw/PK::Auto Core/);
+
+use warnings;
+use strict;
+
+use base qw/DBIx::Class::Core/;
+
__PACKAGE__->table('track');
+
__PACKAGE__->add_columns(qw/ trackid cd title/);
+
__PACKAGE__->set_primary_key('trackid');
+
__PACKAGE__->belongs_to('cd' => 'MyDatabase::Main::Result::Cd');
1;
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Core.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Core.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Core.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -22,8 +22,8 @@
=head1 SYNOPSIS
- # In your table classes
- __PACKAGE__->load_components(qw/Core/);
+ # In your result (table) classes
+ use base 'DBIx::Class::Core';
=head1 DESCRIPTION
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/InflateColumn/DateTime.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/InflateColumn/DateTime.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/InflateColumn/DateTime.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -15,15 +15,14 @@
columns to be of the datetime, timestamp or date datatype.
package Event;
- __PACKAGE__->load_components(qw/InflateColumn::DateTime Core/);
+ use base 'DBIx::Class::Core';
+
+ __PACKAGE__->load_components(qw/InflateColumn::DateTime/);
__PACKAGE__->add_columns(
starts_when => { data_type => 'datetime' }
create_date => { data_type => 'date' }
);
-NOTE: You B<must> load C<InflateColumn::DateTime> B<before> C<Core>. See
-L<DBIx::Class::Manual::Component> for details.
-
Then you can treat the specified column as a L<DateTime> object.
print "This event starts the month of ".
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/InflateColumn/File.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/InflateColumn/File.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/InflateColumn/File.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -113,8 +113,10 @@
In your L<DBIx::Class> table class:
- __PACKAGE__->load_components( "PK::Auto", "InflateColumn::File", "Core" );
+ use base 'DBIx::Class::Core';
+ __PACKAGE__->load_components(qw/InflateColumn::File/);
+
# define your columns
__PACKAGE__->add_columns(
"id",
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/InflateColumn.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/InflateColumn.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/InflateColumn.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -178,7 +178,7 @@
=over 4
=item L<DBIx::Class::Core> - This component is loaded as part of the
- "core" L<DBIx::Class> components; generally there is no need to
+ C<core> L<DBIx::Class> components; generally there is no need to
load it directly
=back
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Component.pod
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Component.pod 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Component.pod 2009-12-09 01:33:30 UTC (rev 8051)
@@ -12,31 +12,29 @@
=head1 USING
-Components are loaded using the load_components() method within your
+Components are loaded using the load_components() method within your
DBIx::Class classes.
package My::Thing;
- use base qw( DBIx::Class );
- __PACKAGE__->load_components(qw/ PK::Auto Core /);
+ use base qw( DBIx::Class::Core );
+ __PACKAGE__->load_components(qw/InflateColumn::DateTime TimeStamp/);
-Generally you do not want to specify the full package name
-of a component, instead take off the DBIx::Class:: part of
-it and just include the rest. If you do want to load a
-component outside of the normal namespace you can do so
+Generally you do not want to specify the full package name
+of a component, instead take off the DBIx::Class:: part of
+it and just include the rest. If you do want to load a
+component outside of the normal namespace you can do so
by prepending the component name with a +.
__PACKAGE__->load_components(qw/ +My::Component /);
-Once a component is loaded all of it's methods, or otherwise,
+Once a component is loaded all of it's methods, or otherwise,
that it provides will be available in your class.
-The order in which is you load the components may be
-very important, depending on the component. The general
-rule of thumb is to first load extra components and then
-load core ones last. If you are not sure, then read the
-docs for the components you are using and see if they
-mention anything about the order in which you should load
-them.
+The order in which is you load the components may be very
+important, depending on the component. If you are not sure,
+then read the docs for the components you are using and see
+if they mention anything about the order in which you should
+load them.
=head1 CREATING COMPONENTS
@@ -47,11 +45,11 @@
# Create methods, accessors, load other components, etc.
1;
-When a component is loaded it is included in the calling
-class' inheritance chain using L<Class::C3>. As well as
-providing custom utility methods, a component may also
-override methods provided by other core components, like
-L<DBIx::Class::Row> and others. For example, you
+When a component is loaded it is included in the calling
+class' inheritance chain using L<Class::C3>. As well as
+providing custom utility methods, a component may also
+override methods provided by other core components, like
+L<DBIx::Class::Row> and others. For example, you
could override the insert and delete methods.
sub insert {
@@ -108,22 +106,22 @@
=head2 Experimental
-These components are under development, there interfaces may
-change, they may not work, etc. So, use them if you want, but
+These components are under development, there interfaces may
+change, they may not work, etc. So, use them if you want, but
be warned.
L<DBIx::Class::Validation> - Validate all data before submitting to your database.
=head2 Core
-These are the components that all, or nearly all, people will use
-without even knowing it. These components provide most of
+These are the components that all, or nearly all, people will use
+without even knowing it. These components provide most of
DBIx::Class' functionality.
-L<DBIx::Class::AccessorGroup> - Lets you build groups of accessors.
-
L<DBIx::Class::Core> - Loads various components that "most people" would want.
+L<DBIx::Class::AccessorGroup> - Lets you build groups of accessors.
+
L<DBIx::Class::DB> - Non-recommended classdata schema component.
L<DBIx::Class::InflateColumn> - Automatically create objects from column data.
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Cookbook.pod
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Cookbook.pod 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Cookbook.pod 2009-12-09 01:33:30 UTC (rev 8051)
@@ -113,9 +113,8 @@
package My::Schema::Result::UserFriendsComplex;
use strict;
use warnings;
- use base qw/DBIx::Class/;
+ use base qw/DBIx::Class::Core/;
- __PACKAGE__->load_components('Core');
__PACKAGE__->table_class('DBIx::Class::ResultSource::View');
# ->table, ->add_columns, etc.
@@ -395,7 +394,7 @@
for you, in your My::DBIC::Schema::CD class:
# class definition as normal
- __PACKAGE__->load_components(qw/ Core /);
+ use base 'DBIx::Class::Core';
__PACKAGE__->table('cd');
# tell DBIC to use the custom ResultSet class
@@ -842,13 +841,11 @@
use strict;
use warnings;
- use base qw/DBIx::Class/;
+ use base qw/DBIx::Class::Core/;
### Define what our admin class is, for ensure_class_loaded()
my $admin_class = __PACKAGE__ . '::Admin';
- __PACKAGE__->load_components(qw/Core/);
-
__PACKAGE__->table('users');
__PACKAGE__->add_columns(qw/user_id email password
@@ -1090,8 +1087,7 @@
This is straightforward using L<ManyToMany|DBIx::Class::Relationship/many_to_many>:
package My::User;
- use base 'DBIx::Class';
- __PACKAGE__->load_components('Core');
+ use base 'DBIx::Class::Core';
__PACKAGE__->table('user');
__PACKAGE__->add_columns(qw/id name/);
__PACKAGE__->set_primary_key('id');
@@ -1099,8 +1095,7 @@
__PACKAGE__->many_to_many('addresses' => 'user_address', 'address');
package My::UserAddress;
- use base 'DBIx::Class';
- __PACKAGE__->load_components('Core');
+ use base 'DBIx::Class::Core';
__PACKAGE__->table('user_address');
__PACKAGE__->add_columns(qw/user address/);
__PACKAGE__->set_primary_key(qw/user address/);
@@ -1108,8 +1103,7 @@
__PACKAGE__->belongs_to('address' => 'My::Address');
package My::Address;
- use base 'DBIx::Class';
- __PACKAGE__->load_components('Core');
+ use base 'DBIx::Class::Core';
__PACKAGE__->table('address');
__PACKAGE__->add_columns(qw/id street town area_code country/);
__PACKAGE__->set_primary_key('id');
@@ -1140,8 +1134,7 @@
declaration, like so...
package MyDatabase::Main::Artist;
- use base qw/DBIx::Class/;
- __PACKAGE__->load_components(qw/PK::Auto Core/);
+ use base qw/DBIx::Class::Core/;
__PACKAGE__->table('database1.artist'); # will use "database1.artist" in FROM clause
@@ -1426,8 +1419,7 @@
package MyAppDB::Dual;
use strict;
use warnings;
- use base 'DBIx::Class';
- __PACKAGE__->load_components("Core");
+ use base 'DBIx::Class::Core';
__PACKAGE__->table("Dual");
__PACKAGE__->add_columns(
"dummy",
@@ -2012,15 +2004,15 @@
Typically L<DBIx::Class> result classes start off with
- use base qw/DBIx::Class/;
- __PACKAGE__->load_components(qw/InflateColumn::DateTime Core/);
+ use base qw/DBIx::Class::Core/;
+ __PACKAGE__->load_components(qw/InflateColumn::DateTime/);
If this preamble is moved into a common base class:-
package MyDBICbase;
- use base qw/DBIx::Class/;
- __PACKAGE__->load_components(qw/InflateColumn::DateTime Core/);
+ use base qw/DBIx::Class::Core/;
+ __PACKAGE__->load_components(qw/InflateColumn::DateTime/);
1;
and each result class then uses this as a base:-
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Example.pod
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Example.pod 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Example.pod 2009-12-09 01:33:30 UTC (rev 8051)
@@ -89,8 +89,7 @@
MyDatabase/Main/Result/Artist.pm:
package MyDatabase::Main::Result::Artist;
- use base qw/DBIx::Class/;
- __PACKAGE__->load_components(qw/Core/);
+ use base qw/DBIx::Class::Core/;
__PACKAGE__->table('artist');
__PACKAGE__->add_columns(qw/ artistid name /);
__PACKAGE__->set_primary_key('artistid');
@@ -102,8 +101,8 @@
MyDatabase/Main/Result/Cd.pm:
package MyDatabase::Main::Result::Cd;
- use base qw/DBIx::Class/;
- __PACKAGE__->load_components(qw/Core/);
+ use base qw/DBIx::Class::Core/;
+ __PACKAGE__->load_components(qw/InflateColumn::DateTime/);
__PACKAGE__->table('cd');
__PACKAGE__->add_columns(qw/ cdid artist title/);
__PACKAGE__->set_primary_key('cdid');
@@ -116,10 +115,9 @@
MyDatabase/Main/Result/Track.pm:
package MyDatabase::Main::Result::Track;
- use base qw/DBIx::Class/;
- __PACKAGE__->load_components(qw/Core/);
+ use base qw/DBIx::Class::Core/;
__PACKAGE__->table('track');
- __PACKAGE__->add_columns(qw/ trackid cd title/);
+ __PACKAGE__->add_columns(qw/ trackid cd title /);
__PACKAGE__->set_primary_key('trackid');
__PACKAGE__->belongs_to('cd' => 'MyDatabase::Main::Result::Cd');
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Intro.pod
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Intro.pod 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Intro.pod 2009-12-09 01:33:30 UTC (rev 8051)
@@ -105,13 +105,14 @@
Next, create each of the classes you want to load as specified above:
package My::Schema::Result::Album;
- use base qw/DBIx::Class/;
+ use base qw/DBIx::Class::Core/;
-Load any components required by each class with the load_components() method.
-This should consist of "Core" plus any additional components you want to use.
-For example, if you want to force columns to use UTF-8 encoding:
+Load any additional components you may need with the load_components() method,
+and provide component configuration if required. For example, if you want
+automatic row ordering:
- __PACKAGE__->load_components(qw/ ForceUTF8 Core /);
+ __PACKAGE__->load_components(qw/ Ordered /);
+ __PACKAGE__->position_column('rank');
Set the table for your class:
@@ -119,7 +120,7 @@
Add columns to your class:
- __PACKAGE__->add_columns(qw/ albumid artist title /);
+ __PACKAGE__->add_columns(qw/ albumid artist title rank /);
Each column can also be set up with its own accessor, data_type and other pieces
of information that it may be useful to have -- just pass C<add_columns> a hash:
@@ -145,13 +146,20 @@
is_nullable => 0,
is_auto_increment => 0,
default_value => '',
+ },
+ rank =>
+ { data_type => 'integer',
+ size => 16,
+ is_nullable => 0,
+ is_auto_increment => 0,
+ default_value => '',
}
);
DBIx::Class doesn't directly use most of this data yet, but various related
modules such as L<DBIx::Class::WebForm> make use of it. Also it allows you to
create your database tables from your Schema, instead of the other way around.
-See L<SQL::Translator> for details.
+See L<DBIx::Class::Schema/deploy> for details.
See L<DBIx::Class::ResultSource> for more details of the possible column
attributes.
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/PK/Auto.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/PK/Auto.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/PK/Auto.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -11,7 +11,7 @@
=head1 SYNOPSIS
-__PACKAGE__->load_components(qw/Core/);
+use base 'DBIx::Class::Core';
__PACKAGE__->set_primary_key('id');
=head1 DESCRIPTION
@@ -19,8 +19,6 @@
This class overrides the insert method to get automatically incremented primary
keys.
- __PACKAGE__->load_components(qw/Core/);
-
PK::Auto is now part of Core.
See L<DBIx::Class::Manual::Component> for details of component interactions.
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSource/View.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSource/View.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSource/View.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -19,9 +19,8 @@
package MyDB::Schema::Result::Year2000CDs;
- use base qw/DBIx::Class/;
+ use base qw/DBIx::Class::Core/;
- __PACKAGE__->load_components('Core');
__PACKAGE__->table_class('DBIx::Class::ResultSource::View');
__PACKAGE__->table('year2000cds');
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSource.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSource.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSource.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -28,9 +28,8 @@
# Create a table based result source, in a result class.
package MyDB::Schema::Result::Artist;
- use base qw/DBIx::Class/;
+ use base qw/DBIx::Class::Core/;
- __PACKAGE__->load_components(qw/Core/);
__PACKAGE__->table('artist');
__PACKAGE__->add_columns(qw/ artistid name /);
__PACKAGE__->set_primary_key('artistid');
@@ -40,8 +39,9 @@
# Create a query (view) based result source, in a result class
package MyDB::Schema::Result::Year2000CDs;
+ use base qw/DBIx::Class::Core/;
- __PACKAGE__->load_components('Core');
+ __PACKAGE__->load_components('InflateColumn::DateTime');
__PACKAGE__->table_class('DBIx::Class::ResultSource::View');
__PACKAGE__->table('year2000cds');
@@ -60,10 +60,10 @@
default result source type, so one is created for you when defining a
result class as described in the synopsis above.
-More specifically, the L<DBIx::Class::Core> component pulls in the
-L<DBIx::Class::ResultSourceProxy::Table> as a base class, which
-defines the L<table|DBIx::Class::ResultSourceProxy::Table/table>
-method. When called, C<table> creates and stores an instance of
+More specifically, the L<DBIx::Class::Core> base class pulls in the
+L<DBIx::Class::ResultSourceProxy::Table> component, which defines
+the L<table|DBIx::Class::ResultSourceProxy::Table/table> method.
+When called, C<table> creates and stores an instance of
L<DBIx::Class::ResultSoure::Table>. Luckily, to use tables as result
sources, you don't need to remember any of this.
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema/Versioned.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema/Versioned.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema/Versioned.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -1,10 +1,9 @@
package # Hide from PAUSE
DBIx::Class::Version::Table;
-use base 'DBIx::Class';
+use base 'DBIx::Class::Core';
use strict;
use warnings;
-__PACKAGE__->load_components(qw/ Core/);
__PACKAGE__->table('dbix_class_schema_versions');
__PACKAGE__->add_columns
@@ -31,8 +30,7 @@
package # Hide from PAUSE
DBIx::Class::Version::TableCompat;
-use base 'DBIx::Class';
-__PACKAGE__->load_components(qw/ Core/);
+use base 'DBIx::Class::Core';
__PACKAGE__->table('SchemaVersions');
__PACKAGE__->add_columns
@@ -180,7 +178,7 @@
use strict;
use warnings;
-use base 'DBIx::Class';
+use base 'DBIx::Class::Schema';
use Carp::Clan qw/^DBIx::Class/;
use POSIX 'strftime';
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -33,8 +33,9 @@
__PACKAGE__->load_namespaces();
package Library::Schema::Result::CD;
- use base qw/DBIx::Class/;
- __PACKAGE__->load_components(qw/Core/); # for example
+ use base qw/DBIx::Class::Core/;
+
+ __PACKAGE__->load_components(qw/InflateColumn::DateTime/); # for example
__PACKAGE__->table('cd');
# Elsewhere in your code:
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/DB2.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/DB2.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/DB2.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -38,7 +38,7 @@
=head1 SYNOPSIS
# In your table classes
- __PACKAGE__->load_components(qw/PK::Auto Core/);
+ use base 'DBIx::Class::Core';
__PACKAGE__->set_primary_key('id');
=head1 DESCRIPTION
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/ODBC/DB2_400_SQL.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/ODBC/DB2_400_SQL.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/ODBC/DB2_400_SQL.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -43,8 +43,8 @@
=head1 SYNOPSIS
- # In your table classes
- __PACKAGE__->load_components(qw/PK::Auto Core/);
+ # In your result (table) classes
+ use base 'DBIx::Class::Core';
__PACKAGE__->set_primary_key('id');
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/ODBC.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/ODBC.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/ODBC.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -36,18 +36,11 @@
DBIx::Class::Storage::DBI::ODBC - Base class for ODBC drivers
-=head1 SYNOPSIS
-
- # In your table classes
- __PACKAGE__->load_components(qw/Core/);
-
-
=head1 DESCRIPTION
This class simply provides a mechanism for discovering and loading a sub-class
for a specific ODBC backend. It should be transparent to the user.
-
=head1 AUTHORS
Marc Mims C<< <marc at questright.com> >>
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -9,8 +9,8 @@
=head1 SYNOPSIS
- # In your table classes
- __PACKAGE__->load_components(qw/PK::Auto Core/);
+ # In your result (table) classes
+ use base 'DBIx::Class::Core';
__PACKAGE__->add_columns({ id => { sequence => 'mysequence', auto_nextval => 1 } });
__PACKAGE__->set_primary_key('id');
__PACKAGE__->sequence('mysequence');
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Oracle.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Oracle.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Oracle.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -30,11 +30,6 @@
DBIx::Class::Storage::DBI::Oracle - Base class for Oracle driver
-=head1 SYNOPSIS
-
- # In your table classes
- __PACKAGE__->load_components(qw/Core/);
-
=head1 DESCRIPTION
This class simply provides a mechanism for discovering and loading a sub-class
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Pg.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Pg.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Pg.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -189,8 +189,8 @@
=head1 SYNOPSIS
- # In your table classes
- __PACKAGE__->load_components(qw/PK::Auto Core/);
+ # In your result (table) classes
+ use base 'DBIx::Class::Core';
__PACKAGE__->set_primary_key('id');
__PACKAGE__->sequence('mysequence');
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/SQLite.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/SQLite.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/SQLite.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -74,7 +74,7 @@
=head1 SYNOPSIS
# In your table classes
- __PACKAGE__->load_components(qw/PK::Auto Core/);
+ use base 'DBIx::Class::Core';
__PACKAGE__->set_primary_key('id');
=head1 DESCRIPTION
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/UTF8Columns.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/UTF8Columns.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/UTF8Columns.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -23,7 +23,9 @@
=head1 SYNOPSIS
package Artist;
- __PACKAGE__->load_components(qw/UTF8Columns Core/);
+ use base 'DBIx::Class::Core';
+
+ __PACKAGE__->load_components(qw/UTF8Columns/);
__PACKAGE__->utf8_columns(qw/name description/);
# then belows return strings with utf8 flag
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -78,9 +78,8 @@
See L<DBIx::Class::ResultSource> for docs on defining result classes.
package MyDB::Schema::Result::Artist;
- use base qw/DBIx::Class/;
+ use base qw/DBIx::Class::Core/;
- __PACKAGE__->load_components(qw/Core/);
__PACKAGE__->table('artist');
__PACKAGE__->add_columns(qw/ artistid name /);
__PACKAGE__->set_primary_key('artistid');
@@ -92,9 +91,9 @@
MyDB/Schema/Result/CD.pm:
package MyDB::Schema::Result::CD;
- use base qw/DBIx::Class/;
+ use base qw/DBIx::Class::Core/;
- __PACKAGE__->load_components(qw/Core/);
+ __PACKAGE__->load_components(qw/InflateColumn::DateTime/);
__PACKAGE__->table('cd');
__PACKAGE__->add_columns(qw/ cdid artistid title year /);
__PACKAGE__->set_primary_key('cdid');
Modified: DBIx-Class/0.08/trunk/t/20setuperrors.t
===================================================================
--- DBIx-Class/0.08/trunk/t/20setuperrors.t 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/t/20setuperrors.t 2009-12-09 01:33:30 UTC (rev 8051)
@@ -1,15 +1,19 @@
-#!/usr/bin/perl
+use warnings;
+use strict;
-use Test::More tests => 1;
+use Test::More;
+use Test::Exception;
-eval {
- package BuggyTable;
- use base 'DBIx::Class';
+throws_ok (
+ sub {
+ package BuggyTable;
+ use base 'DBIx::Class::Core';
- __PACKAGE__->load_components qw/Core/;
- __PACKAGE__->table('buggy_table');
- __PACKAGE__->columns qw/this doesnt work as expected/;
-};
+ __PACKAGE__->table('buggy_table');
+ __PACKAGE__->columns qw/this doesnt work as expected/;
+ },
+ qr/\bcolumns\(\) is a read-only/,
+ 'columns() error when apparently misused',
+);
-like($@,qr/\bcolumns\(\) is a read-only/,
- "columns() error when apparently misused");
+done_testing;
Modified: DBIx-Class/0.08/trunk/t/72pg.t
===================================================================
--- DBIx-Class/0.08/trunk/t/72pg.t 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/t/72pg.t 2009-12-09 01:33:30 UTC (rev 8051)
@@ -126,9 +126,8 @@
use strict;
use warnings;
- use base 'DBIx::Class';
+ use base 'DBIx::Class::Core';
- __PACKAGE__->load_components(qw/Core/);
__PACKAGE__->table('dbic_t_schema.array_test');
__PACKAGE__->add_columns(qw/id arrayfield/);
__PACKAGE__->column_info_from_storage(1);
@@ -173,9 +172,8 @@
use strict;
use warnings;
- use base 'DBIx::Class';
+ use base 'DBIx::Class::Core';
- __PACKAGE__->load_components(qw/Core/);
__PACKAGE__->table('dbic_t_schema.casecheck');
__PACKAGE__->add_columns(qw/id name NAME uc_name/);
__PACKAGE__->column_info_from_storage(1);
@@ -455,9 +453,8 @@
use strict;
use warnings;
- use base 'DBIx::Class';
+ use base 'DBIx::Class::Core';
- __PACKAGE__->load_components(qw/Core/);
__PACKAGE__->table('apk');
@eapk_id_columns = qw( id1 id2 id3 id4 );
Modified: DBIx-Class/0.08/trunk/t/lib/DBICNSTest/Bogus/A.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICNSTest/Bogus/A.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/t/lib/DBICNSTest/Bogus/A.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -1,6 +1,5 @@
package DBICNSTest::Bogus::A;
-use base qw/DBIx::Class/;
-__PACKAGE__->load_components(qw/PK::Auto Core/);
+use base qw/DBIx::Class::Core/;
__PACKAGE__->table('a');
__PACKAGE__->add_columns('a');
1;
Modified: DBIx-Class/0.08/trunk/t/lib/DBICNSTest/Bogus/B.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICNSTest/Bogus/B.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/t/lib/DBICNSTest/Bogus/B.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -1,6 +1,5 @@
package DBICNSTest::Result::B;
-use base qw/DBIx::Class/;
-__PACKAGE__->load_components(qw/PK::Auto Core/);
+use base qw/DBIx::Class::Core/;
__PACKAGE__->table('b');
__PACKAGE__->add_columns('b');
1;
Modified: DBIx-Class/0.08/trunk/t/lib/DBICNSTest/OtherRslt/D.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICNSTest/OtherRslt/D.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/t/lib/DBICNSTest/OtherRslt/D.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -1,6 +1,5 @@
package DBICNSTest::OtherRslt::D;
-use base qw/DBIx::Class/;
-__PACKAGE__->load_components(qw/PK::Auto Core/);
+use base qw/DBIx::Class::Core/;
__PACKAGE__->table('d');
__PACKAGE__->add_columns('d');
1;
Modified: DBIx-Class/0.08/trunk/t/lib/DBICNSTest/Result/A.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICNSTest/Result/A.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/t/lib/DBICNSTest/Result/A.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -1,6 +1,5 @@
package DBICNSTest::Result::A;
-use base qw/DBIx::Class/;
-__PACKAGE__->load_components(qw/PK::Auto Core/);
+use base qw/DBIx::Class::Core/;
__PACKAGE__->table('a');
__PACKAGE__->add_columns('a');
1;
Modified: DBIx-Class/0.08/trunk/t/lib/DBICNSTest/Result/B.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICNSTest/Result/B.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/t/lib/DBICNSTest/Result/B.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -1,6 +1,5 @@
package DBICNSTest::Result::B;
-use base qw/DBIx::Class/;
-__PACKAGE__->load_components(qw/PK::Auto Core/);
+use base qw/DBIx::Class::Core/;
__PACKAGE__->table('b');
__PACKAGE__->add_columns('b');
1;
Modified: DBIx-Class/0.08/trunk/t/lib/DBICNSTest/Rslt/A.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICNSTest/Rslt/A.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/t/lib/DBICNSTest/Rslt/A.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -1,6 +1,5 @@
package DBICNSTest::Rslt::A;
-use base qw/DBIx::Class/;
-__PACKAGE__->load_components(qw/PK::Auto Core/);
+use base qw/DBIx::Class::Core/;
__PACKAGE__->table('a');
__PACKAGE__->add_columns('a');
1;
Modified: DBIx-Class/0.08/trunk/t/lib/DBICNSTest/Rslt/B.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICNSTest/Rslt/B.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/t/lib/DBICNSTest/Rslt/B.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -1,6 +1,5 @@
package DBICNSTest::Rslt::B;
-use base qw/DBIx::Class/;
-__PACKAGE__->load_components(qw/PK::Auto Core/);
+use base qw/DBIx::Class::Core/;
__PACKAGE__->table('b');
__PACKAGE__->add_columns('b');
1;
Modified: DBIx-Class/0.08/trunk/t/lib/DBICNSTest/RtBug41083/Schema/Foo.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICNSTest/RtBug41083/Schema/Foo.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/t/lib/DBICNSTest/RtBug41083/Schema/Foo.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -1,8 +1,7 @@
package DBICNSTest::RtBug41083::Schema::Foo;
use strict;
use warnings;
-use base 'DBIx::Class';
-__PACKAGE__->load_components('Core');
+use base 'DBIx::Class::Core';
__PACKAGE__->table('foo');
__PACKAGE__->add_columns('foo');
1;
Modified: DBIx-Class/0.08/trunk/t/lib/DBICNSTest/RtBug41083/Schema_A/A.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICNSTest/RtBug41083/Schema_A/A.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/t/lib/DBICNSTest/RtBug41083/Schema_A/A.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -1,8 +1,7 @@
package DBICNSTest::RtBug41083::Schema_A::A;
use strict;
use warnings;
-use base 'DBIx::Class';
-__PACKAGE__->load_components('Core');
+use base 'DBIx::Class::Core';
__PACKAGE__->table('a');
__PACKAGE__->add_columns('a');
1;
Modified: DBIx-Class/0.08/trunk/t/lib/DBICTest/BaseResult.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICTest/BaseResult.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/t/lib/DBICTest/BaseResult.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -4,10 +4,9 @@
use strict;
use warnings;
-use base qw/DBIx::Class/;
+use base qw/DBIx::Class::Core/;
use DBICTest::BaseResultSet;
-__PACKAGE__->load_components (qw/Core/);
__PACKAGE__->table ('bogus');
__PACKAGE__->resultset_class ('DBICTest::BaseResultSet');
Modified: DBIx-Class/0.08/trunk/t/lib/DBICTest/ResultSetManager/Foo.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICTest/ResultSetManager/Foo.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/t/lib/DBICTest/ResultSetManager/Foo.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -1,8 +1,8 @@
package # hide from PAUSE
DBICTest::ResultSetManager::Foo;
-use base 'DBIx::Class';
+use base 'DBIx::Class::Core';
-__PACKAGE__->load_components(qw/ ResultSetManager Core /);
+__PACKAGE__->load_components(qw/ ResultSetManager /);
__PACKAGE__->table('foo');
sub bar : ResultSet { 'good' }
Modified: DBIx-Class/0.08/trunk/t/lib/DBICVersionNew.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICVersionNew.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/t/lib/DBICVersionNew.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -1,10 +1,9 @@
package DBICVersion::Table;
-use base 'DBIx::Class';
+use base 'DBIx::Class::Core';
use strict;
use warnings;
-__PACKAGE__->load_components(qw/ Core/);
__PACKAGE__->table('TestVersion');
__PACKAGE__->add_columns
Modified: DBIx-Class/0.08/trunk/t/lib/DBICVersionOrig.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICVersionOrig.pm 2009-12-09 00:24:45 UTC (rev 8050)
+++ DBIx-Class/0.08/trunk/t/lib/DBICVersionOrig.pm 2009-12-09 01:33:30 UTC (rev 8051)
@@ -1,10 +1,9 @@
package DBICVersion::Table;
-use base 'DBIx::Class';
+use base 'DBIx::Class::Core';
use strict;
use warnings;
-__PACKAGE__->load_components(qw/ Core/);
__PACKAGE__->table('TestVersion');
__PACKAGE__->add_columns
More information about the Bast-commits
mailing list