Using Alembic API from inside application code

前端 未结 8 896
夕颜
夕颜 2020-12-08 04:06

I am using SQLite as an application file format (see here for why you would want to do this) for my PySide-based desktop application. That is, when a user uses my app, their

8条回答
  •  失恋的感觉
    2020-12-08 04:49

    Not really an answer, but i had a hardtime with that, so I wanted to share:

    How to pass an x_argument programatically with alembic.command.upgrade:

    class CmdOpts:
        x = {"data=true"}
    
    

    here data=true is what i pass as x_argument in command line

        alembic_config = AlembicConfig(ini_location)
        setattr(alembic_config, "cmd_opts", CmdOpts())
        alembic_config.cmd_opts.x = {"data": True}
    
    

提交回复
热议问题