Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor database API refactoring #544

Merged
merged 2 commits into from
Aug 30, 2024
Merged

Minor database API refactoring #544

merged 2 commits into from
Aug 30, 2024

Conversation

mbarnes
Copy link
Collaborator

@mbarnes mbarnes commented Aug 30, 2024

What this PR does

  1. Use case-insensitive search for ResourceDocument

    The StringEquals function can do case-insensitive comparisons. This means resource IDs no longer have to be lowercased prior to reading from or writing to the Resources container.

  2. Add ResourceID wrapper type

    This is a thinly wrappered azcorearm.ResourceID that implements the encoding.TextMarshaler and encoding.TextUnmarshaler interfaces, so that ResourceID can be used directly in structs that get built from JSON data.

    I proposed this for azcorearm.ResourceID in Azure/azure-sdk-for-go#23381. If accepted, we can eventually remove this wrapper type.

Matthew Barnes added 2 commits August 30, 2024 09:47
The StringEquals function can do case-insensitive comparisons:
https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/query/stringequals

This means resource IDs no longer have to be lowercased prior to
reading from or writing to the Resources container.
This is a thinly wrappered azcorearm.ResourceID that implements
the encoding.TextMarshaler and encoding.TextUnmarshaler interfaces,
so that ResourceID can be used directly in structs that get built
from JSON data.

I proposed this for azcorearm.ResourceID in:
Azure/azure-sdk-for-go#23381
@mjlshen mjlshen enabled auto-merge (rebase) August 30, 2024 13:59
@mjlshen mjlshen merged commit a322e3b into main Aug 30, 2024
24 checks passed
@mjlshen mjlshen deleted the enhanced-resource-id branch August 30, 2024 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants