I'm just getting started with DataMapper, and am loving the API so
far. The one big hurdle I've been trying to get over is figuring out
how to handle records in N databases (with identical schemas, mind
you) from a single Model.

Basically, if I did something like "User.all" I want that to return
*all* user records across the repositories: [:db1, :db2, :db3, ...]. I
have a temporary hack in place right now which overrides the "all"
class method, and internally loops through said repositories, calling
super in the context of each. It does this in parallel using threads,
and it all works fine until I need to return the grouped results... I
can't return a simple array because the API spec requires it return a
DataMapper::Collection object. I tried reusing a new Collection object
(created in the overridden "all" class method) and calling #load(super
(query)) for each iteration in my loop of repositories. As I half
expected, I got strange results.

First, am I even making sense? :P
Second, I'd like to know if this is even possible with todays API (I'm
using 0.9.x, though I hear 0.10 has refactored code in this area?).
And if not, where I might start hacking (DataMapper::Collection?) to
add support for this.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DataMapper" 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/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to