I also looked at dataset_associations and that doesn't accomplish what I 
want either because it hardcodes to using just "join" even if you specify 
:dataset_associations_join

Also, I know I can pass in a dataset proc, but that creates a subquery 
which (from what I've heard) is usually less performant. What I want to do 
can be accomplished with simple joins and generally speaking the dumber the 
queries the better they perform.

On Wednesday, May 27, 2020 at 1:46:15 PM UTC+3, Aryk Grosz wrote:
>
> I'm trying to chain association joins from table to table.
>
> lets say:
>
> class School < Sequel::Model
>   one_to_many :classes, class: "Klass"
> end
>
> class Klass < Sequel::Model
> one_to_many :students
> end
>
> class Student < Sequel::Model
> end
>
> So I know I can do:
>
> School.association_join(:classes)
>
> and I know I can do
>
> School. association_join(classes: :students)
>
> and I know I can do
>
> Klass.association_left_join(:students)
>
> but can I do something "like"
>
> School.association_join(:classes).association_left_join(:students)
>
> Basically I want to use different join types in the nested association 
> hashes.
>
> I looked in the advanced associations and looked through the code, but 
> could not find how to accomplish this short of just using #join and 
> #left_join and not leveraging the associations I already created.
>
> Aryk 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/d34bd053-a5c0-4e1c-9b01-62231efe97a6%40googlegroups.com.

Reply via email to