question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

API consistency nitpicks for Azure.Data.Tables

See original GitHub issue

Library or service name. Azure.Data.Tables

Is your feature request related to a problem? Please describe. I’ve been working on moving a project that uses Azure Table Storage heavily over to the new SDK. Love it so far. Just found a couple places that maybe could be brought to a more consistency state before the first RTM:

  • 1. No Name or AccountName properties on TableClient.

    • These are very helpful for logging when passing around TableClient to helper methods.
    • QueueClient has these
    • BlobContainerClient has these
  • 1. The TableItem type returned by TableServiceClient.GetTableAsync(...) has a TableName property instead of Name

    • No negative impact for me, just inconsistent
    • BlobContainerItem has Name (docs)
    • QueueItem has Name (docs)
  • 1. No TableClient.ExistsAsync() method

    • Some of my tests could really use this. I have cases where I want to verify a table was not created.
    • Workaround: A small Query with no filter, catch the 404 (example)
    • QueueClient has this
    • BlobContainerClient has this
  • 1. No TableServiceClient.GetTablesAsync(Expression<Func<TableSomething, bool>>) overload, you must write the OData yourself

    • I would prefer compile-time checks on comparisons against the available table properties for these queries
    • This is inconsistent with the Expression<Func<T, bool>> filter parameter on TableClient.QueryAsync<T>
    • Workaround: Use TableClient.CreateQueryFilter<TableItem> since fortunately (?) it doesn’t have ITableEntity constraint
  • 1. No TableServiceClient.GetTablesAsync(prefix: ...) overload

    • This is helpful for test clean-up. I have many integration tests that run in parallel, with their own table name prefix.
    • Workaround: use an OData range query, bounded on the top by some max char (example)
  • 1. No TableClient.DeleteIfExistsAsync

  • 1. No TableServiceClient.Uri

    • This is helpful for diagnostics, for example if you have the wrong cloud endpoint suffix provided
    • BlobServiceClient has this
    • QueueServiceClient has this

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:7
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
rhythmnewtcommented, Oct 12, 2021

@christothes what about TableClient.ExistsAsync(), is that on the horizon as well?

No - An Exists method is inherently racy. For example, what decision could accurately be made after getting the result of Exists()? No matter the result, there is no guarantee that the result is still accurate when your code does something after that. You are better off just trying to do whatever you would have done and letting it either fail or succeed.

Sure that makes sense, it just wasn’t clear that it’s out of scope.

Thanks for the quick reply!

0reactions
christothescommented, Oct 12, 2021

@christothes what about TableClient.ExistsAsync(), is that on the horizon as well?

No - An Exists method is inherently racy. For example, what decision could accurately be made after getting the result of Exists()? No matter the result, there is no guarantee that the result is still accurate when your code does something after that. You are better off just trying to do whatever you would have done and letting it either fail or succeed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

API for Table in Azure Cosmos DB ...
Azure Cosmos DB offers five consistency levels to API for Table developers, so you can choose the right consistency model at the table...
Read more >
Azure Cosmos DB global distribution tutorial for API for Table
Learn how global distribution works in Azure Cosmos DB for Table accounts and how to configure the preferred list of regions.
Read more >
Design a scalable partitioning strategy for Azure Table ...
This article discusses partitioning a table in Azure Table storage and strategies you can use to ensure efficient scalability.
Read more >
Is Azure Table Storage deprecated as of now
The only things being deprecated are the original table storage SDKs and Cosmos DB Tables SDKs, but those are being replaced with new...
Read more >
Design scalable and performant tables in Azure ...
Learn to design scalable and performant tables in Azure Table storage. Review table partitions, Entity Group Transactions, and capacity and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found