-
Notifications
You must be signed in to change notification settings - Fork 566
Table Storage
To ensure a table exists, call createTableIfNotExists:
var tableService = azure.createTableService();
tableService.createTableIfNotExists('tasktable', function(error){
if(!error){
// Table exists
}
});
A new entity can be added by calling insertEntity:
var tableService = azure.createTableService(),
task1 = {
PartitionKey : 'tasksSeattle',
RowKey: '1',
Description: 'Take out the trash',
DueDate: new Date(2011, 12, 14, 12)
};
tableService.insertEntity('tasktable', task1, function(error){
if(!error){
// Entity inserted
}
});
The method queryEntity can then be used to fetch the entity that was just inserted:
var tableService = azure.createTableService();
tableService.queryEntity('tasktable', 'tasksSeattle', '1', function(error, serverEntity){
if(!error){
// Entity available in serverEntity variable
}
});
Gets the properties of a storage account’s Table service, including Windows Azure Storage Analytics.
- [options]
- (object) The request options
- [options.timeoutIntervalInMs]
- (int) The timeout interval, in milliseconds, to use for the request.
- callback
- (function(error, servicePropertiesResult, response)) The callback function
Sets the properties of a storage account’s Table service, including Windows Azure Storage Analytics.
You can also use this operation to set the default request version for all incoming requests that do not have a version specified.
- serviceProperties
- (object) The service properties
- [options]
- (object) The request options
- [options.timeoutIntervalInMs]
- (int) The timeout interval, in milliseconds, to use for the request.
- callback
- (function(error, response)) The callback function
Gets a table properties.
- table
- (string) The table name
- [options]
- (object) The request options
- [options.timeoutIntervalInMs]
- (int) The timeout interval, in milliseconds, to use for the request.
- callback
- (function(error, tableResult, response)) The callback function
Creates a new table within a storage account.
Create a table with the given table name. This will return an error if the table already exists.
- table
- (string) The table name
- [options]
- (object) The request options
- [options.timeoutIntervalInMs]
- (int) The timeout interval, in milliseconds, to use for the request.
- callback
- (function(error, tableResult, response)) The callback function
Creates a new table within a storage account if it doesn't exist.
- table
- (string) The table name
- [options]
- (object) The request options
- [options.timeoutIntervalInMs]
- (int) The timeout interval, in milliseconds, to use for the request.
- callback
- (function(error, created, response)) The callback function
Deletes a table from a storage account.
- table
- (string) The table name
- [options]
- (object) The request options
- [options.timeoutIntervalInMs]
- (int) The timeout interval, in milliseconds, to use for the request.
- callback
- (function(error, successful, response)) The callback function
Enumerates the tables in a storage account.
- [options]
- (object) The request options
- [options.nextTableName]
- (string) The next table name marker.
- [options.timeoutIntervalInMs]
- (int) The timeout interval, in milliseconds, to use for the request.
- callback
- (function(error, queryTablesResult, response)) The callback function
Queries an entity in a table.
- table
- (string) The table name
- partitionKey
- (string) The partition key
- rowKey
- (string) The row key
- [options]
- (object) The request options
- [options.timeoutIntervalInMs]
- (int) The timeout interval, in milliseconds, to use for the request.
- callback
- (function(error, tableEntity, response)) The callback function
- tableQuery
- (TableQuery) The query to perform
- [options]
- (object) The request options
- [options.timeoutIntervalInMs]
- (int) The timeout interval, in milliseconds, to use for the request.
- callback
- (function(error, queryEntitiesResult, queryEntitiesContinuation, response)) The callback function