On 12/1/07 7:16 PM, "James Adam" <[EMAIL PROTECTED]> wrote:
Hi Lists,
> I think possibly the biggest issue with bringing views into AR's
> schema notation is that most (useful) views don't just contain columns
> from other tables; they often perform functions (SUM, AVG). From
> looking at the current plugin, it seems like you'd end up having to
> write that as a fairly explicit SQL statement, and I'm not sure in
> such cases how great the value in using Ruby to declare the columns.
>
> In a nutshell, is
>
> create_view :v_stuff, %{
> SELECT thing_id, other_thing_id, SUM(stuff) as blah
> FROM things, other things
> WHERE thing_attribute LIKE "wibble"
> GROUP BY other_things.cost
> } do |v|
> v.column :thing_id
> v.column :other_thing_id
> v.column :blah
> end
>
> really that much better than
>
> SomeModel.connection.execute %{
> CREATE VIEW v_stuff AS (
> SELECT thing_id, other_thing_id, SUM(stuff) as blah
> FROM things, other things
> WHERE thing_attribute LIKE "wibble"
> GROUP BY other_things.cost )
> }
This is my first post to this list.
We now working on integration of our Valentina database into RoR.
During this, we have note, that RoR people are used to specify field alias
without single quotes, as above for example.
SELECT thing_id, other_thing_id, SUM(stuff) as blah
^^^^^^^^^
I wonder, may be it can be more accurate if ROR will produce SQL queries
using single quotes, according to SQL92 standard?
Also, please, let me know if this list is correct place for talk/questions
about Valentina database integration into ROR?
--
Best regards,
Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc
Valentina - Joining Worlds of Information
http://www.paradigmasoft.com
[I feel the need: the need for speed]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---