Re: [sqlalchemy] how to set target_metadata programatically ?

2021-01-05 Thread Nikola Radovanovic
Thanks. Maybe it would be better that I explain the whole scenario so everyone reading can have better overview of what I want to achieve. We have some "general" tables (like users, permissions, roles and similar) that are referenced from multi-tenant client schemes ("client_1", "client_2",

Re: [sqlalchemy] how to set target_metadata programatically ?

2021-01-05 Thread Mike Bayer
hi there - usually programmatic customization of Alembic is done via the env.py script directly, that is, you would run "alembic revision" normally and it's within your local env.py that you can control how target_metadata is achieved. you can also pass custom options to "alembic revision"

Re: ask for help on best practices when changing table name from uppercase to lowercase

2021-01-05 Thread Mike Bayer
On Tue, Jan 5, 2021, at 9:50 AM, kz...@us.ibm.com wrote: > Thanks mike! > > I understand that it should work when querying over SQLAlchemy API. the > missing part of my use case I forgot to provide is, it only uses > Alembic/SQLAlchemy to manage schema changes, while the actual query may

[sqlalchemy] how to set target_metadata programatically ?

2021-01-05 Thread Nikola Radovanovic
Hi, I would like to create set of thin wrappers on top of the alembic since we need some customization. So first thing for me to solve is how to set *target_metadata* programatically. What I realized by reading documentation and code is that I need something like: alembic_cfg =

Re: ask for help on best practices when changing table name from uppercase to lowercase

2021-01-05 Thread kz...@us.ibm.com
Thanks mike! I understand that it should work when querying over SQLAlchemy API. the missing part of my use case I forgot to provide is, it only uses Alembic/SQLAlchemy to manage schema changes, while the actual query may comes from other query engine like a dashboard, a desktop DB client or a