I'm not entirely sure what you meant. I would find it nice that, if I don't 
qualify a column, that it gets automatically qualified to the underlying 
model's table. This way I don't have to know if I'll be doing joins while 
building a query (I would rather not have to qualify column names if I 
don't have to). For example, I might do:

Quiz.where(id: selected_quiz_ids).association_left_join(:questions).where
{...}

When that query finishes, I will get an "ambiguous column 'id'" error. Even 
though I know that I meant "quizzes.id"; if I wanted `questions.id`, I 
would be natural to explicitly specify it. I found out now that 
"column_select" plugin actually does something else than this. Is there a 
plugin which does this automatically?

It's great to hear that table_select might be the default :)

On Friday, March 27, 2015 at 4:35:35 PM UTC+1, Jeremy Evans wrote:
>
> On Friday, March 27, 2015 at 4:23:46 AM UTC-7, Janko Marohnić wrote:
>>
>> Hi Jeremy,
>>
>> I was wondering, why aren't the "table_select" and "column_select" 
>> plugins the default in Sequel (like they are in ActiveRecord)? I personally 
>> always want to have everything qualified, it's easier to do joins and 
>> generally any subqueries with other tables. Is there a downside of having 
>> everything qualified by default?
>>
>
> Backwards compatibility.  There's probably a slight performance hit as 
> well, but it's mostly backwards compatibility.  It's possible that in 
> Sequel 5, either table_select or column_select will be the default, and 
> I'll add a plugin for the current default behavior.  
>
> If you are doing any joins you should probably be manually setting a 
> selection (why join if you don't need access to the columns in the other 
> table?), and the current behavior shouldn't affect subqueries.
>
> 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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to