[DBIx-Class-Devel] [dbix-class] Unbreak $rs->create() with empty hashref on Oracle (#61)

Dagfinn Ilmari Mannsåker notifications at github.com
Mon Sep 29 18:09:42 GMT 2014


> @@ -118,6 +118,21 @@ sub deployment_statements {
>    $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';

Don't modify the caller's hashref, just do `$to_insert = { $col => \'DEFAULT' }`


---
Reply to this email directly or view it on GitHub:
https://github.com/dbsrgits/dbix-class/pull/61/files#r18171964
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class-devel/attachments/20140929/dd2082f9/attachment.htm>


More information about the DBIx-Class-Devel mailing list