Skip to content

Make timestamp infinity conversion the default - #4035

Merged
roji merged 1 commit into
npgsql:mainfrom
roji:DateTimeMinMax
Oct 13, 2021
Merged

roji merged 1 commit into
npgsql:mainfrom
roji:DateTimeMinMax

Conversation

@roji

@roji roji commented Oct 13, 2021

Copy link
Copy Markdown
Member

Also allow default(DateTime) to be written as timestamptz although it's Unspecified.

Closes #4034
Closes #4032

Also allow default(DateTime) to be written as timestamptz although
it's Unspecified.

Closes npgsql#4034
Closes npgsql#4032
@roji
roji requested a review from vonzshik as a code owner October 13, 2021 12:45
readonly bool _convertInfinityDateTime;
readonly BclDateHandler _bclHandler;

const string InfinityExceptionMessage = "Can't convert infinite timestamp values to DateTime";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

At this point you may as well make it a throw helper 😄

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah I know... We could even go fancy with a resx and whatnot... But let's think about it later (if at all 🤣).

readonly BclTimestampTzHandler _bclHandler;
readonly bool _convertInfinityDateTime;

const string InfinityExceptionMessage = "Can't convert infinite timestamp values to DateTime";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same

@roji
roji merged commit dba60fb into npgsql:main Oct 13, 2021
@roji
roji deleted the DateTimeMinMax branch October 13, 2021 13:17
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.

Map timestamp min/max to infinity by default Allow writing DateTime.MinValue to timestamptz even though it's Unspecified

3 participants