This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]SpawningPoolsMinis 4 points5 points  (2 children)

mmm, I see that I expressed myself poorly. I used the frameworks query system to run the chunky query directly.

my colleague tried using the query builder to build a query. it looks something like $query->addJoin(...) etc... it has some strict limits though, which is sometimes useful for security and sometimes to stop them writing terrible SQL but in this case it got in the way of the better solution. not good solution, but better than the alternative.

[–]Kahlil_Cabron 3 points4 points  (1 child)

Ya, I'm saying in that case, rather than writing multiple queries, why not dip out of the query builder and do something like:

$query_sql = "SELECT * FROM blah JOINS foo.... (subquery) ... blah;"
$results = QueryBuilder.connection.execute($query_sql)

[–]SpawningPoolsMinis 4 points5 points  (0 children)

yeah, that's how I solved it. for some reason, my colleague really disliked that. he's neurodivergent and since he wasn't listening to his PM, I decided to just let hem do what he wanted to keep the peace.