Skip to content

Supported unmapped enum writing - #3398

Merged
YohDeadfall merged 2 commits into
npgsql:mainfrom
YohDeadfall:unmapped-enum-writing
Dec 10, 2020
Merged

YohDeadfall merged 2 commits into
npgsql:mainfrom
YohDeadfall:unmapped-enum-writing

Conversation

@YohDeadfall

Copy link
Copy Markdown
Contributor

Fixes #3389.

@YohDeadfall
YohDeadfall requested a review from roji as a code owner December 8, 2020 20:22
@natalie-o-perret

Copy link
Copy Markdown

LGTM, thanks mate!

@roji roji left a comment

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.

I honestly don't remember why we didn't implement this a long time ago...

Anyway, LGTM apart from some testing nits.

Comment thread test/Npgsql.Tests/Types/EnumTests.cs Resolved
Parameters = { new("p", MoodUnmapped.Happy) }
};

await using var reader = await cmd.ExecuteReaderAsync();

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.

Shouldn't we convert the enum parameter to text in PostgreSQL, and assert on that? You yourself made the very correct point that doing read and write in the same test is not good :)

@YohDeadfall
YohDeadfall merged commit 444147d into npgsql:main Dec 10, 2020
@YohDeadfall
YohDeadfall deleted the unmapped-enum-writing branch December 10, 2020 13:24
YohDeadfall added a commit that referenced this pull request Dec 10, 2020
Fixes #3389.

(cherry picked from commit 444147d)
@YohDeadfall

Copy link
Copy Markdown
Contributor Author

Backported to 5.0.1 via db7e37c.

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.

Allow unmapped enums to be written

3 participants