> No support for that right now.
>
> The support would need to start at the Adapter. Which should be fairly
> easy.

Sam, the adapters for MySQL, PostgreSQL and SQLite3 all support bulk
creation right now.  Other adapters should accept multiple resources
in a single create() call, but may or may not perform bulk creation
depending on the storage engine.

I had hoped to use this for bulk copying, and possibly if we ever
decide to support "Unit of Work" (http://is.gd/2IHO) in DM --
something I know you were talking about at one point.

> Then we'd need to figure out what the higher level interface
> would be. Probably something like: Collection.new(entries).save

Yeah, Collection#save is what I'd like to see here.  It should iterate
over the collection, and perform a bulk create for all the new
resources OR update existing dirty resources, if any.

Currently Collection#initialize doesn't accept an Array like the above
example tho (it accepts a DM::Query object as the first argument), the
current way to wrap an Array in DM::Collection object is:

  collection = DataMapper::Collection.new
  collection.replace(entries)

Dan Kubb
(dkubb)
--~--~---------~--~----~------------~-------~--~----~
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