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

Add MS SQL Server Support #222

Merged
merged 14 commits into from
May 21, 2019
Merged

Add MS SQL Server Support #222

merged 14 commits into from
May 21, 2019

Conversation

nathan-c
Copy link
Contributor

Finished the work started by @bwiggs and added tests.

@coveralls
Copy link

coveralls commented May 19, 2019

Pull Request Test Coverage Report for Build 404

  • 147 of 216 (68.06%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 51.69%

Changes Missing Coverage Covered Lines Changed/Added Lines %
database/mssql/mssql.go 147 216 68.06%
Totals Coverage Status
Change from base Build 400: 0.1%
Covered Lines: 780
Relevant Lines: 1509

💛 - Coveralls

Copy link
Member

@dhui dhui left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

Could you also add MS SQL Server to the list of supported DBs in the README

I don't know MS SQL Server well enough to validate the queries, but the tests seem to provide decent coverage...

Env: map[string]string{"ACCEPT_EULA": "Y", "SA_PASSWORD": saPassword, "MSSQL_PID": "Express"},
PortRequired: true, ReadyFunc: isReady,
}
// Supported versions: https://www.mysql.com/support/supportedplatforms/database.html
Copy link
Member

Choose a reason for hiding this comment

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

Also add this link (lists available image tags) as a comment: https://mcr.microsoft.com/v2/mssql/server/tags/list

} else if err != nil {
return &database.Error{OrigErr: err, Err: "try lock failed", Query: []byte(query)}
} else {
return &database.Error{Err: fmt.Sprintf("try lock failed with error %v", lockErrorMap[int(status)]), Query: []byte(query)}
Copy link
Member

Choose a reason for hiding this comment

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

Also expose the actual mssql.ReturnStatus in case the mapping doesn't contain the return status.

ErrDatabaseDirty = fmt.Errorf("database is dirty")
)

var lockErrorMap = map[int]string{
Copy link
Member

Choose a reason for hiding this comment

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

Change this to map[mssql.ReturnStatus]string

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