1 package DBIx::Class::Storage::DBI::InterBase;
3 # mostly stolen from DBIx::Class::Storage::DBI::MSSQL
8 use base qw/DBIx::Class::Storage::DBI::AmbiguousGlob DBIx::Class::Storage::DBI/;
13 __PACKAGE__->mk_group_accessors(simple => qw/
14 _identity _identity_method
17 __PACKAGE__->sql_maker_class('DBIx::Class::SQLAHacks::InterBase');
21 my ($source, $cols, $data) = @_;
23 my $is_identity_insert = (List::Util::first
24 { $source->column_info ($_)->{is_auto_increment} }
30 $self->next::method(@_);
34 sub _prep_for_execute {
36 my ($op, $extra_bind, $ident, $args) = @_;
38 my ($sql, $bind) = $self->next::method (@_);
40 if ($op eq 'insert') {
41 $sql .= 'RETURNING "Id"';
52 my ($rv, $sth, @bind) = $self->dbh_do($self->can('_dbh_execute'), @_);
54 if ($op eq 'insert') {
56 # this should bring back the result of SELECT SCOPE_IDENTITY() we tacked
57 # on in _prep_for_execute above
59 my ($identity) = eval { $sth->fetchrow_array };
61 $self->_identity($identity);
65 return wantarray ? ($rv, $sth, @bind) : $rv;
68 sub last_insert_id { shift->_identity }