Flask-sqlalchemy How To Use Create_all With Schema_translate_map
The SQLAlchemy provides the Connection.execution_options.schema_translate_map for change the schemas in execution time, as said in docs. In the examples is shown how to use to perf
Solution 1:
When you set execution options, you create copy of connection. This mean what create_all run without schema_translate_map.
>>>c = Base.session.connection()>>>w = c.execution_options(schema_translate_map={'dynamic':'kek'})>>>c._execution_options
immutabledict({})
>>>w._execution_options
immutabledict({'schema_translate_map': {'dynamic': 'kek'}})
Post a Comment for "Flask-sqlalchemy How To Use Create_all With Schema_translate_map"