Revision history for Perl extension DBIx::Class::Schema::Loader
-0.03001 XXX not yet released
+0.03001 Mon Jun 5 23:17:57 UTC 2006
- load_from_connection deprecation notice now mentions
upgrading Catalyst::Model::DBIC::Schema if that module
seems to be in use.
FROM SYSCAT.TABCONST as tc
JOIN SYSCAT.KEYCOLUSE as kcu ON tc.CONSTNAME = kcu.CONSTNAME
WHERE tc.TABSCHEMA = ? and tc.TABNAME = ? and tc.TYPE = 'U'}
- );
+ ) or die $DBI::errstr;
$sth->execute($self->db_schema, $table) or die $DBI::errstr;
@{$keydata{$keyname}};
push(@uniqs, [ $keyname => \@ordered_cols ]);
}
+
$sth->finish;
return \@uniqs;
my ($self, $table) = @_;
my $dbh = $self->schema->storage->dbh;
- my $sth = $dbh->prepare('SHOW CREATE TABLE ?');
- $sth->execute or die("Cannot get table definition for $table"
- . " (execute failed): $DBI::errstr");
-
- my $table_def_ref = $sth->fetchrow_arrayref
- or die ("Cannot get table definition for $table (no rows)");
-
+ my $table_def_ref = $dbh->selectrow_arrayref("SHOW CREATE TABLE $table")
+ or die ("Cannot get table definition for $table");
my $table_def = $table_def_ref->[1] || '';
- $sth->finish;
my (@reldata) = ($table_def =~ /CONSTRAINT `.*` FOREIGN KEY \(`(.*)`\) REFERENCES `(.*)` \(`(.*)`\)/ig);