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

Get information on dynamo tables and schema

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.

Functions

Link to this function

index_details(repo, tablename)

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

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

secondary_indexes(repo, tablename)

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