requires 'Module::Find' => '0.06';
requires 'Path::Class' => '0.16';
requires 'Scope::Guard' => '0.03';
-requires 'SQL::Abstract' => '1.60';
+requires 'SQL::Abstract' => '1.61';
requires 'SQL::Abstract::Limit' => '0.13';
requires 'Sub::Name' => '0.04';
requires 'Data::Dumper::Concise' => '1.000';
'DateTime::Format::Strptime' => 0,
) : ()
,
+ grep $_, @ENV{qw/DBICTEST_FIREBIRD_DSN DBICTEST_FIREBIRD_ODBC_DSN/}
+ ? (
+ 'DateTime::Format::Strptime' => 0,
+ ) : ()
+ ,
);
#************************************************************************#
# Make ABSOLUTELY SURE that nothing on the list above is a real require, #
--- /dev/null
+package # Hide from PAUSE
+ DBIx::Class::SQLAHacks::ODBC::Firebird;
+
+use strict;
+use warnings;
+use base qw( DBIx::Class::SQLAHacks );
+use Carp::Clan qw/^DBIx::Class|^SQL::Abstract/;
+
+sub insert {
+ my $self = shift;
+ my ($table, $vals, $opts) = @_;
+
+# Quoting RETURNING values breaks the Firebird ODBC driver, so we convert to
+# scalarref with unquoted values.
+ my $returning = $opts->{returning};
+
+ if ($returning && ref $returning eq 'ARRAY') {
+ $opts->{returning} = \join ', ' => @$returning;
+ }
+
+ return $self->next::method(@_);
+}
+
+1;
my $self = shift;
my ($op, $extra_bind, $ident, $args) = @_;
- my ($sql, $bind) = $self->next::method (@_);
-
if ($op eq 'insert') {
my @pk = $ident->primary_columns;
my %pk;
} $ident->columns;
if (@auto_inc_cols) {
- my $auto_inc_cols =
- join ', ',
- map $self->_quote_column_for_returning($_), @auto_inc_cols;
-
- $sql .= " RETURNING ($auto_inc_cols)";
+ $args->[1]{returning} = \@auto_inc_cols;
$self->_auto_incs([]);
$self->_auto_incs->[0] = \@auto_inc_cols;
}
}
- return ($sql, $bind);
-}
-
-sub _quote_column_for_returning {
- my ($self, $col) = @_;
-
- return $self->sql_maker->_quote($col);
+ return $self->next::method(@_);
}
sub _execute {
=cut
-# RETURNING ("foo") is broken in ODBC, but RETURNING (foo) works
-sub _quote_column_for_returning {
- return $_[1];
-}
+__PACKAGE__->sql_maker_class('DBIx::Class::SQLAHacks::ODBC::Firebird');
sub datetime_parser_type { __PACKAGE__ }