Re: [sqlalchemy] Update Primary Key in the Session Data based Unique Key

2016-05-26 Thread Shankar Ganesh
Thanks Mike for your suggestion . It looks bulk_insert_mappings / bulk_update_mapping seems missing Relationship not handled and even these objects not even going to session. I missed few more points to add to my questions early For the above example I am going to add lot more DB validations (S

Re: [sqlalchemy] Update Primary Key in the Session Data based Unique Key

2016-05-24 Thread Mike Bayer
I'm assuming this is data from a flat file or XML or something. 1. Read the rows in chunks. say 1000 at a time. 2. organize the system by which you will regenerate the primary key from a given row. For each chunk, run this method on each row and associate the primary key with each row in th

[sqlalchemy] Update Primary Key in the Session Data based Unique Key

2016-05-24 Thread Shankar Ganesh
Hi, I need to know about what is the best way for doing update session data (session data is incomplete - not having the entire data) . Say data doesn't have primary key itself, How we can populate the primary key in the SQL Alchemy session ? Use Case: * Have the arbitrary data currently, ne

[sqlalchemy] Update Primary Key in the Session Data based Unique Key

2016-05-24 Thread Shankar Ganesh
Hi, I need to know about what is the best way for doing update session data (session data is incomplete - not having the entire data) . Say data doesn't have primary key itself, How we can populate the primary key in the SQL Alchemy session ? Suggested ways: We can put the entire data into t