Re: [sqlalchemy] Disable `session_identity_map` for `_instance_processor`

2017-11-23 Thread Simon King
On Thu, Nov 23, 2017 at 6:55 PM, Антонио Антуан wrote: > > > чт, 23 нояб. 2017 г. в 20:27, Mike Bayer : >> >> On Thu, Nov 23, 2017 at 8:44 AM, Антонио Антуан >> wrote: >> > >> >> A Query can have lots of entities in it, and if you're doing sharding a >> >> single result set can refer to any numbe

Re: [sqlalchemy] Disable `session_identity_map` for `_instance_processor`

2017-11-23 Thread Антонио Антуан
чт, 23 нояб. 2017 г. в 20:27, Mike Bayer : > On Thu, Nov 23, 2017 at 8:44 AM, Антонио Антуан > wrote: > > > >> A Query can have lots of entities in it, and if you're doing sharding a > >> single result set can refer to any number of shard identifiers within > >> not just a single result set but w

Re: [sqlalchemy] Disable `session_identity_map` for `_instance_processor`

2017-11-23 Thread Simon King
On Thu, Nov 23, 2017 at 5:27 PM, Mike Bayer wrote: > On Thu, Nov 23, 2017 at 8:44 AM, Антонио Антуан wrote: >> >>> A Query can have lots of entities in it, and if you're doing sharding a >>> single result set can refer to any number of shard identifiers within >>> not just a single result set but

Re: [sqlalchemy] Disable `session_identity_map` for `_instance_processor`

2017-11-23 Thread Mike Bayer
On Thu, Nov 23, 2017 at 8:44 AM, Антонио Антуан wrote: > >> A Query can have lots of entities in it, and if you're doing sharding a >> single result set can refer to any number of shard identifiers within >> not just a single result set but within a single row; they might have >> come from dozens

Re: [sqlalchemy] Disable `session_identity_map` for `_instance_processor`

2017-11-23 Thread Антонио Антуан
See, that `Query.get` using `get_from_identity` instead of `instances` with key, constructed into `_get_impl`. Could you point to another places where same problem (described into my first message) can be appeared? чт, 23 нояб. 2017 г. в 16:44, Антонио Антуан : > > > A Query can have lots of enti

Re: [sqlalchemy] Disable `session_identity_map` for `_instance_processor`

2017-11-23 Thread Антонио Антуан
> A Query can have lots of entities in it, and if you're doing sharding a > single result set can refer to any number of shard identifiers within > not just a single result set but within a single row; they might have > come from dozens of different databases at once In my case it is not possible:

Re: [sqlalchemy] Disable `session_identity_map` for `_instance_processor`

2017-11-22 Thread Mike Bayer
I've added an issue to track this feature targeted for the moment at 1.3 (note that's for many months from now), however 1.3 has a lot in it right now: https://bitbucket.org/zzzeek/sqlalchemy/issues/4137/sharding-token-extension-in-identity-key On Wed, Nov 22, 2017 at 4:20 PM, Mike Bayer wrote

Re: [sqlalchemy] Disable `session_identity_map` for `_instance_processor`

2017-11-22 Thread Mike Bayer
On Wed, Nov 22, 2017 at 4:56 AM, Антонио Антуан wrote: > Glad to see that you remember my messages :) > > I've dived into `loading` module and I see that currently it is really > complicated to store additional data into pkey for each instance. > > Unfortunately, suggested solutions not good for m

Re: [sqlalchemy] Disable `session_identity_map` for `_instance_processor`

2017-11-22 Thread Антонио Антуан
Glad to see that you remember my messages :) I've dived into `loading` module and I see that currently it is really complicated to store additional data into pkey for each instance. Unfortunately, suggested solutions not good for my project. Also, I think that `shard` meaning in my case is not th

Re: [sqlalchemy] Disable `session_identity_map` for `_instance_processor`

2017-11-21 Thread Mike Bayer
I've looked to see how hard it would be to allow "supplemental" attributes to form part of the mapper's primary key tuple, and it would be pretty hard. The "easy" part is getting the mapper to set itself up with some extra attributes that can deliver some kind of supplemental value to the identit

Re: [sqlalchemy] Disable `session_identity_map` for `_instance_processor`

2017-11-21 Thread Mike Bayer
On Tue, Nov 21, 2017 at 7:39 AM, Антонио Антуан wrote: > Hi guys. > > I got this code example: > https://gist.github.com/aCLr/ff9462b634031ee6bccbead8d913c41f. > > Here I make custom `Session` and custom `Query`. As you see, `Session` has > several binds. > > Also, you can see that there are two f

[sqlalchemy] Disable `session_identity_map` for `_instance_processor`

2017-11-21 Thread Антонио Антуан
Hi guys. I got this code example: https://gist.github.com/aCLr/ff9462b634031ee6bccbead8d913c41f. Here I make custom `Session` and custom `Query`. As you see, `Session` has several binds. Also, you can see that there are two functions: `assert_got_correct_objects_with_remove` and `assert_got_