ecto_adapters_dynamodb v0.2.3 Ecto.Adapters.DynamoDB.Info 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(tablename) View Source
index_details(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(table_name) View Source
indexed_attributes(table_name_t) :: [String.t]

returns a list of any indexed attributes in the table

Link to this function indexes(tablename) View Source
indexes(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!(tablename) View Source
primary_key!(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!

Link to this function repo_primary_key(repo) View Source
repo_primary_key(module) :: String.t | no_return
Link to this function secondary_indexes(tablename) View Source
secondary_indexes(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(tablename) View Source
table_info(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"}