Some queries has long and complex join conditions.

Using current join options I ought to write:

    DB[:clients].join(:period){|p, cl, js|
        {:client_id.qualify(p) => :id.qualify(cl)} &
(:time_from.qualify(p) >= some_date)
    }

I wish to write shorter. May be like this:

    DB[:clients].join(:period){|p, cl, js|
        {p[:client_id] => cl[:id]} & (p[:time_from] >= some_date)
    }

(actually implemented in https://github.com/jeremyevans/sequel/pull/27)

It leads to some changes: p, cl - are not symbols but
`Sequel::SQL::Identifier` and method #[] added to it.
( `p[:client_id] == :client_id.qualify(p)` )

Some question:
- do you like this?
- do you expect table aliases to be symbols or you use it only for
qualification?


funny_falcon (Sokolov Yura)

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to