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

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

Link to this function

delete_entity(context, table_name, partition_key, row_key, etag \\ "*")

View Source

Specs

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.

Link to this function

insert_entity(context, table_name, entity_descriptor)

View Source

Specs

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" => ...}}
Link to this function

insert_or_merge_entity(context, table_name, entity_descriptor)

View Source

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.

Link to this function

insert_or_replace_entity(context, table_name, entity_descriptor)

View Source

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.

Link to this function

merge_entity(context, table_name, entity_descriptor)

View Source

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.

Link to this function

query_entities(context, query)

View Source

Specs

query_entities(AzureStorage.Request.Context.t(), AzureStorage.Table.Query.t()) ::
  {:ok, list(), String.t()} | {:error, String.t()}

Query entities from a table storage

Link to this function

query_entities(context, query, continuation_token)

View Source

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.

Link to this function

retrieve_entity(context, table_name, partition_key, row_key)

View Source

Retrieve an entity by PartitionKey and RowKey

Link to this function

update_entity(context, table_name, entity_descriptor)

View Source

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.