Hello,

I’m using a *Base = declarative_base() 
<https://docs.sqlalchemy.org/en/14/orm/mapping_api.html#sqlalchemy.orm.declarative_base>*
 
in a single, shared package that other packages can import and use. Now 
suppose I have two more packages, each of which declares a bunch of 
mappings using that one common *Base*.

Is it possible to separate the mappings? I noticed that after importing 
both packages, *Base.metadata.tables.keys()* lists all table mappings from 
both packages.

However, I’d like to treat the tables from these two packages separately 
and bind them to different engines (and databases).

Is that possible?

Much thanks!
Jens

-- 
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 sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/af75e955-aad5-4db5-a36c-f051801010c1n%40googlegroups.com.

Reply via email to