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/CADGZSSfB_Eq_zwOuMrUwT4kCEsNaKQReHVACdpUPXMOb9Vm6bQ%40mail.gmail.com.

Reply via email to