Skip to content

Conversation

@Aniruddh25
Copy link
Collaborator

@Aniruddh25 Aniruddh25 commented May 6, 2023

Why make this change?

What is this change?

  • time data type is detected as TimeSpan in C#. Add respective additional case for this type where ever types are handled.
  • Using the Hotchocolate.Types.NodaTime to use the type NodaTime.LocalTime to display the time of the day for the corresponding time stored in the DB.
  • Fixed some testcases to add testing for datetimeoffset_type column as well.

Additional Fixes

  • In GraphQL, while parsing a values of datetime, datetime2, they should be treated as UTC, otherwise HotChocolate tries to convert into UTC and max values stored in the db then cause overflow exceptions.
  • Use InvariantInfo format provider while parsing

How was this tested? Work in progress

  • Integration Tests - in SupportedType
  • Unit Tests - StoredProcedureBuilderTests

Sample Request(s)

image

No Implicit Time Zone Conversion: you see exactly what you have on DB, same for insert/update

image
image

@Aniruddh25 Aniruddh25 marked this pull request as draft May 7, 2023 01:27
@abhishekkumams abhishekkumams added the enhancement New feature or request label May 8, 2023
Copy link
Collaborator Author

@Aniruddh25 Aniruddh25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few more questions

@Aniruddh25
Copy link
Collaborator Author

Approved but since I authored it initially, can't represent it in github. Can consider @abhishekkumams approval on my behalf.

@abhishekkumams abhishekkumams merged commit e917ce9 into main Aug 17, 2023
@abhishekkumams abhishekkumams deleted the supportTimeSpan branch August 17, 2023 08:31
@Aniruddh25 Aniruddh25 changed the title Support time data type in MsSql Support time data type in MsSql and fix for datetime types Aug 17, 2023
@ayush3797 ayush3797 restored the supportTimeSpan branch August 21, 2023 05:03
@ayush3797 ayush3797 deleted the supportTimeSpan branch August 21, 2023 05:09
@ayush3797 ayush3797 mentioned this pull request Aug 28, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Bug]: datetime2 field in utc from Azure SQL is returned in locale (i.e. +03:00) [Enhancement] Support time data type in MsSql

6 participants