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

Support bit string operators #1239

Closed
hurcy opened this issue Feb 16, 2021 · 1 comment
Closed

Support bit string operators #1239

hurcy opened this issue Feb 16, 2021 · 1 comment

Comments

@hurcy
Copy link

hurcy commented Feb 16, 2021

Hi,

I have bit(10) column and want to update it using bitwise operator.
e.g.

from sqlalchemy.dialects.postgresql import BIT
Mytable = db.Table(
  db.Column(ColumnLabel.EVENT_TYPE.value, BIT(10), nullable=False)
)

q1 = db.session.query(
    (Mytable.c.event_type | cast(8, BIT(10))
)

q2 = db.session.query(
    or_(Mytable.c.event_type,  cast(8, BIT(10))
)

Both queries compiled to select event_type OR CAST(8 AS BIT(10)), which is not correct.
Could you tell me how to compile those queries with | operator?

@dvarrazzo
Copy link
Member

I'm afraid no: you should ask this question to SQLAlchemy. I don't know much about it.

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

No branches or pull requests

2 participants