Re: [sqlalchemy] Changing database credentials after engine creation

2020-06-18 Thread Venkata Siva Naga Tatikonda
Thanks Mike, able to achieve the desired results. On Thursday, June 18, 2020 at 12:36:15 PM UTC-7, Mike Bayer wrote: > > > > On Wed, Jun 17, 2020, at 8:59 PM, Venkata Siva Naga Tatikonda wrote: > > Hello Mike, > > I've embedded the following code within the get_session function where the >

Re: [sqlalchemy] FetchedValue() updated by UPDATE to a different table

2020-06-18 Thread Mike Bayer
the Session doesnt scan every object on every flush, only those that have been marked as dirty. you should use an event handler such as after_flush() to go through the list of parent objects that have changed, traverse through the child objects you care about and call session.expire() on the

[sqlalchemy] FetchedValue() updated by UPDATE to a different table

2020-06-18 Thread Ryan Kelly
Hi, We have some functionality where some identifiers are pushed down into child tables for the purposes of enforcing a unique constraint that would otherwise not be as simple to enforce. What happens is that during an update to a parent table, a trigger runs that pushes the update down to it's

Re: [sqlalchemy] inserting into array column sqlalchmey 1.3.17

2020-06-18 Thread Mike Bayer
On Thu, Jun 18, 2020, at 3:35 PM, Mariana Salgueiro wrote: > Hello! > > I have two Flask projects that connect to postgresql databases and i > encountered an error while trying to insert a value into an array. > > My first project was made back in 2018 and we were using SQLAlchemy 1.1.12 >

Re: [sqlalchemy] alembic (1.4.2) revision --autogenerate hang

2020-06-18 Thread Mike Bayer
this is due to concurrent database connections where one or more of them has acquired a lock on a schema object such as a Table and other DDL operations against that object are blocked. look at your processlist on the database server, or run a query against pg_stat_activity on the database

Re: [sqlalchemy] Changing database credentials after engine creation

2020-06-18 Thread Mike Bayer
Additionally, enable echo_pool=True on your create_engine which will log when connections are being made. Put logging and/or print statements inside your event handler to ensure it's being invoked when it is expected. run some standalone tests with a short script first to make sure it does

[sqlalchemy] inserting into array column sqlalchmey 1.3.17

2020-06-18 Thread Mariana Salgueiro
Hello! I have two Flask projects that connect to postgresql databases and i encountered an error while trying to insert a value into an array. My first project was made back in 2018 and we were using SQLAlchemy 1.1.12 back then. We had this database that had this phone column that was defined

Re: [sqlalchemy] Changing database credentials after engine creation

2020-06-18 Thread Mike Bayer
On Wed, Jun 17, 2020, at 8:59 PM, Venkata Siva Naga Tatikonda wrote: > Hello Mike, > > I've embedded the following code within the get_session function where the > get_engine function returns the engine object. However, I'm still seeing that > the rotated database credentials are not being

[sqlalchemy] alembic (1.4.2) revision --autogenerate hang

2020-06-18 Thread Rob Schottland
I'm trying to do "alembic revision --autogenerate" I get the usual warnings (that I've gotten in previous successful runs) Here's the console output alembic$ alembic revision --autogenerate INFO [alembic.runtime.migration] Context impl PostgresqlImpl. INFO [alembic.runtime.migration] Will