Based on StringEncryptedType, the only difference is SQLAlchemy treats it as a Text column instead of a String (VARCHAR in MySQL) column, allowing for far larger encrypted text data.
This was made out of necessity when attempting to save encrypted Google OAuth tokens that cause the table size to exceed the max, even though individual columns were acceptable. By storing as TEXT (or BLOB), they are stored separately and other than their metadata, don't count towards the table's max width.
There is already a EncryptedType class using LargeBinary as the type, but it has a deprecation warning and comments warning that in the future it'll be changed to String.
Based on
StringEncryptedType
, the only difference is SQLAlchemy treats it as aText
column instead of aString
(VARCHAR
in MySQL) column, allowing for far larger encrypted text data.This was made out of necessity when attempting to save encrypted Google OAuth tokens that cause the table size to exceed the max, even though individual columns were acceptable. By storing as
TEXT
(orBLOB
), they are stored separately and other than their metadata, don't count towards the table's max width.There is already a
EncryptedType
class usingLargeBinary
as the type, but it has a deprecation warning and comments warning that in the future it'll be changed toString
.