Ecto.Adapters.DynamoDB.Info (ecto_adapters_dynamodb v3.1.2) View Source

Get information on dynamo tables and schema

Link to this section Summary

Functions

Get all the raw information on indexes for a given table, returning as a map.

returns a list of any indexed attributes in the table

Get a list of the available indexes on a table. The format of this list is described in normalise_dynamo_index!

Returns the primary key/ID for a table. It may be a single field that is a HASH, OR it may be the dynamoDB {HASH, SORT} type of index. we return {:primary, [index]} in a format described in normalise_dynamo_index!

returns a simple list of the secondary indexes (global and local) for the table. Uses same format for each member of the list as 'primary_key!'.

Returns the raw amazon dynamo DB table schema information. The raw json is presented as an elixir map.

Link to this section Functions

Link to this function

index_details(repo, tablename)

View Source

Specs

index_details(Ecto.Repo.t(), table_name_t()) :: %{
  primary: [map()],
  secondary: [map()]
}

Get all the raw information on indexes for a given table, returning as a map.

Link to this function

indexed_attributes(repo, table_name)

View Source

Specs

indexed_attributes(Ecto.Repo.t(), table_name_t()) :: [String.t()]

returns a list of any indexed attributes in the table

Link to this function

indexes(repo, tablename)

View Source

Specs

indexes(Ecto.Repo.t(), table_name_t()) :: [
  {:primary | String.t(), [String.t()]}
]

Get a list of the available indexes on a table. The format of this list is described in normalise_dynamo_index!

Link to this function

primary_key!(repo, tablename)

View Source

Specs

primary_key!(Ecto.Repo.t(), table_name_t()) ::
  {:primary, [String.t()]} | no_return()

Returns the primary key/ID for a table. It may be a single field that is a HASH, OR it may be the dynamoDB {HASH, SORT} type of index. we return {:primary, [index]} in a format described in normalise_dynamo_index!

Specs

repo_primary_key(module()) :: String.t() | no_return()
Link to this function

secondary_indexes(repo, tablename)

View Source

Specs

secondary_indexes(Ecto.Repo.t(), table_name_t()) ::
  [{String.t(), [String.t()]}] | no_return()

returns a simple list of the secondary indexes (global and local) for the table. Uses same format for each member of the list as 'primary_key!'.

Link to this function

table_info(repo, tablename)

View Source

Specs

table_info(Ecto.Repo.t(), table_name_t()) :: dynamo_response_t() | no_return()

Returns the raw amazon dynamo DB table schema information. The raw json is presented as an elixir map.

Here is an example of what it may look like

%{"AttributeDefinitions" => [%{"AttributeName" => "id",
     "AttributeType" => "S"},
   %{"AttributeName" => "person_id", "AttributeType" => "S"}],
  "CreationDateTime" => 1489615412.651,
  "GlobalSecondaryIndexes" => [%{"IndexArn" => "arn:aws:dynamodb:ddblocal:000000000000:table/circle_members/index/person_id",
     "IndexName" => "person_id", "IndexSizeBytes" => 7109,
     "IndexStatus" => "ACTIVE", "ItemCount" => 146,
     "KeySchema" => [%{"AttributeName" => "person_id", "KeyType" => "HASH"}],
     "Projection" => %{"ProjectionType" => "ALL"},
     "ProvisionedThroughput" => %{"ReadCapacityUnits" => 100,
       "WriteCapacityUnits" => 50}}], "ItemCount" => 146,
  "KeySchema" => [%{"AttributeName" => "id", "KeyType" => "HASH"},
   %{"AttributeName" => "person_id", "KeyType" => "RANGE"}],
  "ProvisionedThroughput" => %{"LastDecreaseDateTime" => 0.0,
    "LastIncreaseDateTime" => 0.0, "NumberOfDecreasesToday" => 0,
    "ReadCapacityUnits" => 100, "WriteCapacityUnits" => 50},
  "TableArn" => "arn:aws:dynamodb:ddblocal:000000000000:table/circle_members",
  "TableName" => "circle_members", "TableSizeBytes" => 7109,
  "TableStatus" => "ACTIVE"}
Link to this function

ttl_info(repo, tablename)

View Source