Skip to content

Conversation

@smitpatel
Copy link
Contributor

@smitpatel smitpatel commented Jul 22, 2019

In new query pipeline, we preserve convert nodes around enum in expression tree and remove them on both sides when translating to server.
The typeMapping for enum column expects an enum value for constant or parameter

  • With new pipeline, we will have parameter's value to be enum so we no long need any additional code for conversion
  • For constants, there is no convert node around constant in actual tree so we are left with integral value to be printed with Enum type mapping. Hence we need to convert it to actual enum value first. Afterwards, provider can print enum literal or apply appropriate conversions

In new query pipeline, we preserve convert nodes around enum in expression tree and remove them on both sides when translating to server.
The typeMapping for enum column expects an enum value for constant or parameter
- With new pipeline, we will have parameter's value to be enum so we no long need any additional code for conversion
- For constants, there is no convert node around constant in actual tree so we are left with integral value to be printed with Enum type mapping. Hence we need to convert it to actual enum value first. Afterwards, provider can print enum literal or apply appropriate conversions
@smitpatel smitpatel requested a review from ajcvickers July 22, 2019 18:20
@smitpatel smitpatel force-pushed the smit/enumliterals branch from adf7f5a to cec8082 Compare July 22, 2019 18:20
@smitpatel smitpatel requested a review from roji July 22, 2019 18:20
@smitpatel
Copy link
Contributor Author

This was causing a failure in Npgsql since it natively supports enum. Our code was not converting int to enum when there is no converter. No regression tests since we don't have a provider which supports enum without a converter.

@smitpatel smitpatel merged commit 9cc38f6 into master Jul 22, 2019
@smitpatel smitpatel deleted the smit/enumliterals branch July 22, 2019 19:13
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.

3 participants