[Bast-commits] r4184 - in
branches/DBIx-Class-Schema-Loader/current: .
lib/DBIx/Class/Schema/Loader/DBI t
ilmari at dev.catalyst.perl.org
ilmari at dev.catalyst.perl.org
Wed Mar 12 12:59:30 GMT 2008
Author: ilmari
Date: 2008-03-12 12:59:30 +0000 (Wed, 12 Mar 2008)
New Revision: 4184
Modified:
branches/DBIx-Class-Schema-Loader/current/Changes
branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm
branches/DBIx-Class-Schema-Loader/current/t/13db2_common.t
Log:
Add is_auto_increment detecton for DB2
Modified: branches/DBIx-Class-Schema-Loader/current/Changes
===================================================================
--- branches/DBIx-Class-Schema-Loader/current/Changes 2008-03-12 03:13:38 UTC (rev 4183)
+++ branches/DBIx-Class-Schema-Loader/current/Changes 2008-03-12 12:59:30 UTC (rev 4184)
@@ -1,5 +1,8 @@
Revision history for Perl extension DBIx::Class::Schema::Loader
+Not yet released
+ - Add is_auto_increment detecton for DB2
+
0.04999_03 Wed Mar 12, 2008
- Fix DB2 support
Modified: branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm 2008-03-12 03:13:38 UTC (rev 4183)
+++ branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm 2008-03-12 12:59:30 UTC (rev 4184)
@@ -86,6 +86,29 @@
return $self->next::method(uc $table);
}
+sub _extra_column_info {
+ my ($self, $info) = @_;
+ my %extra_info;
+
+ my ($table, $column) = @$info{qw/TABLE_NAME COLUMN_NAME/};
+
+ my $dbh = $self->schema->storage->dbh;
+ my $sth = $dbh->prepare_cached(
+ q{
+ SELECT COUNT(*)
+ FROM syscat.columns
+ WHERE tabschema = ? AND tabname = ? AND colname = ?
+ AND identity = 'Y' AND generated != ''
+ },
+ {}, 1);
+ $sth->execute($self->db_schema, $table, $column);
+ if ($sth->fetchrow_array) {
+ $extra_info{is_auto_increment} = 1;
+ }
+
+ return \%extra_info;
+}
+
=head1 SEE ALSO
L<DBIx::Class::Schema::Loader>, L<DBIx::Class::Schema::Loader::Base>,
Modified: branches/DBIx-Class-Schema-Loader/current/t/13db2_common.t
===================================================================
--- branches/DBIx-Class-Schema-Loader/current/t/13db2_common.t 2008-03-12 03:13:38 UTC (rev 4183)
+++ branches/DBIx-Class-Schema-Loader/current/t/13db2_common.t 2008-03-12 12:59:30 UTC (rev 4184)
@@ -13,7 +13,6 @@
user => $user,
password => $password,
db_schema => uc $user,
- no_auto_increment => 1
);
if( !$dsn || !$user ) {
More information about the Bast-commits
mailing list