Hello list,

I’m wondering what's the proper way to execute a SQL statement via 
DataMapper.

Assume I these models are created at runtime:

class Bar
  include DataMapper::Resource
  property :id, :Serial
end

class Foo
  include DataMapper::Resource
  property :a, :Serial
  property :b, :Serial
  belongs_to Bar, :key => true
end

Now I want to create a view (and a model to mirror that view):
create view foo_count as 
select a, b, count(bar) as count 
from foo 
group by a, b

How can I use DataMapper to execute this statement?
Is there a way to use the name system of DataMapper?

--
Cheers, Johannes

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/datamapper/-/JboY90vrJl4J.
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/datamapper?hl=en.

Reply via email to