Hi everybody,

I have a question about Database '[]' method. The documentation says, it 
has two behaviours: DB['sql statement'] is an alias for fetch, when 
DB[:table_name] is an alias for #from. Both of them shall return a Dataset. 
Ok. So, I tried the following:
set = db[:my_table].where(:id => 2).all

It works as excepted: I get the row(s) with id = 2 of my_table.

Now, I try the other syntax:
set = db['my_table'].where(:id => 2).all

I get all rows of my_table. The result is as I have written:
set = db['select * from my_table'].all

I though, as the '[]' method returns a Dataset in all cases, I could still 
filter it. But in fact, the behaviour seems to be different.

Is this normal? Did I missed something?

Thanks for helping!

Fransez

-- 
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