seamusabshere/upsert

doesn't return id from upserted rows

seamusabshere opened this issue · 6 comments

it feels like it would be easy to return the ID of the upserted row... presumably this would help a lot of people

This would be extremely helpful. To emulate this right now, you have to do another find with the selector.

This should be do-able in both PostgreSQL and MySQL without too much difficulty (while still being transaction-safe) but I'm not sure about sqlite3 (see http://stackoverflow.com/questions/6242756/how-to-retrieve-inserted-id-after-inserting-row-in-sqlite-using-python for a python example). I'll investigate and see what I can come up with :)

Anyone still interested in working on this?

@olivierlacan We need this for at work so it's on the roadmap, yes :)

@pnomolos Checking back in since this is a source of performance issues for us still.

@olivierlacan Yes, I'm going to try and get it in once 3.0 is released, but work has been crazy the last while so I haven't had much time. I was trying to get 3.0 pushed out over Hacktober but you see how well that went 🤦‍♂️