View Source Ecto.Adapters.DynamoDB.Cache (ecto_adapters_dynamodb v3.5.0)

An Elixir agent to cache DynamoDB table schemas and the first page of results for selected tables

Summary

Functions

Returns the cached value for a call to DynamoDB, describe-table. Performs a DynamoDB scan if not yet cached and raises any errors as a result of the request. The raw json is presented as an elixir map.

Returns the current cache of table schemas, and cache of first page of results for selected tables, as an Elixir map

Returns the cached first page of results for a table. Performs a DynamoDB scan if not yet cached and raises any errors as a result of the request

Performs a DynamoDB scan and caches (without returning) the first page of results. Raises any errors as a result of the request

Performs a DynamoDB, describe-table, and caches (without returning) the result. Raises any errors as a result of the request

Types

cached_table()

@type cached_table() :: {String.t(), map()}

t()

@type t() :: %Ecto.Adapters.DynamoDB.Cache{
  ex_aws_config: term(),
  schemas: map(),
  tables: [cached_table()]
}

Functions

child_spec(list)

describe_table(repo, table_name)

@spec describe_table(Ecto.Repo.t(), table_name_t()) ::
  {:ok, dynamo_response_t()} | {:error, term()}

describe_table!(repo, table_name)

@spec describe_table!(Ecto.Repo.t(), table_name_t()) ::
  dynamo_response_t() | no_return()

Returns the cached value for a call to DynamoDB, describe-table. Performs a DynamoDB scan if not yet cached and raises any errors as a result of the request. The raw json is presented as an elixir map.

get_cache(repo)

Returns the current cache of table schemas, and cache of first page of results for selected tables, as an Elixir map

scan(repo, table_name)

@spec scan(Ecto.Repo.t(), table_name_t()) ::
  {:ok, dynamo_response_t()} | {:error, term()}

scan!(repo, table_name)

@spec scan!(Ecto.Repo.t(), table_name_t()) :: dynamo_response_t() | no_return()

Returns the cached first page of results for a table. Performs a DynamoDB scan if not yet cached and raises any errors as a result of the request

start_link(repo)

@spec start_link(Ecto.Repo.t()) :: Agent.on_start()

update_cached_table(repo, table_name)

@spec update_cached_table(Ecto.Repo.t(), table_name_t()) :: :ok | {:error, term()}

update_cached_table!(repo, table_name)

@spec update_cached_table!(Ecto.Repo.t(), table_name_t()) :: :ok | no_return()

Performs a DynamoDB scan and caches (without returning) the first page of results. Raises any errors as a result of the request

update_table_info(repo, table_name)

@spec update_table_info(Ecto.Repo.t(), table_name_t()) :: :ok | {:error, term()}

update_table_info!(repo, table_name)

@spec update_table_info!(Ecto.Repo.t(), table_name_t()) :: :ok | no_return()

Performs a DynamoDB, describe-table, and caches (without returning) the result. Raises any errors as a result of the request