Revision history for DBIx::Class
+ * Fixes
+ - Fix $rs->create() with no values on Oracle
+
0.082800 2014-09-25 14:45 (UTC)
* Known Issues
- Passing large amounts of objects with stringification overload
$self->next::method($schema, $type, $version, $dir, $sqltargs, @rest);
}
+sub insert {
+ my ($self, $source, $to_insert) = @_;
+
+ # Oracle does not understand INSERT INTO ... DEFAULT VALUES syntax
+ # Furthermore it does not have any way to insert without specifying any columns
+ # We can't fix this in SQLMaker::Oracle because it doesn't know which column to add to the statement
+ unless (%$to_insert)
+ {
+ my ($col) = $source->columns;
+ $to_insert = { $col => \'DEFAULT' };
+ }
+
+ return $self->next::method($source, $to_insert);
+}
+
sub _dbh_last_insert_id {
my ($self, $dbh, $source, @columns) = @_;
my @ids = ();
{
my $new_artist = $schema->resultset('Artist')->new({});
isa_ok( $new_artist, 'DBIx::Class::Row', '$rs->new gives a row object' );
+ lives_ok { $new_artist->insert() } 'inserting without specifying any columns works';
+ $new_artist->discard_changes;
+ $new_artist->delete;
}
-
# make sure we got rid of the compat shims
SKIP: {
my $remove_version = 0.083;
like ($seq, qr/\.${q}artist_pk_seq${q}$/, 'Correct PK sequence selected for sqlt-like trigger');
}
+ lives_ok {
+ $new = $schema->resultset('Artist')->create({});
+ $new->discard_changes;
+ ok $new->artistid, 'Created row has id'
+ } 'Create with empty hashref works';
+
# test LIMIT support
for (1..6) {