AzureStorage.Table (AzureStorage v0.1.2) View Source
Azure Table Service
ref. https://docs.microsoft.com/en-us/rest/api/storageservices/table-service-rest-api
{:ok, context} = AzureStorage.create_table_service("account_name", "account_key")
context |> retrieve_entity("partition_key_value", "row_key_value")
Link to this section Summary
Functions
Deletes an existing entity in a table.
The Insert Entity operation inserts a new entity into a table.
The Insert Or Merge Entity operation updates an existing entity or inserts a new entity if it does not exist in the table.
The Insert Or Replace Entity operation replaces an existing entity or inserts a new entity if it does not exist in the table.
The Merge Entity operation updates an existing entity by updating the entity's properties.
Query entities from a table storage
Query entities from a table storage with continuation_token
.
Retrieve an entity by PartitionKey and RowKey
The Update Entity operation updates an existing entity in a table.
Link to this section Functions
delete_entity(context, table_name, partition_key, row_key, etag \\ "*")
View SourceSpecs
delete_entity( AzureStorage.Request.Context.t(), String.t(), String.t(), String.t(), binary() ) :: {:ok, String.t()} | {:error, String.t()}
Deletes an existing entity in a table.
Specs
insert_entity( AzureStorage.Request.Context.t(), String.t(), AzureStorage.Table.EntityDescriptor.t() ) :: {:ok, map()} | {:error, String.t()}
The Insert Entity operation inserts a new entity into a table.
ref. https://docs.microsoft.com/en-us/rest/api/storageservices/insert-entity
alias AzureStorage.Table.EntityDescriptor
import AzureStorage.Table.EntityGenerator
entity = %EntityDescriptor{}
|> partition_key("partition_key_1")
|> row_key("row_key_1")
|> string("Message", "Hello World")
context |> AzureStorage.Table.insert_entity("table1", entity)
# {:ok, %{"ETag" => ...}}
The Insert Or Merge Entity operation updates an existing entity or inserts a new entity if it does not exist in the table.
Because this operation can insert or update an entity, it is also known as an upsert operation.
The Insert Or Replace Entity operation replaces an existing entity or inserts a new entity if it does not exist in the table.
Because this operation can insert or update an entity, it is also known as an upsert operation.
The Merge Entity operation updates an existing entity by updating the entity's properties.
This operation does not replace the existing entity, as the Update Entity operation does.
Specs
query_entities(AzureStorage.Request.Context.t(), AzureStorage.Table.Query.t()) :: {:ok, list(), String.t()} | {:error, String.t()}
Query entities from a table storage
Specs
query_entities( AzureStorage.Request.Context.t(), AzureStorage.Table.Query.t(), String.t() | nil ) :: {:ok, list(), String.t()} | {:error, String.t()}
Query entities from a table storage with continuation_token
.
Retrieve an entity by PartitionKey and RowKey
The Update Entity operation updates an existing entity in a table.
The Update Entity operation replaces the entire entity and can be used to remove properties.