Изменения

Funq

22 байта добавлено, 10:43, 15 июля 2009
Объектное формирование запросов
<source lang="perl">
$dbh->join( $dbh->query(tag2entity_cl => "t1")->where("t1.pid=? and t1.tag=?"), ->join($dbh->query(entity => "t0")->where("t0.id=t1.eid and t0.config=? and t0.?t0where"))->select("t0.*")
->order("t0.?t0order")
->limit("?offset", "?limit")
->query(entity => "t0")
->where("t0.?t0where and ?subq in ?tagcount")
->select("t0.*, ?subq as t0.tag_count", )->curry(subq => $dbh ->query(tag2entity => "t1") ->where("t1.pid=t0.pid and t1.eid=t0.eid") ->count->value
)
</source>
->where("t0.?t0where and ?subq in ?tagcount")
->select("t0.*, ?subq as t0.tag_count", subq => $dbh
->query(tag2entity => "t1") ->where("t1.pid=t0.pid and t1.eid=t0.eid") ->where("t1.config in ?list", list => $dbh->query("configs")) ->count->value
)
</source>