[sqlalchemy] Foriegn key from one database to another in SQLAlchemy or Alembic

2021-03-14 Thread ai.rese...@gmail.com
Hi all, I highly appreciate your help with the following issue. I have two different databases in MySQL let say db1 and db2. I want to add a foreign key constraint from table db1.tablex to table db2.tabley and also include the corresponding relationship in the declarative mapping. I have to c

Re: [sqlalchemy] Updating another table in "before-insert" event

2020-11-02 Thread ai.rese...@gmail.com
pool_recycle=18000 while creating the engine. On Saturday, October 24, 2020 at 10:17:10 PM UTC+8 Mike Bayer wrote: > > > > > On Fri, Oct 23, 2020, at 8:30 PM, ai.rese...@gmail.com wrote: > > > Hi all > > I want to update a table row once I create a new row in another

Re: [sqlalchemy] Updating another table in "before-insert" event

2020-10-25 Thread ai.rese...@gmail.com
Thank you very much. Perfectly worked. On Saturday, October 24, 2020 at 10:17:10 PM UTC+8 Mike Bayer wrote: > > > > > On Fri, Oct 23, 2020, at 8:30 PM, ai.rese...@gmail.com wrote: > > > Hi all > > I want to update a table row once I create a new row in another table

[sqlalchemy] Updating another table in "before-insert" event

2020-10-23 Thread ai.rese...@gmail.com
Hi all I want to update a table row once I create a new row in another table. These 2 tables are in the same database, but no relationship between them I use "before_insert" listener for the first table. In this function, I load the target object instance from the second table and try to updat