<br><br><div class="gmail_quote">On Tue, May 17, 2011 at 7:43 AM, Peter Edwards <span dir="ltr"><<a href="mailto:peter@dragonstaff.co.uk">peter@dragonstaff.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="gmail_quote"><div>Can you say</div><div><br></div><div>my $search_attr = {</div><div> '+columns' => [ { 'email' => \'' } ], # and so on for other missing fields</div>
<div>};</div><div><br></div><div>then</div><div><br></div><div>my $rs = $schema->search_rs( $query, $search_attr );</div></div></blockquote><div><br></div><div>Hi Peter,</div><div><br></div><div>Maybe I'm not understanding your suggestion. The problem I have is an existing application that uses DBIC, and (perhaps incorrectly) there's quite a few direct uses of $user->get_column( 'email' ), I could probably replace those in the app by adding, for example, an "email" method to the result class. There's also other uses of the "email" column such as create() and maybe other resultset methods that verify that every key in the passed in data is an actual column.</div>
<div><br></div><div>I suspect replacing the get_column() usage is necessary. But, I'm not sure how best to deal with any other methods that might reference a non-existent column.</div><div><br></div><div>Really, what I need to do is prevent the column from ending up in SQL. So, could I defined the non-existent column in the result class and then override the SQL generation somewhere to strip out the columns? I suspect that's less that trivial.</div>
<div><br></div><div>Other option would be to override insert and create and strip out the non-existent columns.</div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div><br></div><div>Unfortunately, I can't just add the columns to the database.</div>
</div><div><br></div><div>Any other ideas?</div><div><br></div><div>Thanks,</div><div><br></div><div><br></div><div> </div></div>-- <br>Bill Moseley<br><a href="mailto:moseley@hank.org" target="_blank">moseley@hank.org</a><br>