Right but I'm talking about chaining, where you do inner_join and then do 
left_join.

Would this work:
Studio.dataset.association_join(tracks: Sequel.as(:album, 
:table_alias_name, :join_type => "left")=>proc{|ds| ds.where(:x=>2)})

??

On Saturday, December 19, 2020 at 4:21:59 AM UTC+2 Jeremy Evans wrote:

> On Fri, Dec 18, 2020 at 4:11 PM [email protected] <[email protected]> 
> wrote:
>
>> Just curious, is there a way to apply a condition on the dataset?
>>
>> Track.dataset.association_inner_join(:album=>Sequel.as(:artist, 
>> :table_alias_name, :join_type=>:left, dataset: lambda{|ds|ds.where(x: 2)}))
>>
>
> Something like that.  If you want to alias, use Sequel.as as the key in 
> the hash, and for the join type, call the appropriate association_*_join 
> method, and for the condition, use the callable option as in your example:
>
>   Track.dataset.association_left_join(Sequel.as(:album, 
> :table_alias_name)=>proc{|ds| ds.where(:x=>2)})
>
> Thanks,
> Jeremy 
>

-- 
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/e52d6b82-7f5a-4489-b544-1c99d447b5cbn%40googlegroups.com.

Reply via email to