DATA-DOG / go-sqlmock

Sql mock driver for golang to test database interactions
Other
6.05k stars 406 forks source link

migration from custom namedValue to driver.NamedValue #208

Closed Apologiz closed 4 years ago

Apologiz commented 4 years ago

build is failed because support driver.NamedValue appeared in Go 1.8. I think this is not important, because if the project has an old version of Go, they will not update the library version.

l3pp4rd commented 4 years ago

Hi, thanks for the changes to support gorm and others, though backward compatibility is very important, if it can be preserved, it should. I do not want to create the v2 just for this minor change, which can be made backward compatible in general. Just move the functions related to files before go 1.8 and after.

Apologiz commented 4 years ago

@l3pp4rd, unfortunately, as you suggested, it will not work, because gorm inside has checks sql.NamedArg structure.

Apologiz commented 4 years ago

I doubt that those who did not upgrade Go to version 1.8+ will start updating the DATA-DOG/go-sqlmock library. It's time to stop supporting mammoths :)

codecov-io commented 4 years ago

Codecov Report

Merging #208 into master will increase coverage by 2.68%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #208      +/-   ##
=========================================
+ Coverage   91.52%   94.2%   +2.68%     
=========================================
  Files          16      18       +2     
  Lines         802     915     +113     
=========================================
+ Hits          734     862     +128     
+ Misses         49      38      -11     
+ Partials       19      15       -4
Impacted Files Coverage Δ
expectations.go 87.14% <ø> (+2%) :arrow_up:
statement.go 100% <ø> (ø) :arrow_up:
sqlmock.go 93.3% <ø> (-0.59%) :arrow_down:
statement_before_go18.go 100% <100%> (ø)
statement_go18.go 100% <100%> (ø)
sqlmock_before_go18.go 100% <100%> (ø) :arrow_up:
sqlmock_go18.go 100% <100%> (ø) :arrow_up:
expectations_before_go18.go 87.09% <100%> (+13.18%) :arrow_up:
expectations_go18.go 94.73% <100%> (+8.07%) :arrow_up:
... and 4 more

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 b91d98d...4fbf605. Read the comment docs.

Apologiz commented 4 years ago

@l3pp4rd, I added mammoth support and covered in tests :)

l3pp4rd commented 4 years ago

very good, thanks!