Skip to content

Conversation

@essentinal
Copy link

For now I suggest to add a simple EnumCodec, since it solves my issue.
Fixes #33

@pivotal-issuemaster
Copy link

@essentinal Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-issuemaster
Copy link

@essentinal Thank you for signing the Contributor License Agreement!

@mp911de
Copy link
Member

mp911de commented Mar 14, 2019

Looks good from a cursory review. We should not add any other functionality beyond that. Using an enum and deciding how it should be represented in the database is an application-specific decision. Providing this feature at driver level is only a convenience feature and actually, this decision should be handled in a client.

@mp911de mp911de added the type: enhancement A general enhancement label Mar 14, 2019
@mp911de mp911de added this to the 1.0.0.M8 milestone Mar 14, 2019
@gregturn
Copy link
Contributor

If we do this here, it seems like we'd need the same thing in every r2dbc driver. The purpose of this is to translate a Java enum from/to an int or a String.

Frankly, this sounds like a feature better implemented at the client level (spring-data-r2dbc, etc.) Once done, it works for ALL drivers, including those not even implemented yet.

Whether such a feature on the client level would require any SPI changes, I'm not sure I see that (yet).

@mp911de
Copy link
Member

mp911de commented Mar 15, 2019

Reiterating on that topic, I'm also inclined to not provide an enum codec. If we would include that type of codecs in all drivers, then we would basically expect all drivers to ship with an enum codec to reduce variance amongst vendor-specifics. With R2DBC we intend to reduce the number of things each driver has to implement and enum codec falls in that category which would be provided by a driver with the same mapping (Enum to String and vice versa) while this is not a protocol-specific feature.

@nebhale Thoughts?

@mp911de mp911de added for: team-attention An issue we need to discuss as a team to make progress status: waiting-for-feedback We need additional information before we can continue labels Mar 15, 2019
@gregturn gregturn mentioned this pull request Mar 16, 2019
@mp911de
Copy link
Member

mp911de commented Apr 26, 2019

We discussed this topic in our team and concluded that enum support is a application-specific feature that would be implemented in the driver. Drivers only encapsulate database-specific feature. Mapping an enum name to a character column is not database-specific but rather an opinionated convenience feature.

Therefore, we decided to not include EnumCodec in our project. We could consider exposing a configurable codec registry so these concerns can be added through a specific extension point.

Thanks for all your effort!

@mp911de mp911de closed this Apr 26, 2019
@mp911de mp911de added status: declined A suggestion or change that we dont feel we should currently apply and removed status: waiting-for-feedback We need additional information before we can continue labels Apr 26, 2019
@alpeshjikadra
Copy link

Which maven version has this bug fixes ?

@mp911de
Copy link
Member

mp911de commented Feb 7, 2020

Enum codecs are not supported as per comment in this ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

for: team-attention An issue we need to discuss as a team to make progress status: declined A suggestion or change that we dont feel we should currently apply type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add EnumCodec

5 participants