Skip to content
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

Decimal #193

Merged
merged 13 commits into from
Apr 16, 2024
Merged

Decimal #193

merged 13 commits into from
Apr 16, 2024

Conversation

MikhailNazarov
Copy link
Contributor

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

There is no decimal support in the library

Issue Number: N/A

What is the new behavior?

Implemented decimal type

Other information

precision: decimal.precision,
scale: decimal.scale,
precision: decimal.precision as u8,
scale: decimal.scale as i16,
Copy link
Member

Choose a reason for hiding this comment

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

What about use TryInto/TryFrom, for detect if outranges values as error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -160,6 +174,22 @@ impl TryFrom<crate::Value> for RawTypedValue {
}
}

#[repr(C)]
pub(crate) union DecimalUnion {
Copy link
Member

Choose a reason for hiding this comment

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

It is first usage of unsafe in the SDK.

Is other way for split i128 to u64 parts exists?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I done it without unsafe

@rekby rekby merged commit 62cab75 into ydb-platform:master Apr 16, 2024
2 checks passed
@rekby
Copy link
Member

rekby commented Apr 16, 2024

Thanks for the PR :)

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.

2 participants