From: Daniel Westermann-Clark Date: Sat, 21 Jan 2006 21:00:23 +0000 (+0000) Subject: Cleanup and add basic docs for PK::Auto::DB2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=eb49d4e3edc9c959f22593a9f4d379c31ed78538;p=dbsrgits%2FDBIx-Class-Historic.git Cleanup and add basic docs for PK::Auto::DB2 --- diff --git a/lib/DBIx/Class/PK/Auto.pm b/lib/DBIx/Class/PK/Auto.pm index 6b5356a..ac89dad 100644 --- a/lib/DBIx/Class/PK/Auto.pm +++ b/lib/DBIx/Class/PK/Auto.pm @@ -7,47 +7,45 @@ use warnings; =head1 NAME -DBIx::Class::PK::Auto - Automatic Primary Key class +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'); + # 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. +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. C, in your -table classes: +You don't want to be using this directly - instead load the appropriate one for +your database, e.g. C, in your table classes: - __PACKAGE__->load_components(qw/PK::Auto::SQLite Core/); + __PACKAGE__->load_components(qw/PK::Auto::SQLite Core/); Note that C is specified as the leftmost argument. Alternatively, you can load the components separately: - __PACKAGE__->load_components(qw/Core/); - __PACKAGE__->load_components(qw/PK::Auto::SQLite/); + __PACKAGE__->load_components(qw/Core/); + __PACKAGE__->load_components(qw/PK::Auto::SQLite/); -This can be used, for example, if you have different databases and -need to determine the appropriate C class at runtime. +This can be used, for example, if you have different databases and need to +determine the appropriate C class at runtime. =head1 LOGIC -C does this by letting the database assign the primary key -field and fetching the assigned value afterwards. +C does this by letting the database assign the primary key field and +fetching the assigned value afterwards. =head1 METHODS =head2 insert -Overrides insert so that it will get the value of autoincremented -primary keys. +Overrides C so that it will get the value of autoincremented primary +keys. =cut @@ -96,4 +94,3 @@ Matt S. Trout You may distribute this code under the same terms as Perl itself. =cut - diff --git a/lib/DBIx/Class/PK/Auto/DB2.pm b/lib/DBIx/Class/PK/Auto/DB2.pm index a9732d5..0cfbcc1 100644 --- a/lib/DBIx/Class/PK/Auto/DB2.pm +++ b/lib/DBIx/Class/PK/Auto/DB2.pm @@ -22,3 +22,27 @@ sub last_insert_id } 1; + +=head1 NAME + +DBIx::Class::PK::Auto::DB2 - Automatic primary key class for DB2 + +=head1 SYNOPSIS + + # In your table classes + __PACKAGE__->load_components(qw/PK::Auto::DB2 Core/); + __PACKAGE__->set_primary_key('id'); + +=head1 DESCRIPTION + +This class implements autoincrements for DB2. + +=head1 AUTHORS + +Jess Robinson + +=head1 LICENSE + +You may distribute this code under the same terms as Perl itself. + +=cut diff --git a/lib/DBIx/Class/PK/Auto/MSSQL.pm b/lib/DBIx/Class/PK/Auto/MSSQL.pm index 4619998..a3c4329 100644 --- a/lib/DBIx/Class/PK/Auto/MSSQL.pm +++ b/lib/DBIx/Class/PK/Auto/MSSQL.pm @@ -17,13 +17,13 @@ sub last_insert_id { =head1 NAME -DBIx::Class::PK::Auto::MSSQL - Automatic Primary Key class for MSSQL +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'); + # In your table classes + __PACKAGE__->load_components(qw/PK::Auto::MSSQL Core/); + __PACKAGE__->set_primary_key('id'); =head1 DESCRIPTION diff --git a/lib/DBIx/Class/PK/Auto/MySQL.pm b/lib/DBIx/Class/PK/Auto/MySQL.pm index 59fb00f..e65bd39 100644 --- a/lib/DBIx/Class/PK/Auto/MySQL.pm +++ b/lib/DBIx/Class/PK/Auto/MySQL.pm @@ -15,13 +15,13 @@ sub last_insert_id { =head1 NAME -DBIx::Class::PK::Auto::MySQL - Automatic Primary Key class for MySQL +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'); + # In your table classes + __PACKAGE__->load_components(qw/PK::Auto::MySQL Core/); + __PACKAGE__->set_primary_key('id'); =head1 DESCRIPTION @@ -36,4 +36,3 @@ Matt S. Trout You may distribute this code under the same terms as Perl itself. =cut - diff --git a/lib/DBIx/Class/PK/Auto/Oracle.pm b/lib/DBIx/Class/PK/Auto/Oracle.pm index e12b16c..7455408 100644 --- a/lib/DBIx/Class/PK/Auto/Oracle.pm +++ b/lib/DBIx/Class/PK/Auto/Oracle.pm @@ -51,13 +51,13 @@ sub get_autoinc_seq { =head1 NAME -DBIx::Class::PK::Auto::Oracle - Automatic Primary Key class for Oracle +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'); + # In your table classes + __PACKAGE__->load_components(qw/PK::Auto::Oracle Core/); + __PACKAGE__->set_primary_key('id'); =head1 DESCRIPTION @@ -74,4 +74,3 @@ Scott Connelly You may distribute this code under the same terms as Perl itself. =cut - diff --git a/lib/DBIx/Class/PK/Auto/Pg.pm b/lib/DBIx/Class/PK/Auto/Pg.pm index 19de131..da49e9e 100644 --- a/lib/DBIx/Class/PK/Auto/Pg.pm +++ b/lib/DBIx/Class/PK/Auto/Pg.pm @@ -39,17 +39,17 @@ sub get_autoinc_seq { =head1 NAME -DBIx::Class::PK::Auto::Pg - Automatic Primary Key class for Postgresql +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'); + # 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. +This class implements autoincrements for PostgreSQL. =head1 AUTHORS @@ -60,4 +60,3 @@ Marcus Ramberg You may distribute this code under the same terms as Perl itself. =cut - diff --git a/lib/DBIx/Class/PK/Auto/SQLite.pm b/lib/DBIx/Class/PK/Auto/SQLite.pm index f761bc0..e405eac 100644 --- a/lib/DBIx/Class/PK/Auto/SQLite.pm +++ b/lib/DBIx/Class/PK/Auto/SQLite.pm @@ -15,13 +15,13 @@ sub last_insert_id { =head1 NAME -DBIx::Class::PK::Auto::SQLite - Automatic Primary Key class for SQLite +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'); + # In your table classes + __PACKAGE__->load_components(qw/PK::Auto::SQLite Core/); + __PACKAGE__->set_primary_key('id'); =head1 DESCRIPTION @@ -36,4 +36,3 @@ Matt S. Trout You may distribute this code under the same terms as Perl itself. =cut -