Add single() ro RSC
[dbsrgits/DBIx-Class-Historic.git] / lib / DBIx / Class / SQLAHacks / MySQL.pm
CommitLineData
87aa29e2 1package # Hide from PAUSE
2 DBIx::Class::SQLAHacks::MySQL;
3
4use base qw( DBIx::Class::SQLAHacks );
5use Carp::Clan qw/^DBIx::Class|^SQL::Abstract/;
6
7#
8# MySQL does not understand the standard INSERT INTO $table DEFAULT VALUES
9# Adjust SQL here instead
10#
11sub insert {
12 my $self = shift;
13
14 my $table = $_[0];
cebb7cce 15 $table = $self->_quote($table);
87aa29e2 16
17 if (! $_[1] or (ref $_[1] eq 'HASH' and !keys %{$_[1]} ) ) {
18 return "INSERT INTO ${table} () VALUES ()"
19 }
20
21 return $self->SUPER::insert (@_);
22}
23
241;