@azure/data-tables 13.3.1-alpha.20250224.1 → 13.3.1-alpha.20250225.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -125
- package/dist/browser/TableClient.d.ts +161 -179
- package/dist/browser/TableClient.d.ts.map +1 -1
- package/dist/browser/TableClient.js +125 -148
- package/dist/browser/TableClient.js.map +1 -1
- package/dist/browser/TableServiceClient.d.ts +32 -21
- package/dist/browser/TableServiceClient.d.ts.map +1 -1
- package/dist/browser/TableServiceClient.js.map +1 -1
- package/dist/commonjs/TableClient.d.ts +161 -179
- package/dist/commonjs/TableClient.d.ts.map +1 -1
- package/dist/commonjs/TableClient.js +125 -148
- package/dist/commonjs/TableClient.js.map +1 -1
- package/dist/commonjs/TableServiceClient.d.ts +32 -21
- package/dist/commonjs/TableServiceClient.d.ts.map +1 -1
- package/dist/commonjs/TableServiceClient.js.map +1 -1
- package/dist/esm/TableClient.d.ts +161 -179
- package/dist/esm/TableClient.d.ts.map +1 -1
- package/dist/esm/TableClient.js +125 -148
- package/dist/esm/TableClient.js.map +1 -1
- package/dist/esm/TableServiceClient.d.ts +32 -21
- package/dist/esm/TableServiceClient.d.ts.map +1 -1
- package/dist/esm/TableServiceClient.js.map +1 -1
- package/dist/react-native/TableClient.d.ts +161 -179
- package/dist/react-native/TableClient.d.ts.map +1 -1
- package/dist/react-native/TableClient.js +125 -148
- package/dist/react-native/TableClient.js.map +1 -1
- package/dist/react-native/TableServiceClient.d.ts +32 -21
- package/dist/react-native/TableServiceClient.d.ts.map +1 -1
- package/dist/react-native/TableServiceClient.js.map +1 -1
- package/package.json +12 -11
|
@@ -38,18 +38,18 @@ export declare class TableClient {
|
|
|
38
38
|
*
|
|
39
39
|
* ### Example using an account name/key:
|
|
40
40
|
*
|
|
41
|
-
* ```
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* const
|
|
46
|
-
* const
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* );
|
|
41
|
+
* ```ts snippet:ReadmeSampleCreateTableClient_NamedKeyCredential
|
|
42
|
+
* import { AzureNamedKeyCredential, TableClient } from "@azure/data-tables";
|
|
43
|
+
*
|
|
44
|
+
* // Enter your storage account name and shared key
|
|
45
|
+
* const account = "<account>";
|
|
46
|
+
* const accountKey = "<accountkey>";
|
|
47
|
+
* const tableName = "<tableName>";
|
|
48
|
+
*
|
|
49
|
+
* // Use AzureNamedKeyCredential with storage account and account key
|
|
50
|
+
* // AzureNamedKeyCredential is only available in Node.js runtime, not in browsers
|
|
51
|
+
* const credential = new AzureNamedKeyCredential(account, accountKey);
|
|
52
|
+
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
53
53
|
* ```
|
|
54
54
|
*/
|
|
55
55
|
constructor(url: string, tableName: string, credential: NamedKeyCredential, options?: TableClientOptions);
|
|
@@ -64,17 +64,17 @@ export declare class TableClient {
|
|
|
64
64
|
*
|
|
65
65
|
* ### Example using a SAS Token:
|
|
66
66
|
*
|
|
67
|
-
* ```
|
|
68
|
-
*
|
|
69
|
-
* const account = "<storage account name>";
|
|
70
|
-
* const sasToken = "<sas-token>";
|
|
71
|
-
* const tableName = "<table name>";
|
|
72
|
-
* const sasCredential = new AzureSASCredential(sasToken);
|
|
67
|
+
* ```ts snippet:ReadmeSampleCreateTableClient_SASToken
|
|
68
|
+
* import { TableClient, AzureSASCredential } from "@azure/data-tables";
|
|
73
69
|
*
|
|
74
|
-
* const
|
|
70
|
+
* const account = "<account name>";
|
|
71
|
+
* const sas = "<service Shared Access Signature Token>";
|
|
72
|
+
* const tableName = "<tableName>";
|
|
73
|
+
*
|
|
74
|
+
* const clientWithSAS = new TableClient(
|
|
75
75
|
* `https://${account}.table.core.windows.net`,
|
|
76
76
|
* tableName,
|
|
77
|
-
*
|
|
77
|
+
* new AzureSASCredential(sas),
|
|
78
78
|
* );
|
|
79
79
|
* ```
|
|
80
80
|
*/
|
|
@@ -90,18 +90,22 @@ export declare class TableClient {
|
|
|
90
90
|
*
|
|
91
91
|
* ### Example using an Azure Active Directory credential:
|
|
92
92
|
*
|
|
93
|
-
* ```
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
93
|
+
* ```ts snippet:ReadmeSampleCreateTableClient_TokenCredential
|
|
94
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
95
|
+
* import { TableClient } from "@azure/data-tables";
|
|
96
|
+
*
|
|
97
|
+
* // DefaultAzureCredential expects the following three environment variables:
|
|
98
|
+
* // - AZURE_TENANT_ID: The tenant ID in Azure Active Directory
|
|
99
|
+
* // - AZURE_CLIENT_ID: The application (client) ID registered in the AAD tenant
|
|
100
|
+
* // - AZURE_CLIENT_SECRET: The client secret for the registered application
|
|
99
101
|
* const credential = new DefaultAzureCredential();
|
|
102
|
+
* const account = "<account name>";
|
|
103
|
+
* const tableName = "<tableName>";
|
|
100
104
|
*
|
|
101
|
-
* const
|
|
105
|
+
* const clientWithAAD = new TableClient(
|
|
102
106
|
* `https://${account}.table.core.windows.net`,
|
|
103
107
|
* tableName,
|
|
104
|
-
* credential
|
|
108
|
+
* credential,
|
|
105
109
|
* );
|
|
106
110
|
* ```
|
|
107
111
|
*/
|
|
@@ -117,15 +121,16 @@ export declare class TableClient {
|
|
|
117
121
|
*
|
|
118
122
|
* ### Example appending a SAS token:
|
|
119
123
|
*
|
|
120
|
-
* ```
|
|
121
|
-
*
|
|
122
|
-
*
|
|
124
|
+
* ```ts snippet:ReadmeSampleCreateTableClient_SASTokenURL
|
|
125
|
+
* import { TableClient } from "@azure/data-tables";
|
|
126
|
+
*
|
|
127
|
+
* const account = "<account name>";
|
|
123
128
|
* const sasToken = "<SAS token>";
|
|
124
|
-
* const tableName = "<
|
|
129
|
+
* const tableName = "<tableName>";
|
|
125
130
|
*
|
|
126
|
-
* const
|
|
131
|
+
* const clientWithSAS = new TableClient(
|
|
127
132
|
* `https://${account}.table.core.windows.net?${sasToken}`,
|
|
128
|
-
*
|
|
133
|
+
* tableName,
|
|
129
134
|
* );
|
|
130
135
|
* ```
|
|
131
136
|
*/
|
|
@@ -135,22 +140,16 @@ export declare class TableClient {
|
|
|
135
140
|
* @param options - The options parameters.
|
|
136
141
|
*
|
|
137
142
|
* ### Example deleting a table
|
|
138
|
-
* ```
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
* const
|
|
142
|
-
* const
|
|
143
|
-
* const
|
|
144
|
-
*
|
|
145
|
-
* const
|
|
146
|
-
*
|
|
147
|
-
* `${tableName}`,
|
|
148
|
-
* sharedKeyCredential
|
|
149
|
-
* );
|
|
143
|
+
* ```ts snippet:ReadmeSampleDeleteTable
|
|
144
|
+
* import { AzureNamedKeyCredential, TableClient } from "@azure/data-tables";
|
|
145
|
+
*
|
|
146
|
+
* const account = "<account>";
|
|
147
|
+
* const accountKey = "<accountkey>";
|
|
148
|
+
* const tableName = "<tableName>";
|
|
149
|
+
*
|
|
150
|
+
* const credential = new AzureNamedKeyCredential(account, accountKey);
|
|
151
|
+
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
150
152
|
*
|
|
151
|
-
* // calling deleteTable will delete the table used
|
|
152
|
-
* // to instantiate the TableClient.
|
|
153
|
-
* // Note: If the table doesn't exist this function doesn't fail.
|
|
154
153
|
* await client.deleteTable();
|
|
155
154
|
* ```
|
|
156
155
|
*/
|
|
@@ -160,23 +159,17 @@ export declare class TableClient {
|
|
|
160
159
|
* @param options - The options parameters.
|
|
161
160
|
*
|
|
162
161
|
* ### Example creating a table
|
|
163
|
-
* ```
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
* const
|
|
167
|
-
* const
|
|
168
|
-
* const
|
|
169
|
-
*
|
|
170
|
-
* const
|
|
171
|
-
*
|
|
172
|
-
* `${tableName}`,
|
|
173
|
-
* sharedKeyCredential
|
|
174
|
-
* );
|
|
162
|
+
* ```ts snippet:ReadmeSampleTableClientCreateTable
|
|
163
|
+
* import { AzureNamedKeyCredential, TableClient } from "@azure/data-tables";
|
|
164
|
+
*
|
|
165
|
+
* const account = "<account>";
|
|
166
|
+
* const accountKey = "<accountkey>";
|
|
167
|
+
* const tableName = "<tableName>";
|
|
168
|
+
*
|
|
169
|
+
* const credential = new AzureNamedKeyCredential(account, accountKey);
|
|
170
|
+
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
175
171
|
*
|
|
176
|
-
* //
|
|
177
|
-
* // to instantiate the TableClient.
|
|
178
|
-
* // Note: If the table already
|
|
179
|
-
* // exists this function doesn't throw.
|
|
172
|
+
* // If the table 'newTable' already exists, createTable doesn't throw
|
|
180
173
|
* await client.createTable();
|
|
181
174
|
* ```
|
|
182
175
|
*/
|
|
@@ -188,24 +181,18 @@ export declare class TableClient {
|
|
|
188
181
|
* @param options - The options parameters.
|
|
189
182
|
*
|
|
190
183
|
* ### Example getting an entity
|
|
191
|
-
* ```
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
* const
|
|
195
|
-
* const
|
|
196
|
-
* const
|
|
197
|
-
*
|
|
198
|
-
* const
|
|
199
|
-
*
|
|
200
|
-
* `${tableName}`,
|
|
201
|
-
* sharedKeyCredential
|
|
202
|
-
* );
|
|
184
|
+
* ```ts snippet:ReadmeSampleGetEntity
|
|
185
|
+
* import { AzureNamedKeyCredential, TableClient } from "@azure/data-tables";
|
|
186
|
+
*
|
|
187
|
+
* const account = "<account>";
|
|
188
|
+
* const accountKey = "<accountkey>";
|
|
189
|
+
* const tableName = "<tableName>";
|
|
190
|
+
*
|
|
191
|
+
* const credential = new AzureNamedKeyCredential(account, accountKey);
|
|
192
|
+
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
203
193
|
*
|
|
204
|
-
* // getEntity will get a single entity stored in the service that
|
|
205
|
-
* // matches exactly the partitionKey and rowKey used as parameters
|
|
206
|
-
* // to the method.
|
|
207
194
|
* const entity = await client.getEntity("<partitionKey>", "<rowKey>");
|
|
208
|
-
* console.log(entity);
|
|
195
|
+
* console.log(`Entity: PartitionKey: ${entity.partitionKey} RowKey: ${entity.rowKey}`);
|
|
209
196
|
* ```
|
|
210
197
|
*/
|
|
211
198
|
getEntity<T extends object = Record<string, unknown>>(partitionKey: string, rowKey: string, options?: GetTableEntityOptions): Promise<GetTableEntityResponse<TableEntityResult<T>>>;
|
|
@@ -214,28 +201,20 @@ export declare class TableClient {
|
|
|
214
201
|
* @param options - The options parameters.
|
|
215
202
|
*
|
|
216
203
|
* Example listing entities
|
|
217
|
-
* ```
|
|
218
|
-
*
|
|
219
|
-
* const account = "<storage account name>";
|
|
220
|
-
* const accountKey = "<account key>"
|
|
221
|
-
* const tableName = "<table name>";
|
|
222
|
-
* const sharedKeyCredential = new AzureNamedKeyCredential(account, accountKey);
|
|
223
|
-
*
|
|
224
|
-
* const client = new TableClient(
|
|
225
|
-
* `https://${account}.table.core.windows.net`,
|
|
226
|
-
* `${tableName}`,
|
|
227
|
-
* sharedKeyCredential
|
|
228
|
-
* );
|
|
204
|
+
* ```ts snippet:ReadmeSampleListEntities
|
|
205
|
+
* import { AzureNamedKeyCredential, TableClient } from "@azure/data-tables";
|
|
229
206
|
*
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
207
|
+
* const account = "<account>";
|
|
208
|
+
* const accountKey = "<accountkey>";
|
|
209
|
+
* const tableName = "<tableName>";
|
|
210
|
+
*
|
|
211
|
+
* const credential = new AzureNamedKeyCredential(account, accountKey);
|
|
212
|
+
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
234
213
|
*
|
|
235
|
-
*
|
|
236
|
-
*
|
|
214
|
+
* let i = 0;
|
|
215
|
+
* const entities = client.listEntities();
|
|
237
216
|
* for await (const entity of entities) {
|
|
238
|
-
*
|
|
217
|
+
* console.log(`Entity${++i}: PartitionKey: ${entity.partitionKey} RowKey: ${entity.rowKey}`);
|
|
239
218
|
* }
|
|
240
219
|
* ```
|
|
241
220
|
*/
|
|
@@ -249,22 +228,23 @@ export declare class TableClient {
|
|
|
249
228
|
* @param options - The options parameters.
|
|
250
229
|
*
|
|
251
230
|
* ### Example creating an entity
|
|
252
|
-
* ```
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
* const
|
|
256
|
-
* const
|
|
257
|
-
* const
|
|
258
|
-
*
|
|
259
|
-
* const
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
*
|
|
263
|
-
*
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
*
|
|
231
|
+
* ```ts snippet:ReadmeSampleCreateEntity
|
|
232
|
+
* import { AzureNamedKeyCredential, TableClient } from "@azure/data-tables";
|
|
233
|
+
*
|
|
234
|
+
* const account = "<account>";
|
|
235
|
+
* const accountKey = "<accountkey>";
|
|
236
|
+
* const tableName = "<tableName>";
|
|
237
|
+
*
|
|
238
|
+
* const credential = new AzureNamedKeyCredential(account, accountKey);
|
|
239
|
+
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
240
|
+
*
|
|
241
|
+
* const testEntity = {
|
|
242
|
+
* partitionKey: "P1",
|
|
243
|
+
* rowKey: "R1",
|
|
244
|
+
* foo: "foo",
|
|
245
|
+
* bar: 123,
|
|
246
|
+
* };
|
|
247
|
+
* await client.createEntity(testEntity);
|
|
268
248
|
* ```
|
|
269
249
|
*/
|
|
270
250
|
createEntity<T extends object>(entity: TableEntity<T>, options?: OperationOptions): Promise<CreateTableEntityResponse>;
|
|
@@ -275,22 +255,18 @@ export declare class TableClient {
|
|
|
275
255
|
* @param options - The options parameters.
|
|
276
256
|
*
|
|
277
257
|
* ### Example deleting an entity
|
|
278
|
-
* ```
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
* const
|
|
282
|
-
* const
|
|
283
|
-
* const
|
|
284
|
-
*
|
|
285
|
-
* const client = new TableClient(
|
|
286
|
-
* `https://${account}.table.core.windows.net`,
|
|
287
|
-
* `${tableName}`,
|
|
288
|
-
* sharedKeyCredential
|
|
289
|
-
* );
|
|
258
|
+
* ```ts snippet:ReadmeSampleDeleteEntity
|
|
259
|
+
* import { AzureNamedKeyCredential, TableClient } from "@azure/data-tables";
|
|
260
|
+
*
|
|
261
|
+
* const account = "<account>";
|
|
262
|
+
* const accountKey = "<accountkey>";
|
|
263
|
+
* const tableName = "<tableName>";
|
|
290
264
|
*
|
|
291
|
-
*
|
|
292
|
-
*
|
|
293
|
-
*
|
|
265
|
+
* const credential = new AzureNamedKeyCredential(account, accountKey);
|
|
266
|
+
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
267
|
+
*
|
|
268
|
+
* // deleteEntity deletes the entity that matches exactly the partitionKey and rowKey
|
|
269
|
+
* await client.deleteEntity("<partitionKey>", "<rowKey>");
|
|
294
270
|
* ```
|
|
295
271
|
*/
|
|
296
272
|
deleteEntity(partitionKey: string, rowKey: string, options?: DeleteTableEntityOptions): Promise<DeleteTableEntityResponse>;
|
|
@@ -303,20 +279,17 @@ export declare class TableClient {
|
|
|
303
279
|
* @param options - The options parameters.
|
|
304
280
|
*
|
|
305
281
|
* ### Example updating an entity
|
|
306
|
-
* ```
|
|
307
|
-
*
|
|
308
|
-
* const account = "<storage account name>";
|
|
309
|
-
* const accountKey = "<account key>"
|
|
310
|
-
* const tableName = "<table name>";
|
|
311
|
-
* const sharedKeyCredential = new AzureNamedKeyCredential(account, accountKey);
|
|
312
|
-
*
|
|
313
|
-
* const client = new TableClient(
|
|
314
|
-
* `https://${account}.table.core.windows.net`,
|
|
315
|
-
* `${tableName}`,
|
|
316
|
-
* sharedKeyCredential
|
|
317
|
-
* );
|
|
282
|
+
* ```ts snippet:ReadmeSampleUpdateEntity
|
|
283
|
+
* import { AzureNamedKeyCredential, TableClient } from "@azure/data-tables";
|
|
318
284
|
*
|
|
319
|
-
* const
|
|
285
|
+
* const account = "<account>";
|
|
286
|
+
* const accountKey = "<accountkey>";
|
|
287
|
+
* const tableName = "<tableName>";
|
|
288
|
+
*
|
|
289
|
+
* const credential = new AzureNamedKeyCredential(account, accountKey);
|
|
290
|
+
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
291
|
+
*
|
|
292
|
+
* const entity = { partitionKey: "p1", rowKey: "r1", bar: "updatedBar" };
|
|
320
293
|
*
|
|
321
294
|
* // Update uses update mode "Merge" as default
|
|
322
295
|
* // merge means that update will match a stored entity
|
|
@@ -324,13 +297,13 @@ export declare class TableClient {
|
|
|
324
297
|
* // passed to the method and then will only update the properties present in it.
|
|
325
298
|
* // Any other properties that are not defined in the entity passed to updateEntity
|
|
326
299
|
* // will remain as they are in the service
|
|
327
|
-
* await client.updateEntity(entity)
|
|
300
|
+
* await client.updateEntity(entity);
|
|
328
301
|
*
|
|
329
302
|
* // We can also set the update mode to Replace, which will match the entity passed
|
|
330
303
|
* // to updateEntity with one stored in the service and replace with the new one.
|
|
331
304
|
* // If there are any missing properties in the entity passed to updateEntity, they
|
|
332
305
|
* // will be removed from the entity stored in the service
|
|
333
|
-
* await client.updateEntity(entity, "Replace")
|
|
306
|
+
* await client.updateEntity(entity, "Replace");
|
|
334
307
|
* ```
|
|
335
308
|
*/
|
|
336
309
|
updateEntity<T extends object>(entity: TableEntity<T>, mode?: UpdateMode, options?: UpdateTableEntityOptions): Promise<UpdateEntityResponse>;
|
|
@@ -343,30 +316,27 @@ export declare class TableClient {
|
|
|
343
316
|
* @param options - The options parameters.
|
|
344
317
|
*
|
|
345
318
|
* ### Example upserting an entity
|
|
346
|
-
* ```
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
* const
|
|
350
|
-
* const
|
|
351
|
-
* const
|
|
352
|
-
*
|
|
353
|
-
* const
|
|
354
|
-
*
|
|
355
|
-
* `${tableName}`,
|
|
356
|
-
* sharedKeyCredential
|
|
357
|
-
* );
|
|
319
|
+
* ```ts snippet:ReadmeSampleUpsertEntity
|
|
320
|
+
* import { AzureNamedKeyCredential, TableClient } from "@azure/data-tables";
|
|
321
|
+
*
|
|
322
|
+
* const account = "<account>";
|
|
323
|
+
* const accountKey = "<accountkey>";
|
|
324
|
+
* const tableName = "<tableName>";
|
|
325
|
+
*
|
|
326
|
+
* const credential = new AzureNamedKeyCredential(account, accountKey);
|
|
327
|
+
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
358
328
|
*
|
|
359
|
-
* const entity = {partitionKey: "p1", rowKey: "r1", bar: "updatedBar"};
|
|
329
|
+
* const entity = { partitionKey: "p1", rowKey: "r1", bar: "updatedBar" };
|
|
360
330
|
*
|
|
361
331
|
* // Upsert uses update mode "Merge" as default.
|
|
362
332
|
* // This behaves similarly to update but creates the entity
|
|
363
333
|
* // if it doesn't exist in the service
|
|
364
|
-
* await client.upsertEntity(entity)
|
|
334
|
+
* await client.upsertEntity(entity);
|
|
365
335
|
*
|
|
366
336
|
* // We can also set the update mode to Replace.
|
|
367
337
|
* // This behaves similarly to update but creates the entity
|
|
368
338
|
* // if it doesn't exist in the service
|
|
369
|
-
* await client.upsertEntity(entity, "Replace")
|
|
339
|
+
* await client.upsertEntity(entity, "Replace");
|
|
370
340
|
* ```
|
|
371
341
|
*/
|
|
372
342
|
upsertEntity<T extends object>(entity: TableEntity<T>, mode?: UpdateMode, options?: OperationOptions): Promise<UpsertEntityResponse>;
|
|
@@ -387,30 +357,42 @@ export declare class TableClient {
|
|
|
387
357
|
* or you can use {@link TableTransaction} to help building the transaction.
|
|
388
358
|
*
|
|
389
359
|
* Example usage:
|
|
390
|
-
* ```
|
|
391
|
-
*
|
|
392
|
-
*
|
|
393
|
-
* const
|
|
394
|
-
* const
|
|
395
|
-
* const
|
|
396
|
-
*
|
|
397
|
-
*
|
|
398
|
-
*
|
|
399
|
-
*
|
|
360
|
+
* ```ts snippet:ReadmeSampleSubmitTransaction
|
|
361
|
+
* import { AzureNamedKeyCredential, TableClient, TransactionAction } from "@azure/data-tables";
|
|
362
|
+
*
|
|
363
|
+
* const account = "<account>";
|
|
364
|
+
* const accountKey = "<accountkey>";
|
|
365
|
+
* const tableName = "<tableName>";
|
|
366
|
+
*
|
|
367
|
+
* const credential = new AzureNamedKeyCredential(account, accountKey);
|
|
368
|
+
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
369
|
+
*
|
|
370
|
+
* const actions: TransactionAction[] = [
|
|
371
|
+
* ["create", { partitionKey: "p1", rowKey: "1", data: "test1" }],
|
|
372
|
+
* ["delete", { partitionKey: "p1", rowKey: "2" }],
|
|
373
|
+
* ["update", { partitionKey: "p1", rowKey: "3", data: "newTest" }, "Merge"],
|
|
374
|
+
* ];
|
|
400
375
|
* const result = await client.submitTransaction(actions);
|
|
401
376
|
* ```
|
|
402
377
|
*
|
|
403
378
|
* Example usage with TableTransaction:
|
|
404
|
-
* ```
|
|
405
|
-
*
|
|
406
|
-
*
|
|
407
|
-
* const
|
|
408
|
-
* const
|
|
379
|
+
* ```ts snippet:ReadmeSampleSubmitTransactionWithTableTransaction
|
|
380
|
+
* import { AzureNamedKeyCredential, TableClient, TableTransaction } from "@azure/data-tables";
|
|
381
|
+
*
|
|
382
|
+
* const account = "<account>";
|
|
383
|
+
* const accountKey = "<accountkey>";
|
|
384
|
+
* const tableName = "<tableName>";
|
|
385
|
+
*
|
|
386
|
+
* const credential = new AzureNamedKeyCredential(account, accountKey);
|
|
387
|
+
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
388
|
+
*
|
|
409
389
|
* const transaction = new TableTransaction();
|
|
390
|
+
*
|
|
410
391
|
* // Call the available action in the TableTransaction object
|
|
411
|
-
* transaction.
|
|
412
|
-
* transaction.
|
|
413
|
-
* transaction.
|
|
392
|
+
* transaction.createEntity({ partitionKey: "p1", rowKey: "1", data: "test1" });
|
|
393
|
+
* transaction.deleteEntity("p1", "2");
|
|
394
|
+
* transaction.updateEntity({ partitionKey: "p1", rowKey: "3", data: "newTest" }, "Merge");
|
|
395
|
+
*
|
|
414
396
|
* // submitTransaction with the actions list on the transaction.
|
|
415
397
|
* const result = await client.submitTransaction(transaction.actions);
|
|
416
398
|
* ```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableClient.d.ts","sourceRoot":"","sources":["../../src/TableClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,gBAAgB,EAChB,yBAAyB,IAAI,kBAAkB,EAC/C,WAAW,EAEX,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,EACxB,iBAAiB,EACjB,UAAU,EACV,wBAAwB,EACzB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,yBAAyB,EACzB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAGV,gBAAgB,EAGjB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAgB3F,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAiB1D;;;GAGG;AACH,qBAAa,WAAW;IACtB;;OAEG;IACI,GAAG,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACI,QAAQ,EAAE,QAAQ,CAAC;IAC1B,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,eAAe,CAAgB;IACvC,OAAO,CAAC,UAAU,CAAC,CAAuD;IAC1E,OAAO,CAAC,aAAa,CAAqB;IAC1C,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAU;IAElD;;OAEG;IACH,SAAgB,SAAS,EAAE,MAAM,C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