From: David Kamholz Date: Thu, 15 Dec 2005 22:59:01 +0000 (+0000) Subject: PK::Auto doc patch from dwc X-Git-Tag: v0.05005~130 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6718c5f0bf2bb9528c055b5974488a6d37f1209a;p=dbsrgits%2FDBIx-Class.git PK::Auto doc patch from dwc --- diff --git a/lib/DBIx/Class/PK/Auto.pm b/lib/DBIx/Class/PK/Auto.pm index d6dd3a5..2e3e4f3 100644 --- a/lib/DBIx/Class/PK/Auto.pm +++ b/lib/DBIx/Class/PK/Auto.pm @@ -11,18 +11,24 @@ DBIx::Class::PK::Auto - Automatic Primary Key class =head1 SYNOPSIS + # In your table classes (replace PK::Auto::SQLite with your + # database) + __PACKAGE__->load_components(qw/PK::Auto::SQLite Core/); + __PACKAGE__->set_primary_key('id'); + =head1 DESCRIPTION This class overrides the insert method to get automatically incremented primary keys. -You don't want to be using this directly - instead load the appropriate -one for your database, e.g. PK::Auto::SQLite +You don't want to be using this directly - instead load the +appropriate one for your database, e.g. C, before +C. =head1 LOGIC -PK::Auto does this by letting the database assign the primary key field -and fetching the assigned value afterwards. +PK::Auto does this by letting the database assign the primary key +field and fetching the assigned value afterwards. =head1 METHODS diff --git a/lib/DBIx/Class/PK/Auto/MSSQL.pm b/lib/DBIx/Class/PK/Auto/MSSQL.pm index 59877f1..3ae6287 100644 --- a/lib/DBIx/Class/PK/Auto/MSSQL.pm +++ b/lib/DBIx/Class/PK/Auto/MSSQL.pm @@ -20,6 +20,10 @@ DBIx::Class::PK::Auto::MSSQL - Automatic Primary Key class for MSSQL =head1 SYNOPSIS + # In your table classes + __PACKAGE__->load_components(qw/PK::Auto::MSSQL Core/); + __PACKAGE__->set_primary_key('id'); + =head1 DESCRIPTION This class implements autoincrements for MSSQL. @@ -32,4 +36,4 @@ Brian Cassidy You may distribute this code under the same terms as Perl itself. -=cut \ No newline at end of file +=cut diff --git a/lib/DBIx/Class/PK/Auto/MySQL.pm b/lib/DBIx/Class/PK/Auto/MySQL.pm index 8644120..57b428d 100644 --- a/lib/DBIx/Class/PK/Auto/MySQL.pm +++ b/lib/DBIx/Class/PK/Auto/MySQL.pm @@ -19,6 +19,10 @@ DBIx::Class::PK::Auto::MySQL - Automatic Primary Key class for MySQL =head1 SYNOPSIS + # In your table classes + __PACKAGE__->load_components(qw/PK::Auto::MySQL Core/); + __PACKAGE__->set_primary_key('id'); + =head1 DESCRIPTION This class implements autoincrements for MySQL. diff --git a/lib/DBIx/Class/PK/Auto/Oracle.pm b/lib/DBIx/Class/PK/Auto/Oracle.pm index 814496e..a9bde71 100644 --- a/lib/DBIx/Class/PK/Auto/Oracle.pm +++ b/lib/DBIx/Class/PK/Auto/Oracle.pm @@ -53,6 +53,10 @@ DBIx::Class::PK::Auto::Oracle - Automatic Primary Key class for Oracle =head1 SYNOPSIS + # In your table classes + __PACKAGE__->load_components(qw/PK::Auto::Oracle Core/); + __PACKAGE__->set_primary_key('id'); + =head1 DESCRIPTION This class implements autoincrements for Oracle. diff --git a/lib/DBIx/Class/PK/Auto/Pg.pm b/lib/DBIx/Class/PK/Auto/Pg.pm index 78d1d65..611a6e1 100644 --- a/lib/DBIx/Class/PK/Auto/Pg.pm +++ b/lib/DBIx/Class/PK/Auto/Pg.pm @@ -43,6 +43,10 @@ DBIx::Class::PK::Auto::Pg - Automatic Primary Key class for Postgresql =head1 SYNOPSIS + # In your table classes + __PACKAGE__->load_components(qw/PK::Auto::Pg Core/); + __PACKAGE__->set_primary_key('id'); + =head1 DESCRIPTION This class implements autoincrements for Postgresql. diff --git a/lib/DBIx/Class/PK/Auto/SQLite.pm b/lib/DBIx/Class/PK/Auto/SQLite.pm index 24bb045..8c83cff 100644 --- a/lib/DBIx/Class/PK/Auto/SQLite.pm +++ b/lib/DBIx/Class/PK/Auto/SQLite.pm @@ -19,6 +19,10 @@ DBIx::Class::PK::Auto::SQLite - Automatic Primary Key class for SQLite =head1 SYNOPSIS + # In your table classes + __PACKAGE__->load_components(qw/PK::Auto::SQLite Core/); + __PACKAGE__->set_primary_key('id'); + =head1 DESCRIPTION This class implements autoincrements for SQLite.