Re: How to determine whether Alembic is active

2014-05-13 Thread Michael Bayer
if possible, I'd modify env.py to make use of your application's normal engine/session mechanics. There would be no "alembic_get_session()" method. Whatever mechanism your app uses to get at the Engine/Session, pull it in within env.py and use the exact same environment for migrations.

Re: How to configure multiple databases

2014-05-13 Thread Charles Reese
Hi Mike, I can't use ini files because I don't know which database to use until the test is running. However, I was able to solve via tags. On Mon, May 12, 2014 at 8:52 PM, Michael Bayer wrote: > > there's no standard per se. I'm partial to .ini files and in particular a > test.ini file for te

How to determine whether Alembic is active

2014-05-13 Thread gbr
In some Alembic upgrade scripts, I need to use application sessions to make use of some code that requires these sessions. To avoid deadlocks from blocking transactions I use the following lines to transparently call `get_db_session()` regardless of whether Alembic or the application is execute