[Dbix-class] insert_bulk and column default values?

Peter Rabbitson rabbit+dbic at rabbit.us
Thu Nov 26 13:13:04 GMT 2009


Jim Spath wrote:
> I had some trouble with populate yesterday that turned out to be because
> insert_bulk doesn't properly handle default values.
> 
> I ended up having to write code which set the default values explicitly
> before calling populate, using information from the result_source.  This
> seems like something that should be handled internally in insert_bulk?
> 
> When I captured a return value from the call to populate(), everything
> worked as expected, but this isn't a good solution for my application,
> since some of the populate calls will contain many rows.
> 

Please show an actual use case (with code). Default values is a bit vague.
If you are referring to the add_columns default_value - it is never
considered by dbic. Still populate() should work just fine without them,
as this is what they are for - for the RDBMS to insert them upon row
creation. So yes - show the actual populate() call.



More information about the DBIx-Class mailing list