Make the insert_returning capability private (and saner naming)
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Row.pm
index 7716985..f9784d0 100644 (file)
@@ -363,8 +363,8 @@ sub insert {
   my $updated_cols = $source->storage->insert(
     $source,
     { $self->get_columns },
-    keys %auto_pri
-      ? { returning => [ sort { $auto_pri{$a} cmp $auto_pri{$b} } keys %auto_pri ] }
+    (keys %auto_pri) && $source->storage->_supports_insert_returning
+      ? { returning => [ sort { $auto_pri{$a} <=> $auto_pri{$b} } keys %auto_pri ] }
       : ()
     ,
   );
@@ -484,7 +484,7 @@ the database row can not be constructed (see
 L<significance of primary keys|DBIx::Class::Manual::Intro/The Significance and Importance of Primary Keys>
 for more details).
 
-Also takes an optional hashref of C<< column_name => value> >> pairs
+Also takes an optional hashref of C<< column_name => value >> pairs
 to update on the object first. Be aware that the hashref will be
 passed to C<set_inflated_columns>, which might edit it in place, so
 don't rely on it being the same after a call to C<update>.  If you