Re: [sqlalchemy] Re: Why does Session.merge only look at primary key and not all unique keys?

2010-12-16 Thread Michael Bayer
On Dec 15, 2010, at 11:50 PM, Russell Warren wrote: Ok again... but you also agree that the use of surrogate keys is standard (and some say necessary) practice. In the case of Sqlite (as in my example), adding this surrogate key automatically makes the schema unreasonable because you now

[sqlalchemy] Re: Why does Session.merge only look at primary key and not all unique keys?

2010-12-15 Thread Russell Warren
Whoops - my clipboard had an old pre-cleaned sample code in it that I pasted. Sorry about the excess lines... maybe the logging mod will be useful for some people, though? The code is still right, just not fully cleaned up. The first Column config is the one that works around the Sqlite

[sqlalchemy] Re: Why does Session.merge only look at primary key and not all unique keys?

2010-12-15 Thread Russell Warren
Why does Session.merge only look at primary key and not all unique keys? Well the theory of operation regarding merge() is based on that of the identity map, which is linked to object/row identity. Consider that it also cascades along relationship paths. It would be a difficult operation