Releases: circles-learning-labs/ecto_adapters_dynamodb
Set `state: :loaded` metadata on retrieved records.
When returning existing records, it is expected that the the metadata for such a record will include state: :loaded
. Ecto provides a process
callback function which other adapters use during the decoding process to map the data from the record into the returned struct, including this piece of metadata; however, the current decoding process for this adapter is not structured to make use of that callback, so this metadata is set by other means - this release handles this task.
Ecto metadata reference:
https://hexdocs.pm/ecto/2.2.6/Ecto.Schema.Metadata.html
Refactored and cleaned up tests
This version features a cleaned-up set of tests - there's been some refactoring, code cleanup, and removal of useless/redundant tests.
Handle insert_all() with more than 25 items
DynamoDB restricts the number of items that can be inserted during a batch write operation to 25 - so in previous versions, Repo.insert_all()
would fail if there were more than 25 items in the collection. In this release, we provide basic handling to allow for an unlimited number of records to be written in one transaction.
As we're not yet retrying items that fail to write during a batch operation, a list of any failed inserts will be logged as "UnprocessedItems".
See https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_BatchWriteItem.html for reference.
batch_get bug fix
This release fixes a bug where batch_get queries for lists of interpolated values was failing. Queries in both of the following formats will now work...
Repo.all(from m in Model, where: m.id in ["id_1", "id_2"])
# or...
model_ids = ["id_1", "id_2"]
Repo.all(from m in Model, where: m.id in ^model_ids)
Improved Migration Support
This release supports create_if_not_exists
and drop_if_exists
options when migrating updates to indexes.
Improved migration support
Improved migration support with drop_if_exists