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

Add TextEncryptedType to support large Text columns #730

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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