Last active
March 15, 2019 14:38
-
-
Save Paradoxis/234f070972f09bdf6c3da1586f6f564c to your computer and use it in GitHub Desktop.
SqlAlchemy - Column to native Python type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy import Column | |
def column_to_type(column: Column): | |
""" | |
Helper to get the native Python type of a column | |
:param column: SqlAlchemy column | |
:return: Python type | |
""" | |
return column.property.columns[0].type.python_type |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment