EctoTablestore.Repo.batch_get

You're seeing just the callback batch_get, go back to EctoTablestore.Repo module for more information.

Specs

batch_get(gets) :: {:ok, Keyword.t()} | {:error, term()}
when gets: [
       {module :: Ecto.Schema.t(),
        [{key :: String.t() | atom(), value :: integer() | String.t()}],
        options()}
       | {module :: Ecto.Schema.t(),
          [{key :: String.t() | atom(), value :: integer() | String.t()}]}
       | (schema_entity :: Ecto.Schema.t())
       | {[schema_entity :: Ecto.Schema.t()], options()}
     ]

Batch get several rows of data from one or more tables, this batch request put multiple get_row in one request from client's perspective.

After execute each operation in servers, return results independently and independently consumes capacity units.

When input schema_entity, only theirs primary keys are used in query, if need to use theirs attribute columns into condition of query, please use entity_full_match: true option to do that.

Example

batch_get([
  {Schema1, [[ids: ids1], [ids: ids2]]},
  [%Schema2{keys: keys1}, %Schema2{keys: keys2}]
])

batch_get([
  {Schema1, [[ids: ids1], [ids: ids2]]},
  {
    [
      %Schema2{keys: keys1},
      %Schema2{keys: keys2}
    ],
    entity_full_match: true
  }
])

batch_get([
  {
    [
      %Schema2{keys: keys1},
      %Schema2{keys: keys2}
    ],
    filter: filter("attr_field" == 1),
    columns_to_get: ["attr_field", "attr_field2"]
  }
])