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

Implement Not #748

Merged
merged 1 commit into from
Jan 20, 2025
Merged

Implement Not #748

merged 1 commit into from
Jan 20, 2025

Conversation

psvri
Copy link
Contributor

@psvri psvri commented Jan 19, 2025

This PR adds support for Not operator and Opcode.

OwnedValue::Integer(i) => OwnedValue::Integer((*i == 0) as i64),
OwnedValue::Float(f) => OwnedValue::Integer((*f == 0.0) as i64),
OwnedValue::Text(text) => exec_boolean_not(&cast_text_to_numerical(&text.value)),
_ => todo!(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can this be a panic! instead with an error message that this should not happen on other_type

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, I just kept the same logic from other functions like exec_bit_not .

We should probably fix it across all these functions. Will try to make a PR for this.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@jussisaurio @psvri We're a library, perhaps it's better to never panic, actually.

@penberg penberg closed this in c25d9a1 Jan 20, 2025
@penberg penberg merged commit c25d9a1 into tursodatabase:main Jan 20, 2025
37 checks passed
@psvri psvri deleted the implement_not branch January 20, 2025 13:08
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.

3 participants