I was trying to solve an issue of an incorrect Alembic migration 
autogeneration for a custom field (SQLAlchemy-Uitls.PasswordType), which 
fallbacks to VARBINARY type for SQLite and it turned out that SQLAlchemy 
confuses me:

>>> *from* sqlalchemy *import* VARBINARY
>>> *from* sqlalchemy.dialects.sqlite *import* dialect as sqlite_dialect

>>> sqlite_dialect._resolve_type_affinity(*str*(VARBINARY(128)))
NUMERIC(precision=128)

>>> sqlite_dialect.type_descriptor(sqlalchemy.VARBINARY(128))
VARBINARY(length=128)

Is this an expected behaviour? I expected to see the same output in both 
cases. Alembic gets confused as the DB reports the column type as 
NUMERIC(precision=128) (which type affinity is Numeric), while PasswordType 
inspection ends up with VARBINARY(length=128) (which type affinity is 
_Binary).

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to