> I have built some more complex web apps in the past that contains
> things like dynamic queries based off complex search forms with
> numerous options and reports that require complex queries that
> could involve things like looping over results and unioning them
> together or using CASE statements, etc. Can things like this be
> done using Ruby on Rails?
The following is a general answer; however, if there''s some specific
situation you have in mind, we might be able to work that out too.
In general, yes, Ruby on Rails has enough flexibility at several
points to accomplish complex queries.
First, you can choose which database you''ll use, as it provides
adapters for dbs like postgres, db2, sqlite and sqlserver. Whatever
"complex" functionality you require will most certainly be supported
by one of the databases that Rails currently supports.
Second, you can use arbitrary SQL statements with your connection to
the database (procedure calls, unions, whatever is supported by your
db).
Third, Ruby itself is an extremely versatile language that often
reduces the complexity of queries. In some cases, it''s both
efficient and clean to use a mixture of SQL and Ruby to drill down to
the data you need. In other cases, however, you have to trade
efficiency for "cleanliness" of code.
And finally, Rails handles the most common cases beautifully out of
the box--often there is no need to write SQL to get where you need to
go, giving you time to focus on the queries that really need your
help :)
Take care,
Duane Johnson
(canadaduane)
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails