I need some help and advices to create a mapping.

The context : 
- Multiple schemas on postgresql (dynamic number and name) who store the 
"same" tables.
- SQLAlchemy used into a pyramid web application.

Example :
A table "Customer" and a table "CustomerOrder" (link by customer.id) and a 
schema by society (not know before running)


I read the documentation about horizontal, vertical sharding and entity 
name but I'm a little bit confused about the good solution to solve my 
problem.

If I use "Entity name", I don't know how to configure the relationship 
between my two dynamic classes because I need to specify a class at 
configuration time but i really know the real subclasses only at runtime.

If I use the "Horizontal sharding", I need to have an engine / schema (and 
use search_path). The shard configurtion will be (or seems to be)  tricky.

If I use the "Vertical sharding", I need also an engine / schema and 
re-configure the session several times with a new binds mapping.

I made some google search with my context but it's not an usual case and i 
didn't find some helpful posts....

I also posed the question on stackoverflow last year but my solution don't 
really work : 
http://stackoverflow.com/questions/20212165/one-entity-in-multiple-schemas-how-to-switch-schema-on-runtime

Thanks in advance.

-- 
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 post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to