Skip to content
New issue

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

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

Already on GitHub? # to your account

Add more conversions to sqlite SDK ValueResult #1725

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

rylev
Copy link
Collaborator

@rylev rylev commented Aug 31, 2023

Fixes an issue reported by @mikkelhegn where we didn't have a conversion between ValueResult and &[u8]. This works for both ValueResult::Blob and ValueResult::Text.

This adds such a conversion along with conversions for all basic integer types (signed and unsigned) and f64. It also allow casting from ValueResult::Blob to &str which will fail if the blob is not utf8.

This is technically a breaking change as previously the conversion from ValueResult to u32 would overflow but now it returns an error: see here. I personally think this is an acceptable breaking change, but I'd like to hear others' thoughts.

Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
@rylev rylev requested review from itowlson and mikkelhegn August 31, 2023 11:48
Copy link
Contributor

@itowlson itowlson left a comment

Choose a reason for hiding this comment

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

Even I can't get fretful about changing the integer overflow behaviour. :shipit:

@rylev rylev merged commit 200d2ae into main Sep 6, 2023
@rylev rylev deleted the more-value-result-conversions branch September 6, 2023 08:43
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants