Merge 'trunk' into 'handle_all_storage_methods_in_replicated'
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / Informix.pm
1 package DBIx::Class::Storage::DBI::Informix;
2 use strict;
3 use warnings;
4
5 use base qw/DBIx::Class::Storage::DBI/;
6
7 use mro 'c3';
8
9 __PACKAGE__->mk_group_accessors('simple' => '__last_insert_id');
10
11 sub _execute {
12   my $self = shift;
13   my ($op) = @_;
14   my ($rv, $sth, @rest) = $self->next::method(@_);
15   if ($op eq 'insert') {
16     $self->__last_insert_id($sth->{ix_sqlerrd}[1]);
17   }
18   return (wantarray ? ($rv, $sth, @rest) : $rv);
19 }
20
21 sub last_insert_id {
22   shift->__last_insert_id;
23 }
24
25 sub _sql_maker_opts {
26   my ( $self, $opts ) = @_;
27
28   if ( $opts ) {
29     $self->{_sql_maker_opts} = { %$opts };
30   }
31
32   return { limit_dialect => 'SkipFirst', %{$self->{_sql_maker_opts}||{}} };
33 }
34
35 1;
36
37 __END__
38
39 =head1 NAME
40
41 DBIx::Class::Storage::DBI::Informix - Base Storage Class for INFORMIX Support
42
43 =head1 SYNOPSIS
44
45 =head1 DESCRIPTION
46
47 This class implements storage-specific support for Informix
48
49 =head1 AUTHORS
50
51 See L<DBIx::Class/CONTRIBUTORS>
52
53 =head1 LICENSE
54
55 You may distribute this code under the same terms as Perl itself.
56
57 =cut