Table and column aliasing is now done with an 'as' method instead of using hashes. This change was necessary since column order is important and hashes are unordered.
irb> Select[:column1.as(:book), 1.as(:total), 'foo'.as(:constant)].to_sqlEquality in the where clause has been changed from a single equals to double equals. I personally preferred the single equals; however, it broke in scenarios where columns were not prefixed by table names. The previous solution did not work because ruby assigned a local variable instead of raising a method_missing and allowing the ReceiveAny class to handle the assignment.
=> "select column1 as book, 1 as total, 'foo' as constant"
=> "select * from table1 aliased_table_name"
The new syntax is the same, except it uses == instead of =.
Select[:column1].from[:table1].where doNew Feature:
column1 == 99
=> "select column1 from table1 where column1 = 99"
Inner Joins are now also supported
Select.all.from[:t1.as(:a)].inner_join[:t2.as(:b)].on doBug Fix:
a.id == b.id
b.id2 == c.id
=> "select * from t1 a inner join t2 b on a.id = b.id inner join t3 c on b.id2 = c.id"
Or conditions are surrounded by parenthesis.
column1 > 100
=> "select column1 from table1 where column1 = 0 or (column1 > 100)"