[Sqlalchemy-tickets] Issue #4137: sharding token extension in identity key (zzzeek/sqlalchemy)
Brought to you by:
zzzeek
From: Michael B. <iss...@bi...> - 2017-11-22 22:55:50
|
New issue 4137: sharding token extension in identity key https://bitbucket.org/zzzeek/sqlalchemy/issues/4137/sharding-token-extension-in-identity-key Michael Bayer: consider the sharded setup where primary tables in each DB include a shard-unique primary key, but then those tables branch off into sub-tables that do not. In order to represent these objects in an identity map, we would need to support an additional token within the identity key. Generation of identity key is present against the row in loading.py -> instances, so at that point some token from the query context would be pulled (more likely a callable function or event so that this can be generic), and then at the instance level users would need to define some attribute or callable that can retrieve the shard identifier for an instance. another approach would be that the whole identity key is generated from user-defined callables that receive either a row in context or an instance. |