New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for BatchGetItem #122
Comments
Thanks for reaching out on this - we do have plans to add support for BatchGetItems! As part of a new investment in this library we are planning to add support following the approach taken in PR #119 where we added support for batch writing items using a new BatchWrite class to avoid any backwards compatibility / breaking changes. We are planning to add support for batch_get_item with a BatchRead class (capable of reading multiple items from multiple tables) which can be used by individual Record classes, giving an interface like: class Foo
include Aws::Record
string_attr :name, hash_key: true
end
class Bar
include Aws::Record
string_attr :id, hash_key: true
string_attr :rk, range_key: true
end
# produces a heterogeneous ItemCollection
items = Aws::Record::Batch.read do |db|
db.find(Foo, name: 'n1')
db.find(Foo, name: 'n2')
db.find(Bar, id: 'id1', rk: 'rk1')
db.find(Bar, id: 'id1', rk: 'rk2')
end
# returns a homogenous ItemCollection
foo_items = Foo.find_all(
[
{name: 'n1'},
{name: 'n2'}
])
# an alternative syntax
foo_items = Foo.find_all do |db|
db.find(name: 'n1') # the Foo class is implied here
db.find(name: 'n2')
end Would that work for your use case? |
Thank you for your reply One point of concern is that the existing ItemCollection class would have to be significantly modified. |
@alextwoods And when will this function be implemented? |
Sorry for the delay in response. Yes, the existing I believe we are currently targeting about mid Q4 of this year for the feature. |
* Implemented the `BatchGetItem` operation (#122). Co-authored-by: Juli Tera <terajul@amazon.com>
Implemented the feature and published a new gem (v2.10.0). |
Are there any plans to implement BatchGetItem in this gem?
I saw this issue #12
We have a requirement and BatchGetItem may be better than TransactGetItems. (e.g., retrieve large number of items , no need to consider transaction conflict errors, etc.)
If you don't plan to implement it and are be open the idea, may I add the feature myself?
The API interface will be something like transact_find
Thanks!
The text was updated successfully, but these errors were encountered: