gshank / dbix-class-resultset-recursiveupdate

DBIx::Class::ResultSet::RecursiveUpdate
4 stars 9 forks source link

Allow recursive update to handle accessors on primary keys #6

Open stuckdownawell opened 11 years ago

stuckdownawell commented 11 years ago

Hi, This change allows the use of accessors on primary keys and foreign keys. It also will allow external use of the column names as well as accessors, in the data provided to recursive update. I'm not sure if this is a common use case or not. We have database columns with prefix fld and the DBIx::Class schema has been written to provide accessors without the fld prefix. In this situation, recursive_update failed as it pulls the primary_columns data from the schema, which is column name not accessor and complains that the column name doesn't exist. I kind of abused %columns_by_accessor as it now has the key accessors+column_names.

What are your thoughts?

Regards

Alex

abraxxa commented 11 years ago

Thanks for your patch but I have to reject it. DBIx::Class only allows the use of the column names in its DSL, adding support for using accessors instead in RU would only confuse users. The DBIC Data::Query rewrite might change that but I can't say how soon that will land as it's in development by mostly mst for several years.

abraxxa commented 4 years ago

It turned out we have the same use case and RU implemented this since version 0.32. Does this fix your issue? You might also look into my feature/less-sql-queries branch that reworks a lot of internals