I'll reiterate that an explicit URL or method that refers to the term
"url" would never directly be present within anything in the ORM,
there would only be a token of some kind that can be used to link up
to a series of Engine objects.
The enhancement at
https://bitbucket.org/zzzeek/sqlalchemy/issues/4137/sharding-token-extension-in-identity-key
covers this. InstanceState objects when they represent persistent
database objects have an identity key, and there would be an
additional token in the identity key that can be used by a custom
Session class in any way desired, including to associate the object
with a particular Engine. You'd look at instancestate.key[2] to get
this token.
#4137 is not that hard to implement but needs a few reasonable design
decisions to be made. A proof of concept is at
https://gerrit.sqlalchemy.org/#/c/zzzeek/sqlalchemy/+/613/ . note the
changes to test_horizontal_shard where any instance retrieved from the
database should have inspect(instance).key[2] with the shard
identifier. If you can work with this that would be great.
>
> Thanks.
> Anton.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
sqlalchemy-dev...@googlegroups.com.
> To post to this group, send email to
sqlalche...@googlegroups.com.
> Visit this group at
https://groups.google.com/group/sqlalchemy-devel.
> For more options, visit
https://groups.google.com/d/optout.