I have scheme like that:
class Transaction(db.Model):
__tablename__ = 'transaction'
id = db.Column(db.Integer(), primary_key=True)
data_hash = db.Column(db.LargeBinary())
Just tried to get item by binary data_has::
instance = await Transaction.query.where(Transaction.data_hash == hash).gino.first()
Where hash is a binary data (b"")
And got that exception:
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/sqltypes.py", line 873, in bind_processor DBAPIBinary = dialect.dbapi.Binary
sqlalchemy.exc.StatementError: (builtins.AttributeError) type object 'AsyncpgDBAPI' has no attribute 'Binary' [SQL: 'SELECT transaction.id, transaction.data_hash \nFROM transaction \nWHERE transaction.data_hash = $1']
(builtins.AttributeError) type object 'AsyncpgDBAPI' has no attribute 'Binary' [SQL: 'SELECT ransaction.id, ransaction.data_hash \nFROM transaction \nWHERE transaction.data_hash = $1']
I also tried to send request by asyncpg and it works.
Thanks for the report! It should have been fixed in master.
Reading https://www.python.org/dev/peps/pep-0249/#type-objects-and-constructors, I'm worrying about that SQLAlchemy may use the other types defined by DB-API, I'll check further.
Looks like you caught the only missing one for now. Cheers!
Thanks a lot!