-
Notifications
You must be signed in to change notification settings - Fork 435
-
From the look at the code, asyncpg.BitString simply doesn't implement bitwise operators nor op() methods?
But our business logic includes comparing and performing bitwise operations on long (>400 bits) bit strings.
It works in raw SQL, but apparently doesn't work with sqlalchemy/asyncpg? What should we do?
UPD I eventually settled with this:
from sqlalchemy.dialects.postgresql import BIT
from asyncpg import BitString
cast(BitString(bitmask), BIT(varying=True))
where bitmask is user input string of 0 and 1, so it can do bitwise_xor(), bitwise_not() etc., but this is less than ideal.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment