> On Aug 17, 2022, at 3:55 AM, Carl Brewer <[email protected]> wrote:
> 
> 
> I have three databases to work with, a PostgreSQL database on one server, and 
> two MySQL databases on another.
> 
> I've set up three different engines to connect to and reflect each one, the 
> databases and tables within don't have relationships defined in the databases 
> themselves, there's not a lot of foreign keys!
> 
> I'm wondering if it's possible to use SQLAlchemy to map out relationships 
> between them? Only within the particular bit of software I'm working on, I 
> don't expect it to export back into the databases - at the moment I'm only 
> using read-only access to the databases anyway.
> 
> Possible within the SQLAlchemy environment?


Hi Carl,
I have no experience with this so I might be making a poor suggestion, but 
Postgres’ foreign data wrappers might help you. They can expose the schema of 
other databases, so your Postgres database could be the host for all three 
databases that you need to connect to. That would make it look like one 
database to SQLAlchemy.

https://www.postgresql.org/docs/current/sql-createforeigndatawrapper.html


Good luck
Philip

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/42156053-A1EC-410E-B4CA-A7FBFF96C450%40americanefficient.com.

Reply via email to