Skip to content

Conversation

Invincibear
Copy link

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.

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

Successfully merging this pull request may close these issues.

1 participant