Skip to content

Conversation

bkali
Copy link
Contributor

@bkali bkali commented May 18, 2016

This is a pull request to implement dynamic table names as described in issue #318

@coveralls
Copy link

Coverage Status

Coverage decreased (-60.9%) to 0.0% when pulling 35e31ad on bkali:master into 6a3c8a8 on go-gorp:master.

@bkali
Copy link
Contributor Author

bkali commented May 18, 2016

I see that the test coverage % has not passed. I can fix that. Please let me know if you have any other feedback. Thanks,

Biju

@bkali
Copy link
Contributor Author

bkali commented May 18, 2016

I added some more test code to increase test coverage. When I build on my dev machine I see 71% test coverage. Coveralls is reporting 60.9% test coverage.. I am not sure which one to believe.. :-)

PASS
coverage: 71.4% of statements
ok github.com/bkali/gorp 103.338s

@coveralls
Copy link

Coverage Status

Coverage decreased (-60.9%) to 0.0% when pulling eddd970 on bkali:master into 6a3c8a8 on go-gorp:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+5.5%) to 66.407% when pulling c44bca1 on bkali:master into 6a3c8a8 on go-gorp:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+5.8%) to 66.731% when pulling 86fb555 on bkali:master into 6a3c8a8 on go-gorp:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+5.8%) to 66.731% when pulling bd2d2ba on bkali:master into 6a3c8a8 on go-gorp:master.

gorp.go Outdated
// use different database table names during runtime
// while sharing the same golang struct for in-memory data
type DynamicTable interface {
GetTableName() string
Copy link
Member

Choose a reason for hiding this comment

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

In keeping with the getters section of Effective Go, can we rename this to TableName()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I can change it to TableName(), will update the code within the next couple of days. Thanks!
Biju

@nelsam
Copy link
Member

nelsam commented Jul 2, 2016

Sorry about the long delay; I'm going to start going through pull requests gradually and hopefully get things moving toward v2 again. The only thing I saw that I would prefer changed is the GetTableName method, looks good to merge otherwise.

@coveralls
Copy link

coveralls commented Jul 3, 2016

Coverage Status

Coverage increased (+5.8%) to 66.731% when pulling 6c13097 on bkali:master into 6a3c8a8 on go-gorp:master.

@stxml
Copy link

stxml commented Jul 3, 2016

Weird style for "if" checks. It's the opposite of how standard Go and Gorp uses them, except when you check errors, then it's standard.

if nil != foo {
...
}

if foo != nil {
...
}

@bkali
Copy link
Contributor Author

bkali commented Jul 3, 2016

@stxml : good catch 👍 It is an old habit of mine from C++ days (constants on the left of equality operator to avoid accidental assignment).

@nelsam
Copy link
Member

nelsam commented Jul 17, 2016

I'll just swap the order post-merge :)

I'm going over this one last time and am going to run tests locally.

}
if nil == dbObjs {
t.Errorf("Nil return from dbmap.Select")
} else {
Copy link
Member

Choose a reason for hiding this comment

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

I'm also updating this - t.Fatalf will perform the same comparison but halt the test immediately, making this else statement unnecessary.

@nelsam nelsam merged commit 6c13097 into go-gorp:master Jul 17, 2016
nelsam added a commit that referenced this pull request Jul 17, 2016
@bkali
Copy link
Contributor Author

bkali commented Jul 18, 2016

Thank you very much @nelsam !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants