ktorm
ktorm copied to clipboard
add bitAnd and bitOr BinaryExpressionType and operator
so we can build bitAnd sql like follow:
SELECT *
FROM Note
WHERE ((Note.feature & ?) = ?)
Thanks for your PR. It's OK to have bitwise operation support in Ktorm, but I have 2 suggestions:
- Bitwise operation is not part of standard SQL, different dialects have different operators, so the code should be in
ktorm-support-mysqlmodule instead ofktorm-core. - 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.
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.