Skip to content
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

sql/driver: misc cleanup #2375

Merged
merged 1 commit into from
Sep 6, 2015
Merged

sql/driver: misc cleanup #2375

merged 1 commit into from
Sep 6, 2015

Conversation

tamird
Copy link
Contributor

@tamird tamird commented Sep 5, 2015

  • sql/driver/conn.go: variable renaming
  • sql/driver/conn.go: small refactoring
  • sql/driver/conn.go: avoid copying a slice
  • static interface implementation assertions
  • sql/driver.Parameters -> sql.parameters
  • sql/driver.Value implements driver.Valuer

@@ -62,50 +115,3 @@ func (Request) Method() Method {
func (Request) CreateReply() Response {
return Response{}
}

// GetParameters returns the Params slice as a `parameters`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This code movement was part of Vivek's change. Unless there was some crucial urgency to doing this move, just wait until his change gets merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep.

@petermattis
Copy link
Collaborator

LGTM, though hold off on merging until Vivek's change goes in. A cleanup PR like this should never place additional burden on another person's PR (e.g. having to deal with a rebase and code movement). I would even go farther to say that it is mildly dangerous to move code as you've done with the sql/driver.Datum stuff when you know another active PR is touching the same code. It would be very easy to lose changes due to an incorrect merge (for example, handling time.Time in the type switch).

@tamird tamird changed the title sql/driver: various cleanup sql/driver: misc cleanup Sep 5, 2015
- sql/driver/conn.go: variable renaming
- sql/driver/conn.go: small refactoring
- sql/driver/conn.go: avoid copying a slice
- sql/driver/conn.go: Exec avoids conversion to rows
- static interface implementation assertions
- sql/driver.Value implements `driver.Valuer`
const (
// Endpoint is the URL path prefix which accepts incoming
// HTTP requests for the SQL API.
Endpoint = "/sql/"

timestampWithOffsetZoneFormat = "2006-01-02 15:04:05.999999999-07:00"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vivekmenezes note I removed this - there was no test checking it, and AFAICT it's only used in (driver.Datum).String() which isn't used anywhere. I added a test in wire_test.go, PTAL.

@petermattis
Copy link
Collaborator

LGTM

tamird added a commit that referenced this pull request Sep 6, 2015
@tamird tamird merged commit d4d8ea9 into cockroachdb:master Sep 6, 2015
@tamird tamird deleted the sql-clean-up branch September 6, 2015 18:49
@vivekmenezes
Copy link
Contributor

Lgtm

On Sun, Sep 6, 2015, 2:48 PM Peter Mattis notifications@github.com wrote:

LGTM


Reply to this email directly or view it on GitHub
#2375 (comment)
.

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.

3 participants