Skip to content

Add a codec for BigInteger #233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
timve opened this issue Jan 28, 2020 · 2 comments · Fixed by #235
Closed

Add a codec for BigInteger #233

timve opened this issue Jan 28, 2020 · 2 comments · Fixed by #235
Labels
type: enhancement A general enhancement

Comments

@timve
Copy link

timve commented Jan 28, 2020

I would like to add support for the BigInteger type to the codecs.

In our project we use r2dbc in combination with code generated by jooq (based on the sql schema). When a Numeric column has a scale of 0 (the default) and has a sufficiently high precision, the generated java type for the column is a BigInteger.

I would like to be able to get the column value as this type from r2dbc by adding a codec similar to the BigDecimalCodec.

I have currently written this codec in our own project but would like to add them to r2dbc-postgresql.

@mp911de
Copy link
Collaborator

mp911de commented Jan 29, 2020

Sounds like a good fit for the driver. Do you want to submit a pull request for the codec along with some tests?

@mp911de mp911de added the type: enhancement A general enhancement label Jan 29, 2020
@timve
Copy link
Author

timve commented Jan 29, 2020

Thank you for the quick response, I have opened pull request #235 to add the codec to the driver.

mp911de added a commit that referenced this issue Jan 29, 2020
Add fast-path BigInteger conversion from BigDecimal. Use long value for all other numeric types to construct a BigInteger. Update copyright license header years.

[#233][#235]
mp911de added a commit that referenced this issue Jan 29, 2020
mp911de pushed a commit that referenced this issue Jan 29, 2020
Applicable to any numeric type with scale 0

[resolves #233][#235]
mp911de added a commit that referenced this issue Jan 29, 2020
Add fast-path BigInteger conversion from BigDecimal. Use long value for all other numeric types to construct a BigInteger. Update copyright license header years.

[#233][#235]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants