Path: | doc/release_notes/3.25.0.txt |
Last Update: | Mon Apr 29 02:10:38 +0000 2013 |
DB.drop_table(:tab, :cascade=>true) # DROP TABLE tab CASCADE DB.drop_column(:tab, :col, :cascade=>true) # ALTER TABLE tab DROP COLUMN col CASCADE
A few databases support CASCADE for dropping tables and views, but only PostgreSQL appears to support it for columns and constraints. Using the :cascade option when the underlying database doesn‘t support it will probably result in a DatabaseError being raised.
DB[:table1].select(:column1) > DB[:table2].select(:column2) # (SELECT column1 FROM table1) > (SELECT column2 FROM table2) DB[:table1].select(:column1).cast(Integer) # CAST((SELECT column1 FROM table1) AS integer)
DB[:a].select_group(:b, :c) # SELECT b, c FROM a GROUP BY b, c
DB[:a].select_all(:a) # SELECT a.* FROM a DB.from(:a, :b).select_all(:a, :b) # SELECT a.*, b.* FROM a, b
DB[:a].select(:b).group{c(d)} # SELECT b FROM a GROUP BY c(d)