Skip to content
This repository has been archived by the owner on Sep 7, 2021. It is now read-only.
This repository is currently being migrated. It's locked while the migration is in progress.

Nil ptr is nullable #661

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Nil ptr is nullable #661

wants to merge 4 commits into from

Conversation

oherych
Copy link
Contributor

@oherych oherych commented Jul 26, 2017

test for this pull request #531

@lunny lunny added the testing label Jul 26, 2017
@lunny lunny added this to the 0.7 milestone Jul 26, 2017
@codecov-io
Copy link

Codecov Report

Merging #661 into master will increase coverage by 0.12%.
The diff coverage is 55.55%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #661      +/-   ##
==========================================
+ Coverage    48.3%   48.42%   +0.12%     
==========================================
  Files          34       34              
  Lines        8378     8386       +8     
==========================================
+ Hits         4047     4061      +14     
+ Misses       3844     3838       -6     
  Partials      487      487
Impacted Files Coverage Δ
helpers.go 53.42% <55.55%> (+1.6%) ⬆️
xorm.go 67.14% <0%> (ø) ⬆️
engine.go 54.5% <0%> (+0.38%) ⬆️

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 7c2d924...ec47a11. Read the comment docs.

@codecov-io
Copy link

codecov-io commented Jul 26, 2017

Codecov Report

Merging #661 into master will increase coverage by 0.12%.
The diff coverage is 55.55%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #661      +/-   ##
==========================================
+ Coverage    48.3%   48.42%   +0.12%     
==========================================
  Files          34       34              
  Lines        8378     8386       +8     
==========================================
+ Hits         4047     4061      +14     
+ Misses       3844     3838       -6     
  Partials      487      487
Impacted Files Coverage Δ
helpers.go 53.42% <55.55%> (+1.6%) ⬆️
xorm.go 67.14% <0%> (ø) ⬆️
engine.go 54.5% <0%> (+0.38%) ⬆️

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 7c2d924...ec47a11. Read the comment docs.


_, err := testEngine.Insert(c)
_, err := testEngine.Nullable("nullable2").Insert(c)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so maybe add another insert to remove Nullable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you agree that Nullable() is not need here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, since there is a xorm:"null" and it's really a nil pointer. I think we should give it a null on DB as default. Any idea?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me see

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like the idea with session.Statement.nullableMap. Looks like it can be filled only from .Sync(c). I`m not sure is all use this method for migration.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So what the default value do you think if have or not .Nullable("nullable2")?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently, we have a empty string but I would like to have Nil

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lunny, what is your answer?

@lunny
Copy link
Member

lunny commented Apr 10, 2018

please resolve conflicts.

@lunny lunny modified the milestones: 0.7, 0.8 Apr 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants