Re: [sqlalchemy] How to map class to multiple tables (for sharding purpose)

2016-05-22 Thread Mike Bayer
On 05/20/2016 05:16 AM, Михаил Доронин wrote: The first link you gave have exactly the thing I said I don't want to do. The second one is however looks very promising. oh well when you said "map(klass, *tables)", that's pretty much exactly what entity name does. But I guess you don't like

Re: [sqlalchemy] How to map class to multiple tables (for sharding purpose)

2016-05-20 Thread Михаил Доронин
The first link you gave have exactly the thing I said I don't want to do. The second one is however looks very promising. Have I understand correctly that I need to create custom Session class and custom Query class for this session that would somehow produce correct from clause (with correct ta

Re: [sqlalchemy] How to map class to multiple tables (for sharding purpose)

2016-05-19 Thread Mike Bayer
On 05/19/2016 08:58 AM, Михаил Доронин wrote: Suppose I have models (with corresponding tables) in pseudocode table1 | some_unique_name | some_property | |--+---| | foo | 1 | |--+---| | bar | 2

[sqlalchemy] How to map class to multiple tables (for sharding purpose)

2016-05-19 Thread Михаил Доронин
Suppose I have models (with corresponding tables) in pseudocode table1 | some_unique_name | some_property | |--+---| | foo | 1 | |--+---| | bar | 2 | |--+---| tabl