[Bast-commits] r4046 - 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
Fri Feb 8 22:04:10 GMT 2008
Author: ilmari
Date: 2008-02-08 22:04:10 +0000 (Fri, 08 Feb 2008)
New Revision: 4046
Modified:
branches/DBIx-Class-Schema-Loader/current/Changes
branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm
branches/DBIx-Class-Schema-Loader/current/t/14ora_common.t
Log:
Add is_auto_increment detection for Oracle
Modified: branches/DBIx-Class-Schema-Loader/current/Changes
===================================================================
--- branches/DBIx-Class-Schema-Loader/current/Changes 2008-02-08 21:53:28 UTC (rev 4045)
+++ branches/DBIx-Class-Schema-Loader/current/Changes 2008-02-08 22:04:10 UTC (rev 4046)
@@ -1,5 +1,8 @@
Revision history for Perl extension DBIx::Class::Schema::Loader
+0.04999_02 Not yet released
+ - Add is_auto_increment detection for Oracle
+
0.04999_01 Tue Feb 5, 2008
- Mark foreign key columns with is_foreign_key => 1
- Add support for vendor-specific extra column attributes.
Modified: branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm 2008-02-08 21:53:28 UTC (rev 4045)
+++ branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm 2008-02-08 22:04:10 UTC (rev 4046)
@@ -123,6 +123,31 @@
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 user_triggers ut JOIN user_trigger_cols utc USING (trigger_name)
+ WHERE utc.table_name = ? AND utc.column_name = ?
+ AND column_usage LIKE '%NEW%' AND column_usage LIKE '%OUT%'
+ AND trigger_type = 'BEFORE EACH ROW' AND triggering_event LIKE '%INSERT%'
+ },
+ {}, 1);
+
+ $sth->execute($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>,
@@ -132,6 +157,8 @@
TSUNODA Kazuya C<drk at drk7.jp>
+Dagfinn Ilmari Mannsåker C<ilmari at ilmari.org>
+
=cut
1;
Modified: branches/DBIx-Class-Schema-Loader/current/t/14ora_common.t
===================================================================
--- branches/DBIx-Class-Schema-Loader/current/t/14ora_common.t 2008-02-08 21:53:28 UTC (rev 4045)
+++ branches/DBIx-Class-Schema-Loader/current/t/14ora_common.t 2008-02-08 22:04:10 UTC (rev 4046)
@@ -30,7 +30,6 @@
dsn => $dsn,
user => $user,
password => $password,
- no_auto_increment => 1,
);
if( !$dsn || !$user ) {
More information about the Bast-commits
mailing list