Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TableClient

Package version

A TableClient represents a Client to the Azure Tables service allowing you to perform operations on a single table.

Hierarchy

  • TableClient

Index

Constructors

constructor

  • Creates a new instance of the TableClient class.

    Parameters

    • url: string

      The URL of the service account that is the target of the desired operation., such as "https://myaccount.table.core.windows.net".

    • tableName: string

      the name of the table

    • credential: TablesSharedKeyCredential

      TablesSharedKeyCredential used to authenticate requests. Only Supported for Browsers

    • Optional options: TableClientOptions

      Optional. Options to configure the HTTP pipeline.

      Example using an account name/key:

      const account = "<storage account name>";
      const tableName = "<table name>";
      const sharedKeyCredential = new TablesSharedKeyCredential(account, "<account key>");
      
      const tableServiceClient = new TableServiceClient(
        `https://${account}.table.core.windows.net`,
        `${tableName}`
        sharedKeyCredential
      );

    Returns TableClient

  • Creates an instance of TableClient.

    Parameters

    • url: string

      The URL of the service account that is the target of the desired operation., such as "https://myaccount.table.core.windows.net".

    • tableName: string

      the name of the table

    • Optional options: TableClientOptions

      Optional. Options to configure the HTTP pipeline.

      Example using an account name/key:

      const account = "<storage account name>";
      const tableName = "<table name>";
      const sharedKeyCredential = new TablesSharedKeyCredential(account, "<account key>");
      
      const tableServiceClient = new TableServiceClient(
        `https://${account}.table.core.windows.net`,
        `${tableName}`
        sharedKeyCredential
      );

    Returns TableClient

Properties

tableName

tableName: string

Name of the table to perform operations on.

Methods

create

createEntity

delete

  • delete(options?: DeleteTableOptions): Promise<DeleteTableResponse>
  • Permanently deletes the current table with all of its entities.

    Parameters

    • Default value options: DeleteTableOptions = {}

      The options parameters.

    Returns Promise<DeleteTableResponse>

deleteEntity

  • deleteEntity(partitionKey: string, rowKey: string, options?: DeleteTableEntityOptions): Promise<DeleteTableEntityResponse>
  • Deletes the specified entity in the table.

    Parameters

    • partitionKey: string

      The partition key of the entity.

    • rowKey: string

      The row key of the entity.

    • Default value options: DeleteTableEntityOptions = {}

      The options parameters.

    Returns Promise<DeleteTableEntityResponse>

getEntity

  • Returns a single entity in the table.

    Type parameters

    • T: object

    Parameters

    • partitionKey: string

      The partition key of the entity.

    • rowKey: string

      The row key of the entity.

    • Default value options: GetTableEntityOptions = {}

      The options parameters.

    Returns Promise<GetTableEntityResponse<T>>

listEntities

updateEntity

  • Update an entity in the table.

    Type parameters

    • T: object

    Parameters

    • entity: TableEntity<T>

      The properties of the entity to be updated.

    • mode: UpdateMode

      The different modes for updating the entity: - Merge: Updates an entity by updating the entity's properties without replacing the existing entity. - Replace: Updates an existing entity by replacing the entire entity.

    • Default value options: UpdateTableEntityOptions = {}

      The options parameters.

    Returns Promise<UpdateEntityResponse>

upsertEntity

  • Upsert an entity in the table.

    Type parameters

    • T: object

    Parameters

    • entity: TableEntity<T>

      The properties for the table entity.

    • mode: UpdateMode

      The different modes for updating the entity: - Merge: Updates an entity by updating the entity's properties without replacing the existing entity. - Replace: Updates an existing entity by replacing the entire entity.

    • Default value options: UpsertTableEntityOptions = {}

      The options parameters.

    Returns Promise<UpsertEntityResponse>

Static fromConnectionString

  • fromConnectionString(connectionString: string, tableName: string, options?: TableClientOptions): TableClient
  • Creates an instance of TableClient from connection string.

    Parameters

    • connectionString: string

      Account connection string or a SAS connection string of an Azure storage account. [ Note - Account connection string can only be used in NODE.JS runtime. ] Account connection string example - DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net SAS connection string example - BlobEndpoint=https://myaccount.table.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString

    • tableName: string
    • Optional options: TableClientOptions

    Returns TableClient

    A new TableClient from the given connection string.

Generated using TypeDoc