Closed dackroyd closed 5 years ago
Resolves #176
Merging #177 into master will increase coverage by
0.22%
. The diff coverage is100%
.
@@ Coverage Diff @@
## master #177 +/- ##
==========================================
+ Coverage 90.64% 90.87% +0.22%
==========================================
Files 15 15
Lines 727 745 +18
==========================================
+ Hits 659 677 +18
Misses 49 49
Partials 19 19
Impacted Files | Coverage Δ | |
---|---|---|
rows.go | 89.13% <100%> (+2.64%) |
:arrow_up: |
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 6c8a572...d5879ee. Read the comment docs.
looks good @dackroyd is there anything more you wanted to add, or shall we merge it?
Nothing more that I wanted to add @l3pp4rd, good to go unless anything else needs to be tidied up / changed! 👍
it looks good, thanks!
will tag it a day later, will check if users find something incompatible or concerning while using
The intention of sql.RawBytes is for it to hold memory owned by the database. When used, it's content is only valid until the
Next
,Scan
orClose
is called on theRows
To ensure that we meet this behaviour, when
[]byte
is used in a column, it's value is copied to a buffer that we keep track of for later invalidation. By doing this, incorrect use ofsql.RawBytes
values is exposed in tests that use go-sqlmock. Without this, when a real database is used and it's driver does share memory, then those issues would not be exposed until runtime (and in non-obvious ways)