A DynamoDB data layer for Ash, backed by ExAws.Dynamo.
DSL Documentation
dynamodb
Configure the DynamoDB table backing this resource for querying.
Examples:
dynamodb do
table "users"
partition_key :email
sort_key :inserted_at
global_secondary_index :by_status do
partition_key :status
sort_key :inserted_at
end
endOptions
| Name | Type | Default | Docs |
|---|---|---|---|
table | String.t | Table name to read from/write to. Defaults to the underscored resource name. | |
partition_key | atom | Required partition (hash) key attribute name. | |
sort_key | atom | nil | Optional sort (range) key attribute name. |
dynamodb.global_secondary_index
Defines a Global Secondary Index (GSI) for automatic query routing.
When a query filters on a GSI's partition key, AshDynamo automatically routes the query to that index instead of scanning the table.
global_secondary_index :by_status do
partition_key :status
sort_key :inserted_at
endOptions
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | Index name (used as the DynamoDB IndexName parameter). | |
partition_key | atom | Partition (hash) key attribute for this GSI. | |
sort_key | atom | nil | Optional sort (range) key attribute for this GSI. |