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

c# Nullable to YQL Option #14

Merged
merged 9 commits into from
Aug 15, 2023
Merged

Conversation

XmasApple
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?

Now there is no convenient way to convert the nullable type to YdbValue(YQL Optional)
One of the available options looks like this:

value.HasValue
    ? YdbValue.MakeOptional(MakeUtf8(value))
    : YdbValue.MakeEmptyOptional(YdbTypeId.Utf8));

but it takes up a lot of space and allows for errors

What is the new behavior?

To do the same thing you can use one of the options:

YdbValue.MakeOptionalUtf8(value);
// or
(YdbValue)value;

Other information

image

@XmasApple XmasApple closed this Aug 10, 2023
@XmasApple XmasApple deleted the castOptionals branch August 10, 2023 10:35
@XmasApple XmasApple restored the castOptionals branch August 10, 2023 10:36
@XmasApple XmasApple reopened this Aug 10, 2023
@rekby rekby merged commit 6f8ca3c into ydb-platform:main Aug 15, 2023
3 checks passed
@XmasApple XmasApple deleted the castOptionals branch August 30, 2023 12:03
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