Dynamoid icon indicating copy to clipboard operation
Dynamoid copied to clipboard

Implement and test BatchPutItem

Open mattbornski opened this issue 11 years ago • 4 comments

I have a use case which would be more optimal with batch inserts, so I have implemented it in your driver. Enjoy.

mattbornski avatar Dec 10 '13 00:12 mattbornski

@mattbornski How do you envision this new write capability being accessed from a dynamoid model? We would also like to utilize the batch insert.

m5rk avatar Dec 12 '13 18:12 m5rk

I imagine that we'll have to implement something like this:

https://github.com/zdennis/activerecord-import

but for dynamoid. Syntax along the lines of "YourModel::import([YourModel.new(foo, bar), YourModel.new(foo2, bar2)])".

On Thu, Dec 12, 2013 at 10:44 AM, Mark McEahern [email protected]:

@mattbornski https://github.com/mattbornski How do you envision this new write capability being accessed from a dynamoid model? We would also like to utilize the batch insert.

— Reply to this email directly or view it on GitHubhttps://github.com/Veraticus/Dynamoid/pull/165#issuecomment-30449489 .

mattbornski avatar Dec 12 '13 18:12 mattbornski

This should also be hooked into ActiveRecord's "subset conditions" (http://guides.rubyonrails.org/active_record_querying.html, section 2.3.3) which would be more handily named "batch finds"

I'm guessing you can use that to say "Client.where(:id => [1, 3, 5]).update_all({ :paid_up => true } "

lisad avatar Dec 12 '13 18:12 lisad

@lisad feel like taking a stab at that? The batch insertions was really the only batch operation I needed.

mattbornski avatar Jan 10 '14 18:01 mattbornski