[DBIx-Class-Devel] [dbsrgits/dbix-class] Scalar::Defer support as column name (#98)

x86-64 notifications at github.com
Fri Apr 1 15:25:34 GMT 2016


Ok I understand logic behind boolean context. As for SQL::Abstract 
doesn't seem like an issue, defer will return same result over and over, 
"lazy" can be used too.
Main goal was to solve issues with joins. I use chained resultsets a 
lot, and they often go into ResultSet classes as helpers like 
"with_tag", "with_parent_tag". Eg. sub with_tag { return shift->search({ 
"tag.name" => "Something" }, { join => { "parent" => "tag" } }); }. If I 
remember correctly second call to with_parent_tag will add "tag_2" as 
table, but condition still refer to "tag". There should be a way to know 
which alias to use right now, "tag" or "tag_2", just like 
$me->current_source_alias for current table (is there one?).
Additionally, if after two with_parent_tag() calls I add "tag" relation 
on main object like so: $rs = $rs->search({}, { join => "tag" }), all 
previous table aliases will shift, "tag" becomes "tag", "parent.tag" 
becomes "tag_2" (was "tag"), and "parent.tag" becomes "tag_3" (was 
"tag_2"). (It was some time ago, and I tested it with previous version, 
but it's probably same now). I guess they should be sticky.


---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/dbsrgits/dbix-class/pull/98#issuecomment-204437312
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class-devel/attachments/20160401/8511c261/attachment.htm>


More information about the DBIx-Class-Devel mailing list