ali-rds icon indicating copy to clipboard operation
ali-rds copied to clipboard

fix: operator.update, columns in where cant be updated

Open sunfuze opened this issue 7 years ago • 2 comments

#26

@dead-horse

sunfuze avatar Jul 18 '17 09:07 sunfuze

@sunfuze, thanks for your PR! By analyzing the history of the files in this pull request, we identified @fengmk2, @dead-horse and @csbun to be potential reviewers.

mention-bot avatar Jul 18 '17 09:07 mention-bot

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@7cb4e75). Click here to learn what that means. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #27   +/-   ##
=========================================
  Coverage          ?   98.92%           
=========================================
  Files             ?        6           
  Lines             ?      278           
  Branches          ?       40           
=========================================
  Hits              ?      275           
  Misses            ?        3           
  Partials          ?        0
Impacted Files Coverage Δ
lib/operator.js 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7cb4e75...089fa9b. Read the comment docs.

codecov-io avatar Jul 18 '17 11:07 codecov-io

db.update('table', { field1: 'abc', field2: 'efg' }, {
  where: { field1: 'a', id: 1 }
})`

原来上面这种情况,是不会更新 field1的。


db.update('table', { id: 1, field1: 'abc' })

上面的代码生成的 sql 不应该有 'SET id = 1' 的内容。

sunfuze avatar Jul 18 '17 12:07 sunfuze