Skip to main content

table

Creates, updates, deletes, gets or lists a table resource.

Overview

Nametable
TypeResource
Idazure.data_tables.table

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
identifiersarrayAn array of signed identifiers. Required.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_access_policyselecttable_name, accounttimeoutRetrieves details about any stored access policies specified on the table that may be used with Shared Access Signatures.
createinsertaccount$format, PreferCreates a new table under the given account.
deletedeletetable_name, accountDeletes an existing table.
set_access_policyexectable_name, account, identifierstimeoutSets stored access policies for the table that may be used with Shared Access Signatures.
queryexecaccount$format, $top, $select, $filter, NextTableNameQueries tables under the given account.
query_entitiesexectable_name, account$format, $top, $select, $filter, timeout, NextPartitionKey, NextRowKeyQueries entities under the given table.
query_entity_with_partition_and_row_keyexectable_name, partition_key, row_key, accounttimeout, $format, $select, $filterRetrieve a single entity.
update_entityexectable_name, partition_key, row_key, accounttimeoutUpdate entity in a table.
merge_entityexectable_name, partition_key, row_key, accounttimeoutMerge entity in a table.
delete_entityexectable_name, partition_key, row_key, accounttimeoutDeletes the specified entity in a table.
insert_entityexectable_name, accounttimeout, $format, PreferInsert entity in a table.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
accountstringCosmos DB Table API account name. (default: )
partition_keystringThe partition key of the entity. Required.
row_keystringThe row key of the entity. Required.
table_namestringThe name of the table. Required.
$filterstringOData filter expression. Default value is None.
$formatstringSpecifies the metadata format for the response. Known values are: "application/json;odata=nometadata", "application/json;odata=minimalmetadata", and "application/json;odata=fullmetadata". Default value is None.
$selectstringSelect expression using OData notation. Limits the columns on each record to just those requested. Default value is None.
$topintegerSpecifies the maximum number of records to return. Default value is None.
NextPartitionKeystringAn entity partition key query continuation token from a previous call. Default value is None.
NextRowKeystringAn entity row key query continuation token from a previous call. Default value is None.
NextTableNamestring
PreferstringSpecifies whether the response should include the inserted entity in the payload. Possible values are return-no-content and return-content. Known values are: "return-no-content" and "return-content". Default value is None.
timeoutintegerThe timeout parameter is expressed in seconds. Default value is None.

SELECT examples

Retrieves details about any stored access policies specified on the table that may be used with Shared Access Signatures.

SELECT
identifiers
FROM azure.data_tables.table
WHERE table_name = '{{ table_name }}' -- required
AND account = '{{ account }}' -- required
AND timeout = '{{ timeout }}'
;

INSERT examples

Creates a new table under the given account.

INSERT INTO azure.data_tables.table (
TableName,
odata,
account,
$format,
Prefer
)
SELECT
'{{ TableName }}',
'{{ odata }}',
'{{ account }}',
'{{ $format }}',
'{{ Prefer }}'
RETURNING
TableName,
odata
;

DELETE examples

Deletes an existing table.

DELETE FROM azure.data_tables.table
WHERE table_name = '{{ table_name }}' --required
AND account = '{{ account }}' --required
;

Lifecycle Methods

Sets stored access policies for the table that may be used with Shared Access Signatures.

EXEC azure.data_tables.table.set_access_policy 
@table_name='{{ table_name }}' --required,
@account='{{ account }}' --required,
@timeout='{{ timeout }}'
@@json=
'{
"identifiers": "{{ identifiers }}"
}'
;