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

Use OData type annotations to disambiguate property types when persisting #235

Closed
kzu opened this issue Jul 24, 2023 · 0 comments · Fixed by #236
Closed

Use OData type annotations to disambiguate property types when persisting #235

kzu opened this issue Jul 24, 2023 · 0 comments · Fixed by #236
Labels
enhancement New feature or request

Comments

@kzu
Copy link
Member

kzu commented Jul 24, 2023

According to the documentation on updating via JSON payloads, automatic inference of column types might not be possible in all cases. It may be necessary to add OData type annotations for those properties to properly persist in the proper native Table service column type.

Back this issue
Back this issue

@kzu kzu added the enhancement New feature or request label Jul 24, 2023
kzu added a commit that referenced this issue Jul 25, 2023
Previously, we didn't ever annotate properties with OData Edm types, meaning the following supported native column types in Azure Tables would all be converted (and used) as plain strings: byte[], DateTimeOffset, Guid and long.

By following more closely the documentation at https://learn.microsoft.com/en-us/rest/api/storageservices/payload-format-for-table-service-operations#property-types-in-a-json-feed, we effectively make our API more optimal and compatible with the Azure SDK for Table Storage.

In order to avoid too many breaking changes, we only support Edm.DateTime annotation for DateTimeOffset properties, since that's the behavior of the SDK when deserializing such annotated values (not to DateTime). This effectively means that DateTime is more of a legacy type that might best be avoided.

This also now allows using a GUID-typed property for both partition and row keys.

Closes #235.
kzu added a commit that referenced this issue Jul 25, 2023
Previously, we didn't ever annotate properties with OData Edm types, meaning the following supported native column types in Azure Tables would all be converted (and used) as plain strings: byte[], DateTimeOffset, Guid and long.

By following more closely the documentation at https://learn.microsoft.com/en-us/rest/api/storageservices/payload-format-for-table-service-operations#property-types-in-a-json-feed, we effectively make our API more optimal and compatible with the Azure SDK for Table Storage.

In order to avoid too many breaking changes, we only support Edm.DateTime annotation for DateTimeOffset properties, since that's the behavior of the SDK when deserializing such annotated values (not to DateTime). This effectively means that DateTime is more of a legacy type that might best be avoided.

This also now allows using a GUID-typed property for both partition and row keys.

Closes #235.
kzu added a commit that referenced this issue Jul 25, 2023
Previously, we didn't ever annotate properties with OData Edm types, meaning the following supported native column types in Azure Tables would all be converted (and used) as plain strings: byte[], DateTimeOffset, Guid and long.

By following more closely the documentation at https://learn.microsoft.com/en-us/rest/api/storageservices/payload-format-for-table-service-operations#property-types-in-a-json-feed, we effectively make our API more optimal and compatible with the Azure SDK for Table Storage.

In order to avoid too many breaking changes, we only support Edm.DateTime annotation for DateTimeOffset properties, since that's the behavior of the SDK when deserializing such annotated values (not to DateTime). This effectively means that DateTime is more of a legacy type that might best be avoided.

This also now allows using a GUID-typed property for both partition and row keys.

Closes #235.
@kzu kzu closed this as completed in #236 Jul 25, 2023
kzu added a commit that referenced this issue Jul 25, 2023
Previously, we didn't ever annotate properties with OData Edm types, meaning the following supported native column types in Azure Tables would all be converted (and used) as plain strings: byte[], DateTimeOffset, Guid and long.

By following more closely the documentation at https://learn.microsoft.com/en-us/rest/api/storageservices/payload-format-for-table-service-operations#property-types-in-a-json-feed, we effectively make our API more optimal and compatible with the Azure SDK for Table Storage.

In order to avoid too many breaking changes, we only support Edm.DateTime annotation for DateTimeOffset properties, since that's the behavior of the SDK when deserializing such annotated values (not to DateTime). This effectively means that DateTime is more of a legacy type that might best be avoided.

This also now allows using a GUID-typed property for both partition and row keys.

Closes #235.
@devlooped devlooped locked and limited conversation to collaborators Oct 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant