From: Peter Rabbitson Date: Thu, 8 Apr 2010 10:10:12 +0000 (+0000) Subject: Make the insert_returning capability private (and saner naming) X-Git-Tag: v0.08121~13 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=227d836679dd2e91b1cf49c3d9e566be79f49297;p=dbsrgits%2FDBIx-Class.git Make the insert_returning capability private (and saner naming) --- diff --git a/lib/DBIx/Class/Row.pm b/lib/DBIx/Class/Row.pm index 787df86..f9784d0 100644 --- a/lib/DBIx/Class/Row.pm +++ b/lib/DBIx/Class/Row.pm @@ -363,7 +363,7 @@ sub insert { my $updated_cols = $source->storage->insert( $source, { $self->get_columns }, - (keys %auto_pri) && $source->storage->can_insert_returning + (keys %auto_pri) && $source->storage->_supports_insert_returning ? { returning => [ sort { $auto_pri{$a} <=> $auto_pri{$b} } keys %auto_pri ] } : () , diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 1030c4c..a823f22 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -36,7 +36,7 @@ __PACKAGE__->cursor_class('DBIx::Class::Storage::DBI::Cursor'); __PACKAGE__->mk_group_accessors('inherited' => qw/ sql_maker_class - can_insert_returning + _supports_insert_returning /); __PACKAGE__->sql_maker_class('DBIx::Class::SQLAHacks'); diff --git a/lib/DBIx/Class/Storage/DBI/InterBase.pm b/lib/DBIx/Class/Storage/DBI/InterBase.pm index 352dcc5..e6a9143 100644 --- a/lib/DBIx/Class/Storage/DBI/InterBase.pm +++ b/lib/DBIx/Class/Storage/DBI/InterBase.pm @@ -29,7 +29,7 @@ L. =cut -sub can_insert_returning { 1 } +sub _supports_insert_returning { 1 } sub _sequence_fetch { my ($self, $nextval, $sequence) = @_; diff --git a/lib/DBIx/Class/Storage/DBI/Pg.pm b/lib/DBIx/Class/Storage/DBI/Pg.pm index 250707b..8f5ac8d 100644 --- a/lib/DBIx/Class/Storage/DBI/Pg.pm +++ b/lib/DBIx/Class/Storage/DBI/Pg.pm @@ -16,7 +16,7 @@ use Context::Preserve (); warn __PACKAGE__.": DBD::Pg 2.9.2 or greater is strongly recommended\n" if ($DBD::Pg::VERSION < 2.009002); # pg uses (used?) version::qv() -sub can_insert_returning { +sub _supports_insert_returning { my $self = shift; return 1 diff --git a/lib/DBIx/Class/Storage/DBI/Replicated.pm b/lib/DBIx/Class/Storage/DBI/Replicated.pm index c21fe8a..6d226d2 100644 --- a/lib/DBIx/Class/Storage/DBI/Replicated.pm +++ b/lib/DBIx/Class/Storage/DBI/Replicated.pm @@ -306,7 +306,7 @@ has 'write_handler' => ( backup is_datatype_numeric - can_insert_returning + _supports_insert_returning _count_select _subq_count_select _subq_update_delete