bookshelf: Sql Azure (mssql) does not support update identity columns

The current implementation for update query include the idAttribute column in the Set operations in a statement like this :

UPDATE 
SET BookId = 1, 
SET BookName = 'a new name'
WHERE BookId = 1

Updating BookId (with the same value) is not supported in mssql. I guess postgre and mysql just drop this part of the statement but I think this shouldn’t be there anyway.

I opened a pull request with a fix proposal. Let me know what you think.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 17 (13 by maintainers)

Most upvoted comments

This is a very small bug fixe that has been left hanging for years without any answer on concerns I raised above.

As I’m saying the PR is not introducing any changes but fixing a bug. There are already test in place for updates. The feature of updating the Id of an existing object is just not implemented at all (at least by the time of the PR). I realized that when I actually tried to add test for that feature. It’s actually in the comments above…

So yes I really don’t know what you hope me to do, but I’m for sure not gonna fight against windmill.

On Mon 8 Jan 2018 at 08:39, Ricardo Graça notifications@github.com wrote:

There are no tests in PR #1260 https://github.com/bookshelf/bookshelf/pull/1260. If you’re not willing to add at least one test to check for the correct behavior of that change I might be able to add one.

I’m planning on doing a release soon, but that won’t include changes, only small bug fixes. The release after that will include changes, like the one being proposed in #1260 https://github.com/bookshelf/bookshelf/pull/1260 .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bookshelf/bookshelf/issues/1259#issuecomment-355854902, or mute the thread https://github.com/notifications/unsubscribe-auth/ACiXpt5N35O_yBm0KOP3Em5E-MW1vAWMks5tITmUgaJpZM4Ik4Lb .