0

Consider there are two database "A" and "B" which are not having different sqlalchemy dialects. Database "A" has "product" table and database "B" has "resource" table.

dialect for database "A" :

"mysql+pymysql://username1:password@localhost:3306/A"

dialect for database "B" :

"mysql+pymysql://client:password123@client-host-50:3307/B"

we have to perform query as follows :

     SELECT p.raw_item, r.raw_elem 
     from A.product as p 
     join B.resource as r on p.item_id = r.item_id

how to create engine in sqlalchemy to run above type of queries.

0 Answers0