-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding ability to change column rename function #66
Conversation
@blainehansen there are some merge conflicts if yo can get those addressed Ill merge and release. |
There you go 😄 |
assert.Contains(t, lowerKeys, "lastlower") | ||
|
||
// changing rename function | ||
SetColumnRenameFunction(strings.ToUpper) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the tests are failing because of this line. I think this exposes what maybe a larger concern which is that this is changing the functionality at a global level. Im starting to think this should be provided as an argument and something that the dataset maintains so you could have different instances of datasets each with potentially different transform methods, that also help prevent tests from inadvertently leak into other tests.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's actually what I hoped to do initially, to have this whole thing be more "object-oriented", but since the createColumnMap
method is pretty divorced from a dataset or database, and it seems like it would take a bit of finagling to pass a relevant object down through all the layers. But we could probably figure it out 😄
Codecov Report
@@ Coverage Diff @@
## master #66 +/- ##
==========================================
+ Coverage 80.72% 80.78% +0.05%
==========================================
Files 17 17
Lines 2169 2175 +6
==========================================
+ Hits 1751 1757 +6
Misses 310 310
Partials 108 108
Continue to review full report at Codecov.
|
Fixed merge conflicts and reopened with a new PR #83 Ill release this with v6.1.0 |
The Feature
It would be nice to be able to choose how
ScanStruct(s)
by default maps its fields to the table, without having to redundantly tag the fields.A little use case
A test that isn't passing?
There's a test that isn't passing, in
crud_exec_test.go
,TestScanStruct
, related totestEmbeddedPtrCrudActionItem
. Here's the log:It's not passing in git commit
cd495d70a4ff280202e22a09de9502a3fe0b66cb
, which is master's current state, at least in my checkout when I runGO_VERSION=latest docker-compose run goqu
.Hopefully we can still consider my feature addition :)