check driver.Valuer response, and skip the column if nil #1167

Merged
koron merged 1 commits from koron/valuer-update-by-nil-always into master 2 years ago
koron commented 3 years ago (Migrated from github.com)
Owner

Problem:
Some sort of column are updated by nil always, when type for the column implements driver.Valuer interface and it's Value() method return nil. It should check requiredField.

Solution:
Check the response value of driver.Valuer.Value(), if it is nil and not requiredField, skip the column.

**Problem:** Some sort of column are updated by nil always, when type for the column implements `driver.Valuer` interface and it's `Value()` method return `nil`. It should check `requiredField`. **Solution:** Check the response value of `driver.Valuer.Value()`, if it is `nil` and not `requiredField`, skip the column.
codecov-io commented 3 years ago (Migrated from github.com)
Owner

Codecov Report

Merging #1167 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1167      +/-   ##
=========================================
- Coverage    54.7%   54.7%   -0.01%     
=========================================
  Files          42      42              
  Lines        7646    7648       +2     
=========================================
+ Hits         4183    4184       +1     
  Misses       2935    2935              
- Partials      528     529       +1
Impacted Files Coverage Δ
statement.go 66.96% <100%> (+0.08%) ⬆️
xorm.go 64.61% <0%> (-1.54%) ⬇️

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 fd49db5...fa40f1e. Read the comment docs.

# [Codecov](https://codecov.io/gh/go-xorm/xorm/pull/1167?src=pr&el=h1) Report > Merging [#1167](https://codecov.io/gh/go-xorm/xorm/pull/1167?src=pr&el=desc) into [master](https://codecov.io/gh/go-xorm/xorm/commit/fd49db598f00c3d2af461a85f55f4d00e0ae213b?src=pr&el=desc) will **decrease** coverage by `<.01%`. > The diff coverage is `100%`. [![Impacted file tree graph](https://codecov.io/gh/go-xorm/xorm/pull/1167/graphs/tree.svg?width=650&token=yB5nO1krEe&height=150&src=pr)](https://codecov.io/gh/go-xorm/xorm/pull/1167?src=pr&el=tree) ```diff @@ Coverage Diff @@ ## master #1167 +/- ## ========================================= - Coverage 54.7% 54.7% -0.01% ========================================= Files 42 42 Lines 7646 7648 +2 ========================================= + Hits 4183 4184 +1 Misses 2935 2935 - Partials 528 529 +1 ``` | [Impacted Files](https://codecov.io/gh/go-xorm/xorm/pull/1167?src=pr&el=tree) | Coverage Δ | | |---|---|---| | [statement.go](https://codecov.io/gh/go-xorm/xorm/pull/1167/diff?src=pr&el=tree#diff-c3RhdGVtZW50Lmdv) | `66.96% <100%> (+0.08%)` | :arrow_up: | | [xorm.go](https://codecov.io/gh/go-xorm/xorm/pull/1167/diff?src=pr&el=tree#diff-eG9ybS5nbw==) | `64.61% <0%> (-1.54%)` | :arrow_down: | ------ [Continue to review full report at Codecov](https://codecov.io/gh/go-xorm/xorm/pull/1167?src=pr&el=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/go-xorm/xorm/pull/1167?src=pr&el=footer). Last update [fd49db5...fa40f1e](https://codecov.io/gh/go-xorm/xorm/pull/1167?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
codecov-io commented 3 years ago (Migrated from github.com)
Owner

Codecov Report

Merging #1167 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1167      +/-   ##
=========================================
- Coverage    54.7%   54.7%   -0.01%     
=========================================
  Files          42      42              
  Lines        7646    7648       +2     
=========================================
+ Hits         4183    4184       +1     
  Misses       2935    2935              
- Partials      528     529       +1
Impacted Files Coverage Δ
statement.go 66.96% <100%> (+0.08%) ⬆️
xorm.go 64.61% <0%> (-1.54%) ⬇️

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 fd49db5...fa40f1e. Read the comment docs.

# [Codecov](https://codecov.io/gh/go-xorm/xorm/pull/1167?src=pr&el=h1) Report > Merging [#1167](https://codecov.io/gh/go-xorm/xorm/pull/1167?src=pr&el=desc) into [master](https://codecov.io/gh/go-xorm/xorm/commit/fd49db598f00c3d2af461a85f55f4d00e0ae213b?src=pr&el=desc) will **decrease** coverage by `<.01%`. > The diff coverage is `100%`. [![Impacted file tree graph](https://codecov.io/gh/go-xorm/xorm/pull/1167/graphs/tree.svg?width=650&token=yB5nO1krEe&height=150&src=pr)](https://codecov.io/gh/go-xorm/xorm/pull/1167?src=pr&el=tree) ```diff @@ Coverage Diff @@ ## master #1167 +/- ## ========================================= - Coverage 54.7% 54.7% -0.01% ========================================= Files 42 42 Lines 7646 7648 +2 ========================================= + Hits 4183 4184 +1 Misses 2935 2935 - Partials 528 529 +1 ``` | [Impacted Files](https://codecov.io/gh/go-xorm/xorm/pull/1167?src=pr&el=tree) | Coverage Δ | | |---|---|---| | [statement.go](https://codecov.io/gh/go-xorm/xorm/pull/1167/diff?src=pr&el=tree#diff-c3RhdGVtZW50Lmdv) | `66.96% <100%> (+0.08%)` | :arrow_up: | | [xorm.go](https://codecov.io/gh/go-xorm/xorm/pull/1167/diff?src=pr&el=tree#diff-eG9ybS5nbw==) | `64.61% <0%> (-1.54%)` | :arrow_down: | ------ [Continue to review full report at Codecov](https://codecov.io/gh/go-xorm/xorm/pull/1167?src=pr&el=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/go-xorm/xorm/pull/1167?src=pr&el=footer). Last update [fd49db5...fa40f1e](https://codecov.io/gh/go-xorm/xorm/pull/1167?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
lunny added this to the 1.0.0 milestone 2 years ago
Owner

We needs some tests.

We needs some tests.
lunny modified the milestone from 1.0.0 to 1.1.1 2 years ago
lunny modified the milestone from 1.1.1 to 1.0.0 2 years ago
lunny added the
kind/enhancement
label 2 years ago
lunny closed this pull request 2 years ago
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
The pull request has been merged as f13883a725.
Sign in to join this conversation.
Loading…
There is no content yet.