View Source Ecto.Adapters.DynamoDB.Cache (ecto_adapters_dynamodb v3.4.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

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

Functions

Link to this function

describe_table(repo, table_name)

View Source
@spec describe_table(Ecto.Repo.t(), table_name_t()) ::
  {:ok, dynamo_response_t()} | {:error, term()}
Link to this function

describe_table!(repo, table_name)

View Source
@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.

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

@spec scan(Ecto.Repo.t(), table_name_t()) ::
  {:ok, dynamo_response_t()} | {:error, term()}
@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

@spec start_link(Ecto.Repo.t()) :: Agent.on_start()
Link to this function

update_cached_table(repo, table_name)

View Source
@spec update_cached_table(Ecto.Repo.t(), table_name_t()) :: :ok | {:error, term()}
Link to this function

update_cached_table!(repo, table_name)

View Source
@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

Link to this function

update_table_info(repo, table_name)

View Source
@spec update_table_info(Ecto.Repo.t(), table_name_t()) :: :ok | {:error, term()}
Link to this function

update_table_info!(repo, table_name)

View Source
@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