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

add bitAnd and bitOr BinaryExpressionType and operator #573

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KunMinX
Copy link

@KunMinX KunMinX commented Aug 3, 2024

so we can build bitAnd sql like follow:

SELECT * 
FROM Note 
WHERE ((Note.feature & ?) = ?) 

@vincentlauvlwj
Copy link
Member

Thanks for your PR. It's OK to have bitwise operation support in Ktorm, but I have 2 suggestions:

  1. Bitwise operation is not part of standard SQL, different dialects have different operators, so the code should be in ktorm-support-mysql module instead of ktorm-core.
  2. It would be better to keep the operator function names consistent with Kotlin's built-in bitwise operator functions, like and, or, xor, shl, shr, inv.

@KunMinX
Copy link
Author

KunMinX commented Aug 10, 2024

Thank you for your suggestions.

Bitwise operations allow for the aggregation of several states into one field, which helps to avoid frequent database upgrades in the event of future business changes.

This time around, during the development of KMP, I was introduced to Ktorm. Combining your suggestions above, I believe Ktorm has a well-planned design.

I will just throw a brick to attract jade and will not continue with PR for the time being.

It is worth mentioning that its documentation is user-friendly, and I have read through it completely.

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