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

feat(sqlite): add json_error_position fn #4496

Merged
merged 2 commits into from
Mar 4, 2025

Conversation

IamTossan
Copy link
Contributor

add json_error_position sqlite fn

related to

@weiznich weiznich requested a review from a team February 18, 2025 17:17
Copy link
Member

@weiznich weiznich left a comment

Choose a reason for hiding this comment

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

Thanks for submitting. This looks good beside the small suggested change on the function signature.

Comment on lines 377 to 379
fn json_error_position<X: TextOrNullableTextOrBinaryOrNullableBinary + SingleValue>(
x: X,
) -> Nullable<Integer>;
Copy link
Member

Choose a reason for hiding this comment

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

This function returns only null if the input value is null. That means we can write it as follows:

Suggested change
fn json_error_position<X: TextOrNullableTextOrBinaryOrNullableBinary + SingleValue>(
x: X,
) -> Nullable<Integer>;
fn json_error_position<X: TextOrNullableTextOrBinaryOrNullableBinary + MaybeNullableValue<Integer>>(
x: X,
) -> X::Out;

The MaybeNullableValue trait turns the output type X::Out into Nullable<Integer> if the input type is nullable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey, I hope you're well.
Thank you for the review, I have taken care of it

@weiznich weiznich force-pushed the feat/json-error-position-fn branch from 54cc055 to 9e15327 Compare March 4, 2025 09:52
@weiznich weiznich enabled auto-merge March 4, 2025 09:52
@weiznich weiznich added this pull request to the merge queue Mar 4, 2025
Merged via the queue into diesel-rs:master with commit 0f8b58f Mar 4, 2025
34 checks passed
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