We are using sqlalchemy's autoload feature to do column mapping to prevent hardcoding in our code.
class users(Base):
__tablename__ = 'users'
__table_args__ = {
'autoload': True,
'mysql_engine': 'InnoDB',
'mysql_charset': 'utf8'
}
Is there a way to serialize or cache autoloaded metadata/orms so we don't have to go through the autoload process every time we need to reference our orm classes from other scripts/functions?
I have looked at beaker caching and pickle but haven't found a clear answer if it is possible or how to do it.
Ideally we run the autload mapping script only when we have committed changes to our database structure but reference a non-autoload/persistent/cached version of our database mapping from all other scripts/functions,
Any ideas?