On Monday, July 6, 2015 at 5:31:58 PM UTC-4, Mário Idival wrote:
>
> Hello guys, someone using this stack to development?
> Has anyone had problems with alembic using docker? (separated PostgreSQL 
> and Python container)
>

I have been working on exactly this problem in recent days (pyramid and 
alembic in docker). The main issue is that the PostgreSQL connection 
information needs to be taken from the environment, not an INI file.

I will be posting my work in a Github repo soonish (in a week or two), but 
until then, here is my suggestion:

There is actually no need for the sqlalchemy url to be in the ini file; 
nothing in Alembic's code requires it. It is used in two places in the 
generated 
env.py: 
https://bitbucket.org/zzzeek/alembic/src/a294f8cc3f2e5fc2cad048bc4ce27c57554e2688/alembic/templates/generic/env.py?at=master

run_migrations_offline pulls the url out of the INI directly; you can 
instead construct it from the information in the environment (or skip 
using run_migrations_offline entirely)
run_migrations_online uses engine_from_config with the INI config. You 
could use the config.set_main_option method to set the url into the config 
(after constructing it from the environment variables), or use a different 
way of getting a sqlalchemy engine.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy-alembic" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to