1 package DBIx::Class::Storage::DBI::InsertReturning;
6 use base qw/DBIx::Class::Storage::DBI/;
11 DBIx::Class::Storage::DBI::InsertReturning - Storage component for RDBMSes
12 supporting INSERT ... RETURNING
17 L<is_auto_increment|DBIx::Class::ResultSource/is_auto_increment> support for
18 databases supporting the C<INSERT ... RETURNING> syntax.
24 my ($source, $to_insert, $opts) = @_;
26 return $self->next::method (@_) unless ($opts && $opts->{returning});
28 my $updated_cols = $self->_prefetch_insert_auto_nextvals ($source, $to_insert);
30 my $bind_attributes = $self->source_bind_attributes($source);
31 my ($rv, $sth) = $self->_execute (insert => [], $source, $bind_attributes, $to_insert, $opts);
33 if (my @ret_cols = @{$opts->{returning}}) {
36 local $SIG{__WARN__} = sub {};
37 my @r = $sth->fetchrow_array;
43 @ret{@ret_cols} = @ret_vals if (@ret_vals);
56 See L<DBIx::Class/AUTHOR> and L<DBIx::Class/CONTRIBUTORS>
60 You may distribute this code under the same terms as Perl itself.